Public.com MCP Server logo

Public.com MCP Server

Organization
PublicDotCom

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…

PublisherPublicDotCom
Repositorypublicdotcom-mcp-server
LanguagePython
Forks
7
Stars
66
Available tools
0
Transport typestdio, streamable-http
Categories
LicenseApache-2.0
Links
  • Connect tools to AI workflows

    Public.com MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    66 stars and 7 forks from the linked repository.

Public.com MCP Server

License Python MCP

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

ToolDescription
check_setupVerify API credentials and connectivity
get_accountsList all brokerage accounts
get_portfolioView positions, equity, buying power, open orders
get_ordersList active/open orders (bracket legs share a bracketId)
get_orderGet status of a specific order
get_historyTransaction history (trades, deposits, dividends, etc.)
get_quotesReal-time quotes for stocks, crypto, options
get_price_historyOHLCV price history for equities, crypto, options, or indices
get_instrumentDetails about a specific tradeable instrument
get_all_instrumentsList all available instruments with filters
search_bondsFiltered, paged search for fixed income instruments
get_bond_detailsPricing, ratings, coupon and maturity info for a bond
get_option_expirationsAvailable expiration dates for options
get_option_chainFull option chain (calls + puts) for a symbol
get_option_greeksGreeks (delta, gamma, theta, vega, rho, IV) for multiple options
get_option_greekGreeks for a single option symbol
get_tax_lotsUnrealized tax-lot summary (per-lot gain/loss, term, cost basis)
get_tax_lots_for_symbolUnrealized tax-lot detail for a single symbol
get_tax_lots_csvExport unrealized tax lots as a Base64-encoded CSV file
get_strategy_quoteConsolidated quote for a multi-leg option strategy
preflight_orderEstimate costs/impact before placing a single-leg order
preflight_multileg_orderEstimate costs for multi-leg options strategies
preflight_short_orderEstimate costs before placing a short-sale order
preflight_call_credit_spreadEstimate costs for a Bear Call Spread
preflight_call_debit_spreadEstimate costs for a Bull Call Spread
preflight_put_credit_spreadEstimate costs for a Bull Put Spread
preflight_put_debit_spreadEstimate costs for a Bear Put Spread

Write (Destructive)

ToolDescription
place_orderPlace a single-leg order (stocks, crypto, options); optionally a bracket order via order_class + exit-leg prices, or target specific tax lots via tax_lot_matching_instructions
place_multileg_orderPlace multi-leg orders (spreads, straddles, etc.)
place_call_credit_spreadPlace a Bear Call Spread
place_call_debit_spreadPlace a Bull Call Spread
place_put_credit_spreadPlace a Bull Put Spread
place_put_debit_spreadPlace a Bear Put Spread
place_short_orderPlace an equity short-sale order
flatten_and_go_shortSell an existing long position then go short (experimental)
cancel_orderCancel an existing order
cancel_and_replace_orderAtomically cancel and replace an order

Bracket orders

place_order places a bracket by setting order_class to BRACKET, OCO or OTO and supplying at least one exit leg:

ArgumentMeaning
order_classSIMPLE (default, standalone) or BRACKET / OCO / OTO
take_profit_limit_priceLimit price of the take-profit leg
stop_loss_stop_priceStop price of the stop-loss leg
stop_loss_limit_priceOptional — makes the stop-loss a STOP_LIMIT rather than a STOP

The exit legs are submitted automatically when the entry order fills, and every leg of the bracket — the entry included — reports the entry's order ID as its bracketId, so get_orders groups them.

The API accepts brackets for EQUITY and OPTION only; they need a whole-share quantity (not amount), must use the CORE market session, and the entry order_type must be LIMIT or MARKET (LIMIT only for OCO). preflight_order validates the entry order only — it has no view of the exit legs.

Prerequisites

Installation

bash
pip install publicdotcom-mcp-server

Or install from source:

bash
git clone https://github.com/publicdotcom/publicdotcom-mcp-server.git
cd publicdotcom-mcp-server
pip install .

Configuration

Set your API credentials as environment variables:

bash
# 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_id

Usage

Claude Desktop

Add this to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

json
{
  "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):

json
{
  "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

bash
# stdio transport (default — for Claude Desktop, Claude Code, etc.)
publicdotcom-mcp-server

# Or run as a Python module
python -m publicdotcom_mcp_server

Hosted / Remote Deployment

For remote deployments (behind a reverse proxy or load balancer), switch to the streamable-HTTP transport:

bash
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-server

In 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

bash
npx @modelcontextprotocol/inspector publicdotcom-mcp-server

Development

bash
# 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_server

CI & Releases

  • CI (.github/workflows/ci.yml) runs the test suite (Python 3.10–3.13) and ruff on every push to main and every pull request.
  • Releases (.github/workflows/release.yml) run on every push to main. When the version in pyproject.toml is one that hasn't been released yet (no matching v<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 API

All tools include proper MCP tool annotations:

  • Read-only tools are marked with readOnlyHint: true
  • Order-placement tools are marked with readOnlyHint: false (they modify account state)
  • Order cancellation tools (cancel_order, cancel_and_replace_order) are additionally marked with destructiveHint: true

License

Apache 2.0

Installation

TypingMind
{
  "mcpServers": {
    "publicdotcom-mcp-server": {
      "command": "npx",
      "args": [
        "publicdotcom-mcp-server"
      ],
      "env": {
        "PUBLIC_COM_SECRET": "<PUBLIC_COM_SECRET>"
      }
    }
  }
}

Use Public.com MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Public.com MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Public.com MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Public.com MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "publicdotcom-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "publicdotcom-mcp-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Public.com MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Public.com MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Public.com MCP Server to help me with this task?
Public.com MCP Server
Sure. I read it.
Here is what I found using Public.com MCP Server.

Option 2: Add an MCP server URL

Use this when Public.com MCP Server is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter the MCP server URL from the provider in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste the MCP server URL from the provider into the Server URL field.
  2. Enter a connection name for Public.com MCP Server.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the Public.com MCP Server connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the Public.com MCP Server tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the Public.com MCP Server tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Public.com MCP Server to help me with this task?
Public.com MCP Server
Sure. I read it.
Here is what I found using Public.com MCP Server.

Frequently asked questions

What is the Public.com MCP Server MCP server used for?

Public.com MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Public.com MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Public.com MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Public.com MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Public.com MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Public.com MCP Server MCP to TypingMind?

Public.com MCP Server can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does Public.com MCP Server MCP provide in TypingMind?

Public.com MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Public.com MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Public.com MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