API

Get Started

WelcomeQuickstartExamplesChangelogSDKs and ToolsOrder Limits

Authorization

POSTCreate personal access token

List Accounts

GETGet accounts

Account Details

GETGet account portfolio v2GETGet history

Instrument Details

GETGet all instrumentsGETGet instrument

Market Data

POSTGet quotesPOSTGet option expirationsPOSTGet option chain

Order Placement

POSTPreflight single legPOSTPreflight multi legPOSTPlace orderPUTReplace orderPOSTPlace multileg orderGETGet orderDELETECancel order

Option Details

GETGet option greeks
HelpFeedback

Get Started

Claude Desktop: Connecting the Public MCP Server to Claude Desktop

Learn how to use Claude for trading by connecting your Public.com brokerage account to Claude Desktop via the official Public MCP server. Once connected, Claude becomes a trading agent that can research stocks, options, and crypto and place orders from a natural-language conversation. We'll walk through installation, configuration, and placing your first trade.

What You'll Do

Step 01

Install dependencies

Step 02

Add the Public MCP Server to Claude Desktop

Step 03

Retrieve portfolio data and place trades

What is Claude Desktop and MCP

Claude Desktop is Anthropic's native desktop application for macOS and Windows, bringing the full power of Claude directly to your computer. Claude Desktop supports the Model Context Protocol (MCP), an open standard that lets Claude securely connect to external tools, data sources, and services running on your machine.

MCP servers act as local bridges between Claude and the outside world. When you add an MCP server to Claude Desktop, Claude gains the ability to call tools provided by that server, without any data leaving your machine through a third party. This makes it well suited for sensitive use cases like brokerage access, where your API keys and account data stay local.

The Public MCP server exposes your Public.com brokerage account as a set of tools Claude can call directly. Once connected, you can use Claude for trading stocks, options, and crypto — asking it to pull live portfolio data, check quotes, research options chains, and execute orders through natural-language conversation. This effectively turns Claude Desktop into a personal trading bot you control entirely from chat, with your API key and account data staying local.

Before You Get Started

  • →Download and install Claude Desktop for macOS or Windows. A paid Claude subscription may be required to use MCP servers.
  • →You will need a Public.com brokerage account. Create one at public.com/signup.
  • →Once you create your Public brokerage account, you'll need two credentials from your API settings page:
    • API key (secret) — generate a new key and copy it somewhere safe. You will only see the full value once.
    • Account ID— shown on the same page. Copy this as well; you'll paste both into your config in Step 2.
1

Installing Dependencies

The Public MCP server runs via uv, a fast Python package manager. Follow the instructions for your operating system below. You will run each command by pasting it into a terminal window and pressing Enter.

macOS

Open the Terminal app (press Cmd + Space, type "Terminal", and press Enter). If you don't have Homebrew already installed on your machine, you can do so with the command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Next, use Homebrew to install uv:

brew install uv

Windows

Open PowerShell(press the Windows key, type "PowerShell", and press Enter), then run the official uv installer:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Alternatively, if you use winget:

winget install --id=astral-sh.uv -e
2

Adding the Public MCP Server to Claude Desktop

MCP servers are configured by editing Claude Desktop's configuration file, claude_desktop_config.json. Follow the instructions for your operating system to locate and open it.

macOS

In Finder, press Cmd + Shift + G to open the Go to Folder prompt, paste the path below, and press Enter:

~/Library/Application Support/Claude/

If claude_desktop_config.json already exists, open it with TextEdit. If it doesn't, create it: open TextEdit, go to Format → Make Plain Text(this step is required — TextEdit's default rich-text format will not work), then save the empty file into that folder with the exact name claude_desktop_config.json.

Windows

Open File Explorer, click the address bar at the top, paste the path below, and press Enter:

%APPDATA%\Claude\

If claude_desktop_config.json already exists, right-click it and choose Open with → Notepad. If it doesn't, create it: open Notepad, go to File → Save As, navigate to the folder above, change Save as type to All Files(so Windows doesn't silently add a .txt extension), and save the file as claude_desktop_config.json.

You'll now add a mcpServers entry to the file. In the snippet below, replace YOUR_PUBLIC_COM_SECRET and YOUR_ACCOUNT_ID with the API key and account ID you copied in the prerequisites. Keep the surrounding quotation marks intact:

