# Stock MCP

> Stock MCP is an open-source MCP server for finance and payments. Free real-time China A-share stock quotes and index levels by code or Chinese name. It runs as a hosted remote server, so there is nothing to install locally.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** Web, API, Self-hosted
- **Repository:** https://github.com/boy-373/stock-mcp
- **MCP Registry name:** cn.pianam/stock-mcp
- **Categories:** [finance and payments](https://ai-powered.com/categories/finance-and-payments)
- **Listing updated:** 2026-11-23

## About

This small server answers questions about the mainland China stock market. You can give a stock as a code, with or without the exchange prefix, or by its Chinese name, and it resolves the name using Tencent's suggest API plus a bundled map of about 50 common stocks. Examples in the README include asking for Kweichow Moutai by name or looking up CATL by its code.

A quote includes price, previous close, open, high, low, change amount and percent, direction, volume in shares and lots, turnover, update time and the data source. A second tool returns the Shanghai Composite, Shenzhen Component and ChiNext indices with an overall market-trend summary.

Data comes from Tencent Finance, with Sina Finance as an automatic fallback, both free public endpoints that need no key. The README notes the data is delayed or indicative and is not investment advice. A hosted endpoint is free to use with no authentication, or you can self-host a FastMCP server with Python. It is MIT licensed.

## Features

- **Quote by code or name:** Accepts codes such as 600519 or sh600519, or a Chinese company name.
- **Detailed quote fields:** Returns price, range, change, volume, turnover and update time.
- **Index overview:** Shows the three major A-share indices and a market-trend summary.
- **Dual data sources:** Uses Tencent Finance with Sina Finance as automatic fallback.
- **Hosted or self-hosted:** Offers a free public endpoint or a server you run yourself.
- **No key needed:** Requires no API key or registration.

## Good for

- Ask for the current price of a Chinese listed stock
- Check how the Shanghai and Shenzhen indices are doing today
- Look up a stock by its Chinese name
- Add basic A-share quotes to a chat assistant
- Self-host a simple quote service for an internal agent

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add --transport http stock-mcp https://pianam.cn/stock-mcp/mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "stock-mcp": {
      "type": "http",
      "url": "https://pianam.cn/stock-mcp/mcp"
    }
  }
}
```

### Claude Desktop (Customize → Connectors → Add → Add custom connector)

```text
https://pianam.cn/stock-mcp/mcp
```

Paste this URL, choose how to sign in, then click Add and Connect. On Team and Enterprise an Owner adds it in Organization settings → Connectors.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "stock-mcp": {
      "url": "https://pianam.cn/stock-mcp/mcp"
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "stock-mcp": {
      "type": "http",
      "url": "https://pianam.cn/stock-mcp/mcp"
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### ChatGPT (chatgpt.com → Plugins → + → Add custom MCP server)

```text
https://pianam.cn/stock-mcp/mcp
```

Paste this URL, set up sign-in, accept the warning and install the plugin. Then type @ in a chat to use it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add stock-mcp --url https://pianam.cn/stock-mcp/mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.stock-mcp]
url = "https://pianam.cn/stock-mcp/mcp"
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "stock-mcp": {
      "httpUrl": "https://pianam.cn/stock-mcp/mcp"
    }
  }
}
```

