Connect AI agents to Alpaca's Trading API, Market Data API, and Broker API through hosted plugins, remote MCP servers, a local Trading MCP server, or the Alpaca Trading CLI.
| Option | Best for | Setup |
|---|---|---|
| Agent plugins | Hosted MCP setup in Cursor, Claude Code, and Codex | Install plugins |
| Manual remote MCP | Hosted OAuth MCP setup in supported clients, including VS Code for Broker MCP | Configure remote MCP |
| Local Trading MCP | Running Trading and Market Data MCP locally with API keys | Run locally |
| Alpaca Trading CLI | Terminal, scripts, CI, and focused agent actions | Use the CLI |
Use Trading MCP for an individual Alpaca trading account and market data. Use Broker MCP if you're a broker partner building and operating end-customer investing experiences.
- An Alpaca account.
- A supported MCP client such as Cursor, Claude Code, Codex, or VS Code.
Plugins are the easiest way to connect Cursor, Claude Code, or Codex to Alpaca's hosted OAuth-protected MCP endpoints. No API keys to copy around — sign in with your Alpaca account on first use.
| Plugin | Bundled MCP servers |
|---|---|
alpaca-trading |
Trading API (live), Trading API (paper), Market Data API |
alpaca-broker |
Broker API (live), Broker API (sandbox) |
| MCP server | Endpoint |
|---|---|
alpaca-trading |
https://api.alpaca.markets/mcp |
alpaca-trading-paper |
https://paper-api.alpaca.markets/mcp |
alpaca-market-data |
https://data.alpaca.markets/mcp |
alpaca-broker |
https://broker-api.alpaca.markets/mcp |
alpaca-broker-sandbox |
https://broker-api.sandbox.alpaca.markets/mcp |
Install one or both plugins depending on whether you're building trading or broker workflows.
Note
Hosted MCP access currently supports Cursor, Claude Code, and Codex through plugins. We're currently working on providing our plugins and MCP servers to as many of our users as possible. To request support for another client, open an issue and we will get that sorted as soon as we can.
- Open the command palette:
Cmd + Shift + P(macOS) orCtrl + Shift + P(Windows/Linux). - Run
Open Customize, then click Browse Marketplace. - Click Add Marketplace, choose Import from GitHub, and enter
https://github.com/alpacahq/agentic. - Install
alpaca-trading,alpaca-broker, or both.
Start one of the installed MCP servers to complete its browser-based OAuth flow.
claude plugin marketplace add alpacahq/agenticStart a Claude Code session and run /plugin. Select the alpaca-plugins marketplace, browse its plugins, and install alpaca-trading, alpaca-broker, or both. Run /reload-plugins, then use /mcp to start a server and complete its OAuth flow.
codex plugin marketplace add alpacahq/agenticInstall plugins from the alpaca-plugins marketplace, then complete the OAuth flow:
codex mcp login <mcp-name>If you don't want to use a plugin, copy the JSON for your client below. Use only that client's configuration because each client has its own sign-in settings.
{
"mcpServers": {
"alpaca-trading": {
"url": "https://api.alpaca.markets/mcp",
"auth": {
"CLIENT_ID": "PCBXWA7PCN3S6662PZK44KLURJ"
}
},
"alpaca-trading-paper": {
"url": "https://paper-api.alpaca.markets/mcp",
"auth": {
"CLIENT_ID": "PCBXWA7PCN3S6662PZK44KLURJ"
}
},
"alpaca-market-data": {
"url": "https://data.alpaca.markets/mcp",
"auth": {
"CLIENT_ID": "PCBXWA7PCN3S6662PZK44KLURJ"
}
}
}
}{
"mcpServers": {
"alpaca-trading": {
"type": "http",
"url": "https://api.alpaca.markets/mcp"
},
"alpaca-trading-paper": {
"type": "http",
"url": "https://paper-api.alpaca.markets/mcp"
},
"alpaca-market-data": {
"type": "http",
"url": "https://data.alpaca.markets/mcp"
}
}
}{
"mcpServers": {
"alpaca-trading": {
"url": "https://api.alpaca.markets/mcp",
"oauth": {
"client_id": "PCIEJZTPCQEBUBAINMQOGDHF7I"
}
},
"alpaca-trading-paper": {
"url": "https://paper-api.alpaca.markets/mcp",
"oauth": {
"client_id": "PCIEJZTPCQEBUBAINMQOGDHF7I"
}
},
"alpaca-market-data": {
"url": "https://data.alpaca.markets/mcp",
"oauth": {
"client_id": "PCIEJZTPCQEBUBAINMQOGDHF7I"
}
}
}
}{
"mcpServers": {
"alpaca-broker": {
"url": "https://broker-api.alpaca.markets/mcp",
"auth": {
"CLIENT_ID": "PCBXWA7PCN3S6662PZK44KLURJ"
}
},
"alpaca-broker-sandbox": {
"url": "https://broker-api.sandbox.alpaca.markets/mcp",
"auth": {
"CLIENT_ID": "PCKU56KZNL2JHDU2BFNNNU4KVZ"
}
}
}
}{
"mcpServers": {
"alpaca-broker": {
"type": "http",
"url": "https://broker-api.alpaca.markets/mcp"
},
"alpaca-broker-sandbox": {
"type": "http",
"url": "https://broker-api.sandbox.alpaca.markets/mcp"
}
}
}{
"mcpServers": {
"alpaca-broker": {
"url": "https://broker-api.alpaca.markets/mcp",
"oauth": {
"client_id": "PCIEJZTPCQEBUBAINMQOGDHF7I"
}
},
"alpaca-broker-sandbox": {
"url": "https://broker-api.sandbox.alpaca.markets/mcp",
"oauth": {
"client_id": "PCQDJUXZE6UMJSTGGRFLONVLCE"
}
}
}
}Add either or both servers to .vscode/mcp.json:
{
"servers": {
"alpaca-broker-mcp": {
"type": "http",
"url": "https://broker-api.alpaca.markets/mcp"
},
"alpaca-broker-mcp-sandbox": {
"type": "http",
"url": "https://broker-api.sandbox.alpaca.markets/mcp"
}
}
}Open the command palette, run MCP: List Servers, select a server, and click Start Server to begin its OAuth flow. See the Broker MCP VS Code setup for details.
Run the open-source Trading MCP Server locally when you want API-key authentication or control over the server process and toolsets. See the Trading MCP Server documentation for setup instructions.
The Alpaca Trading CLI provides direct access to the Trading and Market Data APIs from your terminal. Use it for scripts, CI, or focused agent actions where a command-and-structured-output workflow is a better fit than a long-running MCP session.
See the Trading CLI documentation for installation and usage, or start with the Trading API documentation for API concepts and capabilities.