"mcpServers": {
  "public-com": {
    "command": "uvx",
    "args": [
      "publicdotcom-mcp-server"
    ],
    "env": {
      "PUBLIC_COM_SECRET": "YOUR_PUBLIC_COM_SECRET",
      "PUBLIC_COM_ACCOUNT_ID": "YOUR_ACCOUNT_ID"
    }
  }
}

If the file is empty

Wrap the snippet above in curly braces so the whole file is valid JSON:

{
  "mcpServers": {
    "public-com": {
      "command": "uvx",
      "args": [
        "publicdotcom-mcp-server"
      ],
      "env": {
        "PUBLIC_COM_SECRET": "YOUR_PUBLIC_COM_SECRET",
        "PUBLIC_COM_ACCOUNT_ID": "YOUR_ACCOUNT_ID"
      }
    }
  }
}

If the file already has content

Your config may already contain other top-level keys (for example, a preferences block or other MCP servers). Do not replace the existing content — add the mcpServers key alongside what's already there, separated by a comma. For example, a merged file might look like this:

{
  "mcpServers": {
    "public-com": {
      "command": "uvx",
      "args": [
        "publicdotcom-mcp-server"
      ],
      "env": {
        "PUBLIC_COM_SECRET": "YOUR_PUBLIC_COM_SECRET",
        "PUBLIC_COM_ACCOUNT_ID": "YOUR_ACCOUNT_ID"
      }
    }
  },
  "preferences": {
    "... your existing preferences stay here ...": true
  }
}

If an mcpServers key is already present, add "public-com" as an additional entry inside it rather than creating a second mcpServers block.

Security Notice

Your API key is stored in plain text in this config file. Treat it like a password — do not share the file, commit it to source control, or expose it to others. It grants direct access to your brokerage account.

Save the file, then fully quit and relaunch Claude Desktop. Closing the window alone is not enough — Claude Desktop continues running in the background. On macOS, use Cmd + Q. On Windows, right-click the Claude icon in the system tray and choose Quit.

After relaunch, click the + icon in the chat input, then select Connectors. You should see public-com listed and selected.

3

Verifying the Connection

To confirm everything is connected correctly, start a new conversation in Claude Desktop and ask it to fetch your account balance:

Can you show me my current account balance and buying power?

Claude will call the Public MCP server and return your live account data. You'll see it working in real time — Claude will indicate when it's calling a tool before returning the result.

If Claude doesn't return account data and instead responds that it doesn't have access to brokerage tools, double check that you fully quit and relaunched Claude Desktop after saving the config file and check to see if the connector is turned on.

4

Retrieving Portfolio Data and Placing Trades

With the MCP server connected, you can use natural language to interact with your entire Public account. Start by pulling your portfolio to get a full picture of your holdings:

How is my portfolio performing today?

You can then research a specific asset before trading. Here's how to pull the options chain for a ticker:

Show me the options chain for AAPL expiring next Friday

Once you've identified a contract, you can place an order. Claude will run a preflight check — estimating the total cost, buying power impact, and fees — before submitting anything live:

Can you place a buy order for 1 AAPL call option expiring next Friday at the $200 strike?

Important

Placing a trade through Claude Desktop is a real order using real money in your Public account. Review all preflight details carefully before confirming. Only proceed if you fully understand and accept the risks involved.

More things you can ask

  • What is the current price of TSLA?
  • Show me my recent transactions
  • What are my open orders?
  • Cancel my open AAPL order
  • What is my buying power?
  • Show me the Greeks for my current options positions
  • Find a good covered call opportunity on SPY based on my holdings

What's Next

You've connected your Public.com brokerage to Claude Desktop via the Public MCP server. From here you can use Claude to trade stocks, options, and crypto — asking it to research equities, pull options chains, analyze your portfolio against market data, and execute orders all without leaving the conversation. Whether you want Claude as a research partner, a day-trading assistant, or a full trading agent handling routine portfolio actions, the same MCP connection covers each use case.

Because Claude Desktop runs locally, your API key and all brokerage data stay on your machine. You can also stack additional MCP servers alongside the Public one to give Claude access to other tools — news feeds, calendars, file systems, databases — making it straightforward to build richer, multi-source workflows.

For the full list of available tools and advanced configuration options, refer to the Public MCP Server GitHub repository.