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.
Install dependencies
Add the Public MCP Server to Claude Desktop
Retrieve portfolio data and place trades
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.
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.
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 uvOpen 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 -eMCP 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.
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.
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.
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.
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 FridayOnce 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
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.