Public.com MCP Server
OfficialThe Public.com MCP Server connects AI assistants to a Public.com brokerage account, enabling trading, portfolio management, and market data retrieval through natural language.
Account & Portfolio Management
Verify API credentials and connectivity
List all associated brokerage accounts
View portfolio details: positions, equity, buying power, and open orders
Retrieve transaction history (trades, deposits, dividends, splits, etc.)
List and inspect active/open orders by ID
Market Data & Instrument Lookup
Get real-time quotes for stocks, crypto, options, and indices
Retrieve historical OHLCV price data with flexible periods and aggregations
Look up details and trading status for specific instruments
Browse all available tradeable instruments with filters
Options Research
Get available expiration dates for any optionable symbol
Retrieve full option chains (calls and puts) for a symbol and expiration
Fetch option Greeks (delta, gamma, theta, vega, rho, implied volatility) for one or multiple contracts
Preflight (Cost Estimation — No Trade Placed)
Estimate costs, fees, and buying power impact for single-leg orders (stocks, crypto, options)
Estimate costs for multi-leg options strategies
Estimate costs for short-sale and spread strategies (Bear Call, Bull Call, Bull Put, Bear Put)
Order Placement (Real Trades)
Place single-leg orders (buy/sell stocks, crypto, or options; market, limit, stop, stop-limit)
Place multi-leg orders (spreads, straddles, and other complex strategies)
Dedicated tools for Bear Call Spread, Bull Call Spread, Bull Put Spread, and Bear Put Spread
Place equity short-sale orders
Cancel open orders or atomically cancel-and-replace with new parameters
Flatten an existing long position and immediately go short (experimental two-order workflow)
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Public.com MCP Servershow me my portfolio holdings"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Public.com MCP Server
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.
Tools
Read-Only
Tool | Description |
| Verify API credentials and connectivity |
| List all brokerage accounts |
| View positions, equity, buying power, open orders |
| List active/open orders |
| Get status of a specific order |
| Transaction history (trades, deposits, dividends, etc.) |
| Real-time quotes for stocks, crypto, options |
| OHLCV price history for equities, crypto, options, or indices |
| Details about a specific tradeable instrument |
| List all available instruments with filters |
| Available expiration dates for options |
| Full option chain (calls + puts) for a symbol |
| Greeks (delta, gamma, theta, vega, rho, IV) for multiple options |
| Greeks for a single option symbol |
| Estimate costs/impact before placing a single-leg order |
| Estimate costs for multi-leg options strategies |
| Estimate costs before placing a short-sale order |
| Estimate costs for a Bear Call Spread |
| Estimate costs for a Bull Call Spread |
| Estimate costs for a Bull Put Spread |
| Estimate costs for a Bear Put Spread |
Write (Destructive)
Tool | Description |
| Place a single-leg order (stocks, crypto, options) |
| Place multi-leg orders (spreads, straddles, etc.) |
| Place a Bear Call Spread |
| Place a Bull Call Spread |
| Place a Bull Put Spread |
| Place a Bear Put Spread |
| Place an equity short-sale order |
| Sell an existing long position then go short (experimental) |
| Cancel an existing order |
| Atomically cancel and replace an order |
Related MCP server: DhanHQ MCP Server
Prerequisites
Python 3.10+
Public.com account — Sign up
Public.com API key — Get one here
Installation
pip install publicdotcom-mcp-serverOr install from source:
git clone https://github.com/publicdotcom/publicdotcom-mcp-server.git
cd publicdotcom-mcp-server
pip install .Configuration
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_idUsage
Claude Desktop
Add 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"
}
}
}
}Claude Desktop (using uvx)
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"
}
}
}
}Running Directly
# stdio transport (default — for Claude Desktop, Claude Code, etc.)
publicdotcom-mcp-server
# Or run as a Python module
python -m publicdotcom_mcp_serverHosted / Remote Deployment
For remote deployments (behind a reverse proxy or load balancer), switch to the streamable-HTTP transport:
export MCP_TRANSPORT=streamable-http
export PUBLIC_COM_SECRET=your_api_secret_key
export PORT=8000 # optional, defaults to 8000
export HOST=0.0.0.0 # optional, defaults to 0.0.0.0
publicdotcom-mcp-serverIn this mode the server listens for MCP requests at POST /mcp. Clients authenticate per-request via an Authorization: Bearer <key> header, which takes priority over the PUBLIC_COM_SECRET environment variable — useful for multi-tenant deployments.
Testing with MCP Inspector
npx @modelcontextprotocol/inspector publicdotcom-mcp-serverDevelopment
# 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_serverCI & Releases
CI (
.github/workflows/ci.yml) runs the test suite (Python 3.10–3.13) andruffon every push tomainand every pull request.Releases (
.github/workflows/release.yml) run on every push tomain. When theversioninpyproject.tomlis one that hasn't been released yet (no matchingv<version>tag), the workflow builds the package, publishes to PyPI via Trusted Publishing (OIDC) — no API token is stored — and creates the corresponding GitHub Release. Merges that don't change the version are no-ops.
To cut a release: bump version in pyproject.toml in your PR and merge it to main. The release + PyPI publish + v<version> tag/GitHub Release happen automatically. One-time setup on PyPI (project → Publishing) must register a Trusted Publisher for this repo with workflow release.yml and environment pypi.
How It Works
This 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 APIAll tools include proper MCP tool annotations:
Read-only tools are marked with
readOnlyHint: trueOrder-placement tools are marked with
readOnlyHint: false(they modify account state)Order cancellation tools (
cancel_order,cancel_and_replace_order) are additionally marked withdestructiveHint: true
License
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/PublicDotCom/publicdotcom-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server