
stock-api MCP Server: Stock Quotes for Claude, Cursor and Other Apps
Lets your AI assistant look up quotes, price history and stock codes for A-share, Hong Kong and US stocks.
stock-api is a stock data tool whose MCP mode lets Claude, Cursor and other assistants fetch quotes and price candles for China A-share, Hong Kong and US stocks. It is a community project by zhangxiangliang, not made by an exchange or a data vendor. It runs on your computer with no account or API key and pulls prices from Tencent, Sina and Eastmoney. The MCP mode is one of four ways to use the package, which also works as a Node.js library and a command line tool.
Good for
- Investors who follow A-share, Hong Kong or US stocks and want quotes inside the chat
- Developers who already use the stock-api Node.js library
- Anyone who wants price history without opening a finance site
Works in
12 should work
Tap an app to see how to set it up and any known problems.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Client does not support this transport.
Client does not support this transport.
Install stock-api MCP
Claude Code
- 1
Copy this prompt.
Add the stock-api MCP server to Claude Code. Run this command: claude mcp add stock-api -- npx -y stock-api mcp Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
The mcp subcommand comes from the stock-api README. The README shows a generic config, so the app-specific forms here are adapted from it.
Built from the package data we hold. Not yet tested by us. Source.
Tools
Finds stock codes from a company name or keyword
Looks up a company name such as 格力电器 and returns matching stock codes. Use it first when you only know the name, then pass the code to the other tools.
Try: “Find the stock code for 格力电器.”
Network ·
search_stocksGets the current quote for one stock
Returns one quote in a common format for a code such as SH510500 or SZ000651. You can pin one data source or leave it on automatic.
Try: “What is the latest quote for SH600519?”
Network ·
get_stockGets quotes for several stocks at once
Takes a list of codes and returns a quote for each, in the same format as a single lookup. Handy for comparing a watchlist.
Try: “Compare today's quotes for SH510500 and SZ000651.”
Network ·
get_stocksGets daily, weekly or monthly candles for a stock
Returns price history rows for a code by day, week or month, up to 500 rows. You can ask for no price adjustment or forward or backward adjustment.
Try: “Get the last 120 daily K-lines for SH600519 with forward adjustment.”
Network ·
get_klinesShows which data source answered and how the fallback worked
Checks a code against the data sources and reports which ones have a quote and how the automatic fallback behaves. Use it when a quote looks wrong or missing.
Try: “Check why SH510500 returns no quote and which sources were tried.”
Network ·
inspect_stock
Read from the source code
Permissions
low risk · 2 things to watch
Low risk
The tools only read market data, but each lookup sends the stock code or keyword you ask about to Tencent, Sina or Eastmoney.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only modeHow to turn it on
Watch out for
Stock codes you ask about go to third-party sites
Each lookup sends the code or search keyword to Tencent, Sina or Eastmoney. Do not put anything private in a search. github.com
Quotes come from free public sources
The package falls back from Tencent to Sina to Eastmoney, so the source can change between calls. Check important numbers against your broker. github.com
Security advisories
No published security advisories as of Nov 1, 2026.
Technical details
| Turning on read-only | All five tools only fetch market data. None of them writes, sends or deletes anything. |
|---|---|
| Talks to | Tencent, Sina and Eastmoney quote services (stock codes you ask about) |
| Sign-in and keys | No account or API key. |
Questions
Is stock-api official?
No. It is a community project by zhangxiangliang, not made by an exchange, broker or the data providers it reads from.
Does stock-api need an API key?
No. It needs no account or key. It reads from Tencent, Sina and Eastmoney quote services.
Which stocks does it cover?
A-share, Hong Kong and US stocks. Codes use SH, SZ, HK or US prefixes, for example SH510500 or SZ000651.
Can it place trades?
No. It has five tools and all of them only look up quotes, price history or stock codes.
Does it run on my computer or in the cloud?
On your computer. The install box starts a small local program, which then queries the quote services over the internet.
Which clients does it work with?
Any app that can start a local MCP server over stdio. The README shows a generic config and names no specific client.
Why do I need the extra mcp word in the command?
Without it the package runs as a normal command line tool. The mcp subcommand switches it to server mode, so the install box includes it for every app.
Information
updated Nov 2, 2026
- Publisher
- Community
- Package
stock-api- Registry
- npm
- Transport
- stdio
- Auth
- None
- License
- MIT
- Last commit
- Oct 31, 2026
- Open issues
- 0
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 2Hide
- github.com · github.com
- github.com · github.com