Or run: gemini mcp add -s user --transport http stock-mcp https://pianam.cn/stock-mcp/mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "stock-mcp": {
      "serverUrl": "https://pianam.cn/stock-mcp/mcp"
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "stock-mcp": {
      "url": "https://pianam.cn/stock-mcp/mcp",
      "transport": "http"
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "stock-mcp": {
      "type": "streamableHttp",
      "url": "https://pianam.cn/stock-mcp/mcp"
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "stock-mcp": {
      "url": "https://pianam.cn/stock-mcp/mcp"
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "stock-mcp": {
      "url": "https://pianam.cn/stock-mcp/mcp"
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "stock-mcp": {
      "url": "https://pianam.cn/stock-mcp/mcp"
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "stock-mcp": {
      "url": "https://pianam.cn/stock-mcp/mcp"
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Grok Bot (Grok Bot desktop app → Connect apps → Add a custom connector)

```sh
https://pianam.cn/stock-mcp/mcp
```

Enter a Name (for example "Stock MCP"), choose Type: Remote HTTPS, paste this as the Server URL and choose Add plugin.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "stock-mcp": {
      "type": "http",
      "url": "https://pianam.cn/stock-mcp/mcp"
    }
  }
}
```

## Tools

Going by the tool names, all 2 tools only read data. From the server's own tool labels and tool names; not verified by us.

- `query_stock_quote` (name suggests: reads): 查询个股实时行情，支持股票代码（如 sh600519、600519）或名称（如 贵州茅台）。返回现价、涨跌额、涨跌幅、今开、昨收、最高、最低、成交量等数据。
- `query_index` (name suggests: reads): 查询A股三大指数实时行情，包括上证指数、深证成指、创业板指的点位、涨跌幅和市场整体趋势。

## FAQ

### Do I need an API key?

No. Both the hosted endpoint and the data sources are free and keyless.

### Which tools does Stock MCP have?

query_stock_quote takes a stock code or Chinese name, and query_index takes no parameters.

### Is the data real time?

The README describes it as real-time quotes but notes it is delayed or indicative per the data providers.

### Is Stock MCP investment advice?

No. The README says the data is informational only.

### Can I run Stock MCP myself?

Yes. Clone the repository, install the requirements and run server.py with Python.

### Is Stock MCP free?

Yes. Stock MCP is open source, so you can use and self-host it for free.

### How do I add Stock MCP to Claude Code?

Run this command in your terminal: claude mcp add --transport http stock-mcp https://pianam.cn/stock-mcp/mcp

### What are the best alternatives to Stock MCP?

The closest alternatives to Stock MCP are Solana MCP by Vybe, Tapetide - Indian Stock Market MCP, NostrPulse, Australian Economic Data (ABS, RBA & APRA) and Crypto Perp Pulse & Outage Radar (x402).

## Where this comes from

- Description: written from the project's README.
- Status and tools: checked automatically by AIPoweredBot on 24 November 2026.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Solana MCP by Vybe](https://ai-powered.com/mcp/solana-mcp-by-vybe): Solana MCP by Vybe is an MCP server for finance and payments.
- [Tapetide - Indian Stock Market MCP](https://ai-powered.com/mcp/tapetide-indian-stock-market-mcp): Tapetide - Indian Stock Market MCP is a freemium MCP server for finance and payments.
- [NostrPulse](https://ai-powered.com/mcp/nostrpulse): NostrPulse is an open-source MCP server for finance and payments.
- [Australian Economic Data (ABS, RBA & APRA)](https://ai-powered.com/mcp/australian-economic-data-abs-rba-and-apra): Australian Economic Data (ABS, RBA & APRA) is an open-source MCP server for analytics and data.
- [Crypto Perp Pulse & Outage Radar (x402)](https://ai-powered.com/mcp/crypto-perp-pulse-and-outage-radar-x402): Crypto Perp Pulse & Outage Radar (x402) is a paid MCP server for finance and payments.
- [LATAM Business, Fiscal & FX (x402)](https://ai-powered.com/mcp/latam-business-fiscal-and-fx-x402): LATAM Business, Fiscal & FX (x402) is a paid MCP server for finance and payments.
- [Base & EVM DeFi Pre-Trade Shield (x402)](https://ai-powered.com/mcp/base-and-evm-defi-pre-trade-shield-x402): Base & EVM DeFi Pre-Trade Shield (x402) is a paid MCP server for finance and payments.
- [x402 Micropayments MCP](https://ai-powered.com/mcp/x402-micropayments-mcp): x402 Micropayments MCP is a paid MCP server for finance and payments.

---
Source: https://ai-powered.com/mcp/stock-mcp-2
