Skip to main content

TradingMCP: Market Data & Technical Analysis for AI Assistants

15-second product film: an AI is asked 'What did the market do today?', a market board assembles, Ethereum is marked as the day's top mover and its daily chart with Bollinger Bands is drawn in the chat — TradingMCP, the hosted version of this server
15 seconds, real output (market data as of 13 Oct 2026) · this server, hosted as TradingMCP · watch in full quality

atilaahmettaner%2Ftradingmcp | Trendshift

TradingMCP is an open-source MCP server: market data, backtesting, options, smart-money analysis and news sentiment for Claude, ChatGPT, Cursor, Copilot, and any MCP client. Stocks, ETFs, indices, crypto, FX and metals.

Don't want to install anything? TradingMCP, the hosted version of this server, gives you these tools in your AI app, plus charts and a markets panel drawn in the chat. In Claude, Cursor or Grok, add https://mcp.tradingmcp.ai/mcp as a connector and sign in: no key to paste. ChatGPT, Copilot and other MCP clients connect with a private link. From $9/mo with a 14-day money-back guarantee; self-hosting stays free.

Add TradingMCP to Claude   Add TradingMCP to Cursor
Starts at $9/month, 14-day money-back guarantee.
One click opens Claude's connector dialog with TradingMCP filled in; sign in with the email you subscribe with. Other apps: tradingmcp.ai/connect

Sponsor: Whop: sell your courses, software and communities online.

Morning market brief in one prompt: ask "give me this morning's market brief" and get global indices, the Bitcoin pulse and the hosted Markets panel in one answer. Charts are drawn right in the chat. In Grok Bot, add the Market Brief bot to get one on weekday mornings.

The hosted version (TradingMCP) draws charts. Ask for a chart and an interactive candlestick view (1d / 1h / 15m, optional Bollinger overlay) renders live inside the conversation via MCP Apps — and the AI reads the band values back to you.

Add one URL and sign in (or pip install), then just ask.

Try these first — they work in Claude, ChatGPT, Cursor, or any MCP client:

What did the market do today?
What is NVDA doing in after-hours trading?
Any unusual options activity on TSLA?
Backtest an RSI strategy on BTC on the daily timeframe

Tests License: MIT Python 3.10-3.13 GitHub Sponsors

⭐ If this tool improves your workflow, please star the repo and consider sponsoring — it keeps the project alive and growing!


✨ Why TradingMCP?

Feature TradingMCP Traditional Setups Bloomberg Terminal
Setup Time 5 minutes Hours (Docker, Conda...) Weeks (Contracts)
Cost Free & Open Source Variable $30k+/year
Backtesting ✅ 9 strategies + Walk-forward + Sharpe ❌ Manual scripting ✅ Proprietary
News & Sentiment ✅ Licensed news + per-ticker sentiment (Marketaux) ❌ Separate setup ✅ Terminal
Market Data ✅ Live / Real-Time Historical / Delayed Live
API Keys None for market data (free Marketaux key for news) Multiple (OpenAI, etc.) N/A

🚀 Quick Start (5 Minutes)

Two ways to run it:

🧑‍💻 Self-host (this repo) ☁️ Hosted — TradingMCP
Price Free forever (MIT) $9/mo Pro · $29.99/mo Pro+ · 14-day money-back guarantee
Time to first call ~5 minutes (Python + uv) ~60 seconds (add one URL, sign in)
Updates & ops You run and update it Managed — always on the latest
Runs on Your machine or VPS Hosted, streamed from the edge
Limits Your hardware 2,500/mo · 60/min (Pro) → 10,000/mo · 150/min (Pro+)
Best for Tinkerers, forkers, full control Folks who'd rather skip the ops

☁️ Zero setup: add https://mcp.tradingmcp.ai/mcp as a connector in Claude, Cursor or Grok and sign in; ChatGPT, Copilot and other clients use your private link → get started with TradingMCP from $9/mo (14-day money-back guarantee) · setup guide. Everything below is for self-hosting.

Install

pip install "git+https://github.com/atilaahmettaner/tradingmcp"

These commands install the current code from this GitHub repository.

Optional: news & sentiment (free Marketaux key)

financial_news and market_sentiment are powered by Marketaux — licensed market news with per-entity sentiment. Grab a free API key (100 requests/day; the server caches for 4h and shares one fetch between news and sentiment, so the free tier goes a long way) and set:

export MARKETAUX_API_TOKEN=your_token_here   # optional

Without a token those two tools return a friendly "not configured" note — all other tools work normally.

Claude Desktop Config (claude_desktop_config.json)

