Skip to main content

SnapTrade MCP Server

A read-only MCP (Model Context Protocol) server that connects AI agents to brokerage data via SnapTrade. Works with Claude Code, Claude Desktop, Cursor, Windsurf, and any MCP-compatible client.

10 tools. Read-only. No trading. Safe by design.

What You Can Do

Tool Description
snaptrade_list_accounts List all connected brokerage accounts
snaptrade_get_balance Cash balances for an account
snaptrade_get_positions Current holdings (stocks, ETFs)
snaptrade_get_orders Order history with filters
snaptrade_get_activities Transaction log (dividends, fees)
snaptrade_portfolio_summary All accounts + balances + positions in one call
snaptrade_search_symbols Look up stocks/ETFs by name or ticker
snaptrade_list_brokerages Supported brokerages
snaptrade_check_status API health check
snaptrade_setup Generate URL to connect a new brokerage

Prerequisites

  1. SnapTrade API credentials — a clientId and consumerKey from snaptrade.com. Sign up for a developer account and find your keys in the dashboard.
  2. Python 3.10+

Where do my API keys go?

Your SnapTrade credentials never leave your machine. Here's what happens:

  • Your clientId and consumerKey are stored in a local config file on your computer (or in environment variables you set yourself).
  • The MCP server reads them at startup to authenticate with SnapTrade's API.
  • They are never sent to your AI client, never included in tool responses, and never logged.
  • The server is read-only — it cannot trade, modify accounts, or delete anything.

This is the same way any API integration handles credentials. Your keys stay on your machine, period.

Installation

Option A: Install from PyPI (recommended)

pip install snaptrade-mcp

That's it. This installs the snaptrade-mcp command and all dependencies.

Option B: Install from source

git clone https://github.com/micah63/snaptrade-mcp-server.git
cd snaptrade-mcp-server
pip install .

Add the MCP server to your AI client

Claude Code

The -s user flag stores your credentials in your personal Claude config (~/.claude/), not in the project — so they never end up in git.

claude mcp add snaptrade -s user \
  -e SNAPTRADE_CLIENT_ID=your_client_id \
  -e SNAPTRADE_CONSUMER_KEY=your_consumer_key \
  -- snaptrade-mcp

Then restart Claude Code and run /mcp to verify the server appears with all 10 tools.

Alternative: If you prefer to set credentials as environment variables in your shell (add to ~/.zshrc or ~/.bashrc), you can skip the -e flags:

# In your ~/.zshrc or ~/.bashrc:
export SNAPTRADE_CLIENT_ID="your_client_id"
export SNAPTRADE_CONSUMER_KEY="your_consumer_key"

# Then register without -e flags:
claude mcp add snaptrade -s user -- snaptrade-mcp

Claude Desktop

Add to your claude_desktop_config.json (Settings > Developer > Edit Config). This file lives in your user directory and is not part of any project.

{
  "mcpServers": {
    "snaptrade": {
      "command": "snaptrade-mcp",
      "env": {
        "SNAPTRADE_CLIENT_ID": "your_client_id",
        "SNAPTRADE_CONSUMER_KEY": "your_consumer_key"
      }
    }
  }
}

Restart Claude Desktop. The SnapTrade tools will appear in the tools menu.

Cursor

Add to .cursor/mcp.json in your project root. Add .cursor/mcp.json to your .gitignore so credentials don't get committed.

{
  "mcpServers": {
    "snaptrade": {
      "command": "snaptrade-mcp",
      "env": {
        "SNAPTRADE_CLIENT_ID": "your_client_id",
        "SNAPTRADE_CONSUMER_KEY": "your_consumer_key"
      }
    }
  }
}

First-Time Setup

After installing, ask your AI agent:

"Set up my SnapTrade connection"

This calls snaptrade_setup, which opens a browser window where you authorize your brokerage. You only need to do this once. Your user credentials are saved locally at ~/.snaptrade/config.json.

Example Prompts

  • "What brokerage accounts do I have?"
  • "Show me my full portfolio summary"
  • "What's my cash balance across all accounts?"
  • "Analyze my portfolio for diversification risk"
  • "What trades have I made recently?"
  • "Search for Apple stock"
  • "Which brokerages does SnapTrade support?"

Troubleshooting

Server fails to connect / "Failed to reconnect"

  • Verify the package is installed: python -c "from snaptrade_mcp.server import main; print('OK')"
  • If using a virtual environment, make sure snaptrade-mcp is installed in that environment.

"Missing credentials" error

  • Check that SNAPTRADE_CLIENT_ID and SNAPTRADE_CONSUMER_KEY are set in the -e flags (Claude Code) or env block (Claude Desktop / Cursor).

"No config found" error

  • Run snaptrade_setup through the MCP server first to connect a brokerage and create ~/.snaptrade/config.json.

Security

  • Read-only — no trading, no account modification, no deletes
  • Credentials isolated — API keys loaded from env vars, user secrets stored at ~/.snaptrade/config.json (chmod 600). Neither appears in tool responses.
  • No dangerous operations — cannot delete users, reset secrets, or modify anything

Architecture

snaptrade_mcp/
  server.py         # All 10 tools, 2 resources, 2 prompt templates
  __init__.py       # Package marker + version
  __main__.py       # Entry point (python -m snaptrade_mcp)
  requirements.txt  # Dependencies
  README.md         # This file

The server runs over STDIO (the default MCP transport). Each tool function calls the SnapTrade Python SDK, flattens the response into clean JSON, and returns it to the AI agent.

Metadata

Release files for snaptrade-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for snaptrade-mcp 0.1.0
File Size Uploaded Provenance
snaptrade_mcp-0.1.0.tar.gz 23.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for snaptrade-mcp 0.1.0
File Interpreter ABI Platform
snaptrade_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.6 kB

Release files / snaptrade_mcp-0.1.0.tar.gz

Download URL snaptrade_mcp-0.1.0.tar.gz
Size 23.0 kB
Tags Source
SHA-256 checksum
How to use checksums
40b8b83cac31565d1ccb948626a4ab844d467d6a925864c7086c048f12ebe187
BLAKE2b-256 checksum
How to use checksums
cebb1919463c16937958a0f4b73fbc9d2486a1655b590f02cc8119bf810be752
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / snaptrade_mcp-0.1.0-py3-none-any.whl

Download URL snaptrade_mcp-0.1.0-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
261b629ba8de766ed49c45bcf18ef9a9b384206486e9562cea0a040c7595a828
BLAKE2b-256 checksum
How to use checksums
2222689058a337998fcba3d88e9653e46197d406c72b37c988a2a887ded49392
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for snaptrade-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page