An MCP (Model Context Protocol) server that connects AI assistants to your Public.com brokerage account. Trade stocks, options, and crypto — get quotes, manage orders, and view your portfolio — all through natural language.
Disclaimer: For illustrative and informational purposes only. Not investment advice or recommendations. Use at your own risk.
| Tool | Description |
|---|---|
check_setup |
Verify API credentials and connectivity |
get_accounts |
List all brokerage accounts |
get_portfolio |
View positions, equity, buying power, open orders |
get_orders |
List active/open orders |
get_order |
Get status of a specific order |
get_history |
Transaction history (trades, deposits, dividends, etc.) |
get_quotes |
Real-time quotes for stocks, crypto, options |
get_instrument |
Details about a specific tradeable instrument |
get_all_instruments |
List all available instruments with filters |
get_option_expirations |
Available expiration dates for options |
get_option_chain |
Full option chain (calls + puts) for a symbol |
get_option_greeks |
Greeks (delta, gamma, theta, vega, rho, IV) |
preflight_order |
Estimate costs/impact before placing a single-leg order |
preflight_multileg_order |
Estimate costs for multi-leg options strategies |
| Tool | Description |
|---|---|
place_order |
Place a single-leg order (stocks, crypto, options) |
place_multileg_order |
Place multi-leg orders (spreads, straddles, etc.) |
cancel_order |
Cancel an existing order |
cancel_and_replace_order |
Atomically cancel and replace an order |
- Python 3.10+
- Public.com account — Sign up
- Public.com API key — Get one here
pip install publicdotcom-mcp-serverOr install from source:
git clone https://github.com/publicdotcom/publicdotcom-mcp-server.git
cd publicdotcom-mcp-server
pip install .Set your API credentials as environment variables:
# Required
export PUBLIC_COM_SECRET=your_api_secret_key
# Optional — sets a default account so you don't need to specify it each time
export PUBLIC_COM_ACCOUNT_ID=your_account_idAdd this to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"public-com": {
"command": "publicdotcom-mcp-server",
"env": {
"PUBLIC_COM_SECRET": "your_api_secret_key",
"PUBLIC_COM_ACCOUNT_ID": "your_account_id"
}
}
}
}If you prefer using uvx (no pre-install needed):
{
"mcpServers": {
"public-com": {
"command": "uvx",
"args": ["publicdotcom-mcp-server"],
"env": {
"PUBLIC_COM_SECRET": "your_api_secret_key",
"PUBLIC_COM_ACCOUNT_ID": "your_account_id"
}
}
}
}# stdio transport (default — for Claude Desktop, Claude Code, etc.)
publicdotcom-mcp-server
# Or run as a Python module
python -m publicdotcom_mcp_servernpx @modelcontextprotocol/inspector publicdotcom-mcp-server# Clone and install in development mode
git clone https://github.com/publicdotcom/publicdotcom-mcp-server.git
cd publicdotcom-mcp-server
pip install -e ".[dev]"
# Run tests
pytest
# Run the server locally
python -m publicdotcom_mcp_serverThis server wraps the publicdotcom-py Python SDK, exposing each API operation as an MCP tool. The MCP protocol allows AI clients to discover and call these tools through a standardized interface.
AI Client (Claude, etc.)
↕ MCP Protocol (stdio)
Public.com MCP Server
↕ HTTPS
Public.com Trading API
All tools include proper MCP tool annotations:
- Read-only tools are marked with
readOnlyHint: true - Write tools are marked with
destructiveHint: true