Note: On macOS, GUI apps like Claude Desktop may not have ~/.local/bin in their PATH. Use the full path to uvx to avoid "command not found" errors.

{
  "mcpServers": {
    "tradingmcp": {
      "command": "/Users/YOUR_USERNAME/.local/bin/uvx",
      "args": ["--from", "git+https://github.com/atilaahmettaner/tradingmcp", "tradingmcp"]
    }
  }
}

On Linux, replace /Users/YOUR_USERNAME with /home/YOUR_USERNAME. On Windows, use %USERPROFILE%\.local\bin\uvx.exe.

Codex

This repository ships Codex plugin metadata (.codex-plugin/plugin.json, .codex-mcp.json) that runs the server from this repository. Setup: INSTALLATION.md → Codex Plugin.

Or run from source

git clone https://github.com/atilaahmettaner/tradingmcp
cd tradingmcp
uv run tradingmcp

🛠️ Troubleshooting

An executable named … is not provided by package tradingmcp

The command was renamed in 1.0.0. In your client config, change the command name (the argument after the repository URL) to tradingmcp; the config above is complete. The changelog lists what each other way of running the server has to change.

🪟 Windows: MCP error -32001: Request timed out on first launch

Python 3.14 is not supported yet: add "--python", "3.13" to the uvx args.

Symptom, cause and two fixes

Symptom — you see this in the Claude Desktop logs shortly after adding the config:

[tradingmcp] Server started and connected successfully
[tradingmcp] Message from client: initialize ...
[60 seconds later]
[tradingmcp] notifications/cancelled — reason: "MCP error -32001: Request timed out"

Why it happens: Python 3.14 is not supported yet. uvx downloads the server, creates a fresh virtualenv, and installs dependencies the first time it runs. Some native dependencies in the MCP stack do not currently publish compatible Python 3.14 wheels, so installation can fall back to source builds or fail before Claude Desktop finishes initializing the server.

Fix — pin to Python 3.13:

{
  "mcpServers": {
    "tradingmcp": {
      "command": "uvx",
      "args": ["--python", "3.13", "--from", "git+https://github.com/atilaahmettaner/tradingmcp", "tradingmcp"]
    }
  }
}

On macOS use the full path to uvx (see the note in Quick Start). On Windows uvx is typically %USERPROFILE%\.local\bin\uvx.exe.

Alternative — pre-install once, then let Claude Desktop reuse the cache:

# Run in a terminal before launching Claude Desktop
uv tool install --python 3.13 "git+https://github.com/atilaahmettaner/tradingmcp"

After the install finishes, start Claude Desktop with the normal config and the server will come up instantly (cache is already warm).

Credit: @wyh4444 for the original report in #24.


⚠️ Error Envelope Format

Tools that have adopted the structured error format return either their normal payload or an error envelope, so a caller can tell "no matches today" from an upstream outage.

Envelope shape, which tools use it, and how to detect it
{"error": {"code": "UPSTREAM_ERROR", "message": "Failed to fetch history for 'AAPL': ...", "yahoo_symbol": "AAPL", "retryable": true}}

Why: the previous [] / {"error": "Analysis failed: ..."} strings made it impossible to distinguish "no matches today" from "upstream rate-limit cliff." The new envelope is programmatically branchable by code, and retryable tells the caller whether waiting and retrying can help (upstream storms pass; a missing dependency won't fix itself).

Coverage: smart_money_analysis and egx_smart_money_scanner build their errors with the envelope helpers; the two options tools use them only for unexpected errors. Not migrated yet: market_sentiment, financial_news, the three backtest tools, yahoo_price, market_snapshot, bitcoin_market_pulse and stock_extended_hours; tracked in #76.

Detecting an error:

result = smart_money_analysis(symbol="AAPL", exchange="NASDAQ")
if isinstance(result.get("error"), dict):
    code = result["error"]["code"]
    if result["error"].get("retryable"):
        # Wait and retry, raise an alert, etc.
        ...
else:
    ...

Stable codes are defined in core/errors.py.


📱 Use via Telegram, WhatsApp & More (OpenClaw)

Connect this server to Telegram, WhatsApp, Discord and 20+ messaging platforms using OpenClaw — a self-hosted AI gateway. Tested & verified on Hetzner VPS (Ubuntu 24.04).

👉 Full OpenClaw Setup Guide →

Quick setup, model choice and common mistakes

How It Works

OpenClaw routes Telegram messages to an AI agent. The agent uses trading.py — a thin Python wrapper — to call TradingMCP functions and return formatted results. No MCP protocol needed between OpenClaw and the server; it's a direct Python import.

Telegram → OpenClaw agent (AI model) → trading.py (bash) → TradingMCP → Yahoo Finance

Quick Setup

# 1. Install UV and the server
curl -LsSf https://astral.sh/uv/install.sh | sh && source ~/.bashrc
uv tool install "git+https://github.com/atilaahmettaner/tradingmcp"

# 2. Configure OpenClaw channels
cat > ~/.openclaw/openclaw.json << 'EOF'
{
  channels: {
    telegram: {
      botToken: "YOUR_BOT_TOKEN_HERE",
    },
  },
}
EOF

# 3. Configure gateway + agent
openclaw config set gateway.mode local
openclaw config set acp.defaultAgent main

# 4. Set your AI model (choose ONE option below)
openclaw configure --section model

# 5. Install the skill + tool wrapper
mkdir -p ~/.agents/skills/tradingmcp ~/.openclaw/tools
curl -fsSL https://raw.githubusercontent.com/atilaahmettaner/tradingmcp/main/openclaw/SKILL.md \
  -o ~/.agents/skills/tradingmcp/SKILL.md
curl -fsSL https://raw.githubusercontent.com/atilaahmettaner/tradingmcp/main/openclaw/trading.py \
  -o ~/.openclaw/tools/trading.py && chmod +x ~/.openclaw/tools/trading.py

# 6. Start the gateway
openclaw gateway install
systemctl --user start openclaw-gateway.service

Choose Your AI Model

OpenRouter is not required — use whichever provider you have a key for:

Provider Model ID for OpenClaw Get Key
OpenRouter (aggregator — access to all models) openrouter/google/gemini-3-flash-preview openrouter.ai/keys
Anthropic (Claude direct) anthropic/claude-sonnet-4-5 console.anthropic.com
Google (Gemini direct) google/gemini-2.5-flash aistudio.google.com
OpenAI (GPT direct) openai/gpt-4o-mini platform.openai.com
# Examples — set your chosen model:
openclaw config set agents.defaults.model "openrouter/google/gemini-3-flash-preview"  # via OpenRouter
openclaw config set agents.defaults.model "anthropic/claude-sonnet-4-5"               # Anthropic direct
openclaw config set agents.defaults.model "google/gemini-2.5-flash"                   # Google direct

⚠️ Important: Prefix must match your provider. google/... needs a Google API key. openrouter/... needs an OpenRouter key.

⚠️ Common Mistakes

Symptom Cause Fix
Unrecognized keys: mcpServers mcpServers not supported in this version Remove from config, use bash wrapper
No API key for provider "google" Used google/model but only have OpenRouter key Use openrouter/google/model instead
which agent? loop acp.defaultAgent not set openclaw config set acp.defaultAgent main
Gateway won't start gateway.mode missing openclaw config set gateway.mode local

Test Your Bot

Once running, send your Telegram bot:

market snapshot
backtest RSI strategy for AAPL, 1 year
compare all strategies for BTC-USD

🔧 All 13 MCP Tools

The technical-analysis, scanner, futures and EGX market tools of earlier versions are not in this version. They are being rebuilt on a different data source.

📊 Backtesting Engine

Tool Description
backtest_strategy Backtest 1 of 9 strategies with institutional metrics (Sharpe, Calmar, Expectancy). Supports 1d and 1h timeframes; optional full trade log + equity curve.
compare_strategies Run all 9 strategies on the same symbol and rank by performance.
walk_forward_backtest_strategy Train/test split walk-forward validation with overfitting verdict (ROBUST / MODERATE / WEAK / OVERFITTED).

9 Strategies to Test:

  • rsi — RSI oversold/overbought mean reversion
  • bollinger — Bollinger Band mean reversion
  • macd — MACD golden/death cross
  • ema_cross — EMA 20/50 Golden/Death Cross
  • supertrend — ATR-based Supertrend trend following
  • donchian — Donchian Channel breakout (Turtle Trader style)
  • rsi_pullback — Dip-buy in confirmed uptrend (SMA50>SMA200 + RSI<40 entry)
  • keltner_breakout — ATR-normalized breakout (EMA20 + 2·ATR upper band)
  • triple_ema — EMA 20/50 cross gated by SMA200 trend filter

rsi_pullback, keltner_breakout and triple_ema need period='1y' or '2y' so the SMA200 trend filter can complete its warmup.

Metrics you get: Win Rate, Total Return, Sharpe Ratio, Calmar Ratio, Max Drawdown, Profit Factor, Expectancy, Best/Worst Trade, vs Buy-and-Hold, with realistic commission + slippage simulation.

Example prompt: "Compare all 9 strategies on MSFT for 2 years"
→ #1 triple_ema:        +15.1% | Sharpe:  0.0 | WR: 100%
→ #2 keltner_breakout:  +14.3% | Sharpe:  4.7 | WR:  40%
→ #3 bollinger:         +12.2% | Sharpe:  4.1 | WR:  64%
→ Buy & Hold:            -2.1%

💰 Prices & Market Overview

Tool Description
yahoo_price Quote from Yahoo Finance: price, change %, 52w high/low, market state
market_snapshot Global overview: S&P500, NASDAQ, VIX, BTC, ETH, EUR/USD, SPY, GLD
bitcoin_market_pulse BTC price, dominance, total crypto market cap and a risk read (CoinGecko).
stock_extended_hours US pre-market and after-hours prices.

yahoo_price supports: Stocks (AAPL, TSLA, NVDA), Crypto (BTC-USD, ETH-USD, SOL-USD), ETFs (SPY, QQQ, GLD), Indices (^GSPC, ^DJI, ^IXIC, ^VIX), FX (EURUSD=X), Turkish (THYAO.IS, SASA.IS)

🕵️ Smart Money

Tool Description
smart_money_analysis Banker / hot-money accumulation read from price and volume history.
egx_smart_money_scanner Ranks EGX index constituents by smart-money accumulation.

🧠 News & Sentiment (Marketaux)

Tool Description
financial_news Latest financial headlines from Marketaux (licensed), optionally for one symbol.
market_sentiment News sentiment for a stock or coin: bullish/bearish score and the articles behind it.

Self-hosting? These two need a free MARKETAUX_API_TOKEN (see Quick Start).

🧾 US Options

Tool Description
stock_options_chain Full options chain (calls + puts) for a US stock and one expiry.
stock_options_unusual_activity Strikes with unusual volume vs open interest, plus call vs put volume.

💬 Example AI Conversations

You: "Give me a full market snapshot right now"
AI: [market_snapshot] → S&P500 -3.4%, BTC +0.1%, VIX 31 (+13%), EUR/USD 1.15

You: "What's the news sentiment on NVDA?"
AI: [market_sentiment] → Strongly Bullish (0.41) | 3 articles | 2 bullish

You: "Backtest RSI strategy on BTC-USD for 2 years"
AI: [backtest_strategy] → +31.5% return | 100% win rate | 2 trades | B&H: -5%

You: "Which of the 9 strategies worked best on MSFT in the last 2 years?"
AI: [compare_strategies] → triple_ema #1 (+15.1%, WR 100%), keltner_breakout #2 (+14.3%), macd last (-23.4%)

You: "Run walk-forward backtest on supertrend for SPY"
AI: [walk_forward_backtest_strategy] → Verdict: ROBUST (avg robustness 0.92) | OOS return +8.5%

💖 Support the Project

This framework is free and open source, built in spare time. If it saves you hours of research or helps you make better decisions, please consider sponsoring:

Tier Monthly What You Get
☕ Coffee $5 Heartfelt gratitude + name in README
🚀 Supporter $15 Above + priority bug fixes
💎 Pro $30 Above + priority feature requests
Sponsor

📄 License

MIT License — see LICENSE for details.


Disclaimer: This tool is for educational and research purposes only. It does not constitute financial advice. Always do your own research before making investment decisions.

Metadata

Release files for tradingmcp 1.0.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 tradingmcp 1.0.0
File Size Uploaded Provenance Actions
tradingmcp-1.0.0.tar.gz 70.8 kB Without provenance Details for tradingmcp-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tradingmcp 1.0.0
File Interpreter ABI Platform Actions
tradingmcp-1.0.0-py3-none-any.whl Python 3 none any Details for tradingmcp-1.0.0-py3-none-any.whl

Total release size: 138.0 kB

Release files / tradingmcp-1.0.0.tar.gz

Download URL tradingmcp-1.0.0.tar.gz
Size 70.8 kB
Tags Source
SHA-256 checksum
How to use checksums
71de3286a0b5ee3655f1314f4df67df9f3951a8489cab9e5cf473a281818740a
BLAKE2b-256 checksum
How to use checksums
01c18f4c0aab210319ed13bcff5a3b65a65d9b2f07661ad42c57c1c99c8b164a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tradingmcp-1.0.0-py3-none-any.whl

Download URL tradingmcp-1.0.0-py3-none-any.whl
Size 67.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95437ba8da2e0897092f708764b0bcb77a5a70053ec8d7a0d9e80379434310b5
BLAKE2b-256 checksum
How to use checksums
a9399ddbe56663d7fb77c536c85ad7a86fc5eed7957f91cd06d96941a5772d1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Security for tradingmcp 1.0.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

1.0.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