Trading

v1.0.0Finance & Fintechstable

Provides foundational trading utilities by fetching market data through Akshare and computing technical indicators like RSI and MACD using TA-Lib. It enables users to retrieve candlestick data and technical analysis series via a standardized MCP inte

cursorfinancemcpmodel-context-protocolstock-analysis
Share:
71
Stars
0
Downloads
0
Weekly
0/5

What is Trading?

Trading is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to provides foundational trading utilities by fetching market data through akshare and computing technical indicators like rsi and macd using ta-lib. it enables users to retrieve candlestick data and tec...

Provides foundational trading utilities by fetching market data through Akshare and computing technical indicators like RSI and MACD using TA-Lib. It enables users to retrieve candlestick data and technical analysis series via a standardized MCP inte

This server falls under the Finance & Fintech category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Provides foundational trading utilities by fetching market d

Use Cases

Fetch real-time market data and candlestick charts.
Calculate technical indicators like RSI and MACD.
Analyze stocks and perform trading analysis via MCP.
tohsaka888

Maintainer

LicenseMIT
Languagetypescript
Versionv1.0.0
UpdatedApr 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx trading

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Trading

The trading-mcp server provides a comprehensive suite of market data and technical analysis tools for both A-share (Chinese) and US stock markets, built on Akshare for data retrieval and TA-Lib for indicator computation. It exposes over 20 MCP tools covering candlestick (K-line) data, RSI, MACD, moving averages, volume analysis, fund flow rankings, sector summaries, and fundamental financials for both Chinese and US equities. Developers and analysts can integrate it with Claude or Cursor to query live market data and generate technical analysis in Markdown or JSON format through natural language.

Prerequisites

  • Python 3.10+ and uv package manager installed
  • TA-Lib system library installed (brew install ta-lib on macOS, apt-get install libta-lib0 libta-lib0-dev on Debian/Ubuntu)
  • Git to clone the repository: https://github.com/tohsaka888/trading-mcp
  • An MCP-compatible client such as Claude Desktop or Cursor
1

Clone the repository

Clone the trading-mcp repository to your local machine.

git clone https://github.com/tohsaka888/trading-mcp.git
cd trading-mcp
2

Install TA-Lib system dependency

TA-Lib requires a native C library in addition to the Python wrapper. Install it for your operating system before running uv sync.

# macOS
brew install ta-lib

# Debian/Ubuntu
sudo apt-get install libta-lib0 libta-lib0-dev
3

Install Python dependencies

Use uv to install all Python dependencies including the dev extras.

uv sync --extra dev
4

Start the MCP server

Launch the server with Python. It starts in streamable HTTP mode by default on 0.0.0.0:8000.

python main.py
5

Configure Claude Desktop

Add the server to your claude_desktop_config.json. The server runs as a subprocess started by the MCP client using uv run.

{
  "mcpServers": {
    "trading": {
      "command": "uv",
      "args": ["run", "python", "main.py"],
      "cwd": "/absolute/path/to/trading-mcp",
      "env": {
        "TRADING_MCP_ENVIRONMENT": "prod"
      }
    }
  }
}

Trading Examples

Client configuration (Claude Desktop)

Configure Claude Desktop to launch the trading-mcp server. Set the cwd to the absolute path where you cloned the repo.

{
  "mcpServers": {
    "trading": {
      "command": "uv",
      "args": ["run", "python", "main.py"],
      "cwd": "/Users/yourname/trading-mcp",
      "env": {
        "TRADING_MCP_ENVIRONMENT": "prod",
        "TRADING_MCP_DEFAULT_SYMBOL": "000001"
      }
    }
  }
}

Prompts to try

Query candlestick data, technical indicators, and fundamentals for A-share or US stocks using natural language.

- "Show me the last 30 daily candles for stock 000001 (Ping An Bank)"
- "Calculate the 14-period RSI for AAPL.US over the past month"
- "Get the MACD signal for 600519 (Moutai) on daily bars"
- "Show me the top sector fund flows for today ranked by net inflow"
- "Fetch the latest annual balance sheet for Apple (AAPL.US)"

Troubleshooting Trading

TA-Lib ImportError or missing shared library at startup

The Python wrapper requires the native TA-Lib C library. Install it first (brew install ta-lib on macOS), then reinstall the Python package with uv sync. On Windows, download a pre-compiled wheel matching your Python version.

Akshare data fetch fails or returns empty results for Chinese stocks

Some Akshare endpoints are rate-limited or require requests through a mainland China IP. If you are outside mainland China, set TRADING_MCP_AKSHARE_PROXY_ENABLED=true and configure TRADING_MCP_AKSHARE_PROXY_AUTH_IP with an authorized proxy gateway.

US stock symbol not recognized

US stocks must be suffixed with .US (e.g., AAPL.US, TSLA.US). The server supports symbol auto-normalization for A-share codes (000001, 000001.SZ, 600519.SH are all accepted).

Frequently Asked Questions about Trading

What is Trading?

Trading is a Model Context Protocol (MCP) server that provides foundational trading utilities by fetching market data through akshare and computing technical indicators like rsi and macd using ta-lib. it enables users to retrieve candlestick data and technical analysis series via a standardized mcp inte It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Trading?

Follow the installation instructions on the Trading GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Trading?

Trading works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Trading free to use?

Yes, Trading is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Finance & Fintech MCP Servers

Explore all finance & fintech servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "trading": { "command": "npx", "args": ["-y", "trading"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Trading?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides