Try Bifrost Enterprise free for 14 days.
Request access
[ STDIO MCP ]

How to Use Alpaca MCP Server with Bifrost

Connect AI agents to Alpaca’s stock trading and financial market data APIs through an MCP server.

[ MCP SERVER SUMMARY ]

Alpaca MCP server summary

Alpaca's MCP server connects AI assistants to trading, portfolio, and market-data APIs for stocks, options, and crypto. Bifrost keeps API keys at the gateway, limits which trading tools each agent can call, and logs every market action for review.

PropertyDetails
CompanyAlpaca
Connection typeSTDIO
AuthenticationAlpaca API key and secret
Package or endpointalpaca-mcp-server
CapabilitiesPaper and live trading APIs, Portfolio and account tools, Market data and quotes
Official documentationAlpaca MCP documentation

Before you start

  • uv / uvx installed
  • Alpaca API key and secret (paper trading recommended first)

What you can do with Alpaca

  • Prototype trading agents against paper accounts without distributing keys
  • Restrict live-order tools to a dedicated virtual key
  • Audit agent-initiated orders next to LLM decisions
FinanceTrading

[ HOW TO CONNECT ]

Connect Alpaca to Bifrost in three steps

1

Install Bifrost

Start the gateway locally or deploy in your VPC.

npx -y @maximhq/bifrost
2

Add Alpaca in MCP Gateway

Open MCP Gateway in the Bifrost dashboard, click New MCP Server, and choose STDIO. Or register via the API below.

• Use uvx alpaca-mcp-server with ALPACA_API_KEY and ALPACA_SECRET_KEY.

• Start with paper trading keys. V2 tool names differ from V1 — treat as a new server.

3

Point clients at Bifrost /mcp

Configure Claude Desktop, Cursor, or Claude Code to use your Bifrost endpoint with a virtual key instead of connecting directly to Alpaca.

{
  "mcpServers": {
    "bifrost": {
      "url": "http://localhost:8080/mcp",
      "headers": {
        "Authorization": "Bearer vk_your_virtual_key"
      }
    }
  }
}

[ EXAMPLE CONFIG ]

Register Alpaca via API

Add this MCP client with a POST to /api/mcp/client. See Connecting to MCP Servers for full options.

curl -X POST http://localhost:8080/api/mcp/client \
  -H "Content-Type: application/json" \
  -d '{
    "name": "alpaca",
    "connection_type": "stdio",
    "stdio_config": {
      "command": "uvx",
      "args": [
        "alpaca-mcp-server"
      ],
      "env": {
        "ALPACA_API_KEY": "env.ALPACA_API_KEY",
        "ALPACA_SECRET_KEY": "env.ALPACA_SECRET_KEY"
      }
    },
    "tools_to_execute": [
      "*"
    ]
  }'

[ WHY BIFROST ]

Run Alpaca through one governed gateway

Access control

Virtual keys, RBAC, and tool allowlists per team or agent.

Cost governance

Attribute MCP tool spend alongside LLM usage in one view.

Observability

Log every tool call with latency, server, and virtual key metadata.

Credential isolation

Upstream secrets stay in the gateway — not on every laptop.

[ FAQ ]

Common questions

What does the Alpaca MCP server do?

Alpaca exposes paper and live trading apis, portfolio and account tools, market data and quotes to MCP-compatible AI clients. Bifrost connects to it as an upstream MCP client and exposes approved tools through one governed /mcp endpoint.

How does Alpaca authenticate when used with Bifrost?

Alpaca uses Alpaca API key and secret. Store credentials in Bifrost's environment or credential configuration so they stay at the gateway instead of being copied into every AI client.

Can Claude Desktop, Cursor, or Claude Code use Alpaca through Bifrost?

Yes. After registering Alpaca in Bifrost, point any HTTP MCP-compatible client at the Bifrost /mcp endpoint and authenticate with a virtual key. The client sees only the tools allowed for that key.

[ MCP GATEWAY ]

One gateway for Alpaca and every other MCP server

Bifrost MCP Gateway gives you tool-level access control, audit logs, and up to 92% lower token costs when agents orchestrate multiple tools.