mcp-stock-analyst
This server provides stock market data (A-shares, Hong Kong, US, and Taiwan) via MCP tools for real-time quotes, symbol search, and historical candlesticks.
get_quote: Fetch real-time quotes for up to 10 stock codes per call, covering A-share, HK, US, and Taiwan markets.
search_stock: Fuzzy search by Chinese name, pinyin abbreviation, or partial ticker code (e.g., 茅台, GZMT, NVIDIA, 600).
get_kline: Retrieve historical candlestick (K-line) data with day/week/month periods and 20–640 bars.
Market coverage: Tencent feeds for A-share/HK/US; Yahoo Finance for Taiwan (TWSE, TPEx, TAIEX).
Transport options: Works over stdio for local clients and Streamable HTTP for remote/hosted use.
Cost model: Pay-per-call on Apify ($0.02 per quote/kline call, $0.005 per search) with free handshake and tools/list.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-stock-analystWhat's the current quote for 茅台 and NVIDIA?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Stock Analyst 📈
MCP Stock Analyst (English)
A Model Context Protocol (MCP) server delivering stock market data for China A-shares, Hong Kong, US and Taiwan markets — live quotes, smart symbol search and historical K-lines.
Zero-cost data: powered by free public market-data APIs (Tencent for A-share/HK/US, Yahoo Finance for Taiwan), no API key, no quota
3 practical tools: real-time quotes (batch up to 10), fuzzy search (Chinese name / pinyin / ticker code), historical candlesticks
Dual transport:
stdio(local desktop clients) +Streamable HTTP(remote hosting on Apify Standby)Live on Apify Store: https://apify.com/neeenja/mcp-stock-analyst — pay-per-call, no subscription
Tools
Tool | What it does | Example input |
| Real-time quote (A-share / HK / US / Taiwan, up to 10 symbols per call) |
|
| Fuzzy search by name, pinyin or partial code |
|
| Historical candlesticks (day/week/month, 20–640 bars) |
|
Taiwan stock codes
Taiwan (TWSE listed / TPEx OTC) stocks are served via Yahoo Finance. Accepted formats:
2330.TW— TWSE listed (explicit)5483.TWO— TPEx OTC (explicit)tw2330— shorthand; the server auto-detects the exchange (tries.TWfirst, then.TWO)^TWII— Taiwan Capitalization Weighted Index (TAIEX)
Related MCP server: A-Stock MCP Server
Connect (recommended: hosted endpoint)
Use the hosted MCP endpoint with any MCP client via mcp-remote:
{
"mcpServers": {
"stock-analyst": {
"command": "npx",
"args": [
"-y", "mcp-remote",
"https://neeenja--mcp-stock-analyst.apify.actor/mcp",
"--header", "Authorization: Bearer ${APIFY_TOKEN}"
],
"env": { "APIFY_TOKEN": "<your-apify-api-token>" }
}
}
}Get your token from Apify Console → Settings → API & Integrations.
Or run locally (stdio)
git clone https://github.com/PanStories/mcp-stock-analyst
cd mcp-stock-analyst
npm install && npm run build{
"mcpServers": {
"stock-analyst": {
"command": "node",
"args": ["C:\\path\\to\\mcp-stock-analyst\\build\\index.js"]
}
}
}Debug locally
npx @modelcontextprotocol/inspector node build/index.js # interactive inspector
node e2e-test.mjs # stdio protocol end-to-end test
node http-e2e-test.mjs # local HTTP end-to-end testPricing (pay-per-event)
No subscription, no monthly fee — you pay per tool call:
Event | Charged when | Price |
| each | $0.02 |
| each | $0.005 |
Always free: the MCP handshake (initialize) and tools/list. Discovery costs nothing.
Every Apify account includes $5 of free platform credit monthly (~250 quote calls), so light users effectively pay nothing.
HTTP endpoints (remote mode)
Method | Path | Purpose |
POST |
| MCP protocol endpoint (stateless Streamable HTTP) |
GET |
| health check |
GET |
| service info; answers the Apify container readiness probe |
Deploying your own instance
npm install -g apify-cli
apify login
cd mcp-stock-analyst
apify push # builds the Docker image on Apify's infrastructureThe Actor definition (.actor/actor.json) already enables Standby mode with MCP path /mcp. Your endpoint will be https://<username>--mcp-stock-analyst.apify.actor/mcp (verify in Console → Endpoints, or read data.standbyUrl from GET https://api.apify.com/v2/acts/<actorId>?token=<token>).
Tech stack
Node.js ≥ 18, TypeScript, official
@modelcontextprotocol/sdkData source: Tencent public market APIs (A-share/HK/US, free, no key) + Yahoo Finance chart API (Taiwan, free, no key)
Multi-stage Docker build (
node:20-alpine)
Roadmap
Pay-per-event billing
Taiwan market support (TWSE / TPEx / TAIEX via Yahoo Finance)
Money flow / dragon-tiger list data
Financial report summaries
API-key auth layer (self-hosting)
License
MIT
MCP Stock Analyst(简体中文)
一个提供 A股 / 港股 / 美股 / 台湾股 行情数据的 MCP (Model Context Protocol) 服务器——实时报价、智能搜索、历史K线。
零成本数据源:A股/港股/美股用腾讯免费公开行情接口,台湾股用 Yahoo Finance,均无需 API key,无配额限制
三个实用工具:实时报价(单次最多 10 个标的)、智能搜索(中文名/拼音/代码)、历史K线
双传输模式:
stdio(本地桌面客户端)+Streamable HTTP(Apify Standby 远程托管)已上架 Apify Store:https://apify.com/neeenja/mcp-stock-analyst —— 按次付费,无订阅
工具列表
工具 | 功能 | 示例输入 |
| 实时报价(A股/港股/美股/台湾股,单次最多10个) |
|
| 智能搜索代码/名称/拼音 |
|
| 历史K线(日/周/月,20–640 根) |
|
台湾股票代码格式
台湾股(TWSE 上市 / TPEx 上柜)走 Yahoo Finance 数据源,支持以下输入格式:
2330.TW—— 上市股票(显式指定)5483.TWO—— 上柜股票(显式指定)tw2330—— 简写;服务端自动探测交易所(先试.TW,再试.TWO)^TWII—— 台湾加权指数(TAIEX)
接入方式(推荐:云端端点)
任意 MCP 客户端通过 mcp-remote 连接云端端点:
{
"mcpServers": {
"stock-analyst": {
"command": "npx",
"args": [
"-y", "mcp-remote",
"https://neeenja--mcp-stock-analyst.apify.actor/mcp",
"--header", "Authorization: Bearer ${APIFY_TOKEN}"
],
"env": { "APIFY_TOKEN": "<你的-Apify-token>" }
}
}
}token 在 Apify Console → Settings → API & Integrations 获取。
或本地运行(stdio 模式)
git clone https://github.com/PanStories/mcp-stock-analyst
cd mcp-stock-analyst
npm install && npm run build{
"mcpServers": {
"stock-analyst": {
"command": "node",
"args": ["C:\\path\\to\\mcp-stock-analyst\\build\\index.js"]
}
}
}本地调试
npx @modelcontextprotocol/inspector node build/index.js # 交互式调试界面
node e2e-test.mjs # stdio 协议端到端测试
node http-e2e-test.mjs # 本地 HTTP 端到端测试计费(按事件付费)
无订阅、无月费,按工具调用次数收费:
事件 | 触发时机 | 单价 |
| 每次行情数据调用: | $0.02 |
| 每次标的检索: | $0.005 |
永远免费: MCP 握手(initialize)和 tools/list——发现类请求不计费。
每个 Apify 账号每月自带 $5 平台免费额度(按 $0.02/次约 250 次报价调用),轻度用户实际等于免费用。
HTTP 端点(远程模式)
方法 | 路径 | 说明 |
POST |
| MCP 协议端点(无状态 Streamable HTTP) |
GET |
| 健康检查 |
GET |
| 服务信息;响应 Apify 容器就绪探针 |
部署你自己的实例
npm install -g apify-cli
apify login
cd mcp-stock-analyst
apify push # 在 Apify 平台侧构建 Docker 镜像Actor 定义(.actor/actor.json)已启用 Standby 模式,MCP 路径 /mcp。端点形如 https://<username>--mcp-stock-analyst.apify.actor/mcp(以 Console → Endpoints 页为准,或通过 GET https://api.apify.com/v2/acts/<actorId>?token=<token> 返回的 data.standbyUrl 字段获取准确地址)。
技术栈
Node.js ≥ 18、TypeScript、官方
@modelcontextprotocol/sdk数据源:腾讯公开行情接口(A股/港股/美股,免费无 key)+ Yahoo Finance chart 接口(台湾,免费无 key)
多阶段 Docker 构建(
node:20-alpine)
路线图
按事件计费
台湾市场支持(TWSE / TPEx / 加权指数,Yahoo Finance 数据源)
资金流向 / 龙虎榜
财报摘要
自定义 API key 鉴权层(自托管时用)
许可证
MIT
MCP Stock Analyst(繁體中文)
一個提供 A股 / 港股 / 美股 / 台股 行情資料的 MCP (Model Context Protocol) 伺服器——即時報價、智慧搜尋、歷史K線。
零成本資料源:A股/港股/美股使用騰訊免費公開行情介面,台股使用 Yahoo Finance,皆無需 API key,無配額限制
三個實用工具:即時報價(單次最多 10 個標的)、智慧搜尋(中文名稱/拼音/代碼)、歷史K線
雙傳輸模式:
stdio(本機桌面用戶端)+Streamable HTTP(Apify Standby 遠端託管)已上架 Apify Store:https://apify.com/neeenja/mcp-stock-analyst —— 按次計費,無訂閱
工具列表
工具 | 功能 | 範例輸入 |
| 即時報價(A股/港股/美股/台股,單次最多10個) |
|
| 智慧搜尋代碼/名稱/拼音 |
|
| 歷史K線(日/週/月,20–640 根) |
|
台灣股票代碼格式
台股(TWSE 上市 / TPEx 上櫃)使用 Yahoo Finance 資料源,支援以下輸入格式:
2330.TW—— 上市股票(顯式指定)5483.TWO—— 上櫃股票(顯式指定)tw2330—— 簡寫;伺服器自動探測交易所(先試.TW,再試.TWO)^TWII—— 台灣加權指數(TAIEX)
連接方式(推薦:雲端端點)
任意 MCP 用戶端透過 mcp-remote 連接雲端端點:
{
"mcpServers": {
"stock-analyst": {
"command": "npx",
"args": [
"-y", "mcp-remote",
"https://neeenja--mcp-stock-analyst.apify.actor/mcp",
"--header", "Authorization: Bearer ${APIFY_TOKEN}"
],
"env": { "APIFY_TOKEN": "<你的-Apify-token>" }
}
}
}token 在 Apify Console → Settings → API & Integrations 取得。
或本機執行(stdio 模式)
git clone https://github.com/PanStories/mcp-stock-analyst
cd mcp-stock-analyst
npm install && npm run build{
"mcpServers": {
"stock-analyst": {
"command": "node",
"args": ["C:\\path\\to\\mcp-stock-analyst\\build\\index.js"]
}
}
}本機除錯
npx @modelcontextprotocol/inspector node build/index.js # 互動式除錯介面
node e2e-test.mjs # stdio 協定端對端測試
node http-e2e-test.mjs # 本機 HTTP 端對端測試計費(按事件付費)
無訂閱、無月費,按工具呼叫次數收費:
事件 | 觸發時機 | 單價 |
| 每次行情資料呼叫: | $0.02 |
| 每次標的檢索: | $0.005 |
永遠免費: MCP 握手(initialize)和 tools/list——探索類請求不計費。
每個 Apify 帳號每月自帶 $5 平台免費額度(按 $0.02/次約 250 次報價呼叫),輕度用戶實際等於免費用。
HTTP 端點(遠端模式)
方法 | 路徑 | 說明 |
POST |
| MCP 協定端點(無狀態 Streamable HTTP) |
GET |
| 健康檢查 |
GET |
| 服務資訊;回應 Apify 容器就緒探測 |
部署你自己的實例
npm install -g apify-cli
apify login
cd mcp-stock-analyst
apify push # 在 Apify 平台側建置 Docker 映像檔Actor 定義(.actor/actor.json)已啟用 Standby 模式,MCP 路徑 /mcp。端點形如 https://<username>--mcp-stock-analyst.apify.actor/mcp(以 Console → Endpoints 頁為準)。
技術棧
Node.js ≥ 18、TypeScript、官方
@modelcontextprotocol/sdk資料源:騰訊公開行情介面(A股/港股/美股,免費無 key)+ Yahoo Finance chart 介面(台股,免費無 key)
多階段 Docker 建置(
node:20-alpine)
路線圖
按事件計費
台灣市場支援(TWSE / TPEx / 加權指數,Yahoo Finance 資料源)
資金流向 / 龍虎榜
財報摘要
自訂 API key 驗證層(自架時用)
授權條款
MIT
Available Tools
3 toolsget_klineB
Get historical K-line (candlestick) data for a stock. Day/week/month periods, up to 640 bars.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Stock code, e.g. "600519" or "sh600519" | |
| days | No | Number of bars (20-640, default 120) | |
| period | No | K-line period | day |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It adds 'up to 640 bars' and 'day/week/month periods', but these restate the input schema rather than revealing new behavior such as return format, error behavior, or whether the data is read-only. This is thin coverage for a tool with no annotation support.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One clean sentence with no filler, and the core action is front-loaded. Some words ('day/week/month periods', 'up to 640 bars') duplicate schema details rather than adding new information, so it is concise but not maximally informative.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The input side is fully covered by the schema (code, days, period), so an agent can construct a valid call. However, there is no output schema and the description never describes the shape of a K-line response, leaving the agent to guess how to consume the result. For a simple read tool this is a moderate gap, not a fatal one.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the schema documents defaults, ranges, and enum values for all three parameters. The description's mention of periods and bar limit adds no parameter meaning beyond the schema, so the baseline of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Get historical K-line (candlestick) data for a stock', naming a specific verb, resource, and scope. The 'historical' qualifier and the K-line/candlestick terminology distinguish it from the sibling tools get_quote and search_stock even without naming them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The word 'historical' implies this tool is for past bar data rather than current quotes, but the description never tells an agent when to prefer it over get_quote or search_stock, nor does it mention any exclusions or prerequisites. Usage is only implied, not stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_quoteA
Get real-time stock quote for A-share / HK / US stocks. Accepts codes like "600519", "sh600519", "00700" (HK), "AAPL" (US). Multiple codes separated by comma.
| Name | Required | Description | Default |
|---|---|---|---|
| codes | Yes | Stock code(s), comma separated, e.g. "600519,00700,AAPL" |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden for behavioral disclosure. It only states what it does, not whether it is read-only, has rate limits, or any side effects. It does not mention authentication, error handling, or response behavior. For a tool with zero annotation coverage, this is insufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loads the core purpose, and packs all necessary usage details (accepted formats, comma separation) without redundancy. Every sentence contributes meaning, making it highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple with one parameter and no output schema, but the description does not describe the return format or expected data structure. For a quote tool, the agent may need to know whether it returns a price object, a string, or errors. Given the lack of output schema and annotations, a bit more detail on what the caller should expect would improve completeness, but the core calling instructions are adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, but the description adds valuable context beyond the schema: it explicitly mentions the 'sh' prefix format and clarifies that HK codes like '00700' and US codes like 'AAPL' are accepted. This enhances the agent's understanding beyond the schema's single example, justifying a score above baseline 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it gets real-time stock quotes for three markets, lists accepted code formats, and implies a distinction from siblings (search_stock, get_kline) by focusing on real-time quote retrieval. The verb 'Get' plus the resource 'real-time stock quote' is specific and unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
While no explicit alternatives or when-not-to-use are given, the purpose is clear enough that an agent would infer this tool is for quotes, not searching or historical data. The context of real-time quotes differentiates it from siblings without needing explicit exclusion statements.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_stockA
Search stock code/name. Supports Chinese name, pinyin abbreviation, or partial code. Returns matched stocks with codes.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max results (default 8) | |
| query | Yes | Search keyword, e.g. "茅台", "GZMT", "600", "Tesla" |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full burden. It discloses that matches are returned with codes, but does not mention edge cases (e.g., no matches), result ordering, or how the limit parameter affects results. The behavior is mostly captured but lacks important contextual details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loads the purpose, and contains no filler or redundancy. Every phrase adds useful information about supported inputs and outputs.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple (2 params, no output schema, no annotations). The description explains the core purpose and input flexibility, but does not describe the result shape beyond 'stocks with codes' and omits notes about default limits or behavior when multiple matches exist. While adequate for a simple search, it leaves some operational details unspecified.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds the concept of pinyin abbreviation and partial code support, which slightly extends the schema's examples, but the schema already includes illustrative examples. The description does not add meaningful information about the limit parameter, so added value is minimal.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'search' and the resource 'stock', and specifies supported input formats (Chinese name, pinyin abbreviation, partial code). It also states the output ('matched stocks with codes'), which distinguishes it from siblings like get_quote and get_kline that retrieve specific data rather than search.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use the tool (when you have a partial identifier or name) through examples, but it does not explicitly state when to use this tool versus alternatives like get_quote or get_kline. No exclusions or alternative routing are mentioned, so guidance is merely implied rather than explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
get_kline - First observed
get_quote - First observed
search_stock
TDQS
Scored across 3 tools
Each tool has a clearly distinct role: search_stock resolves symbols, get_quote fetches live prices, and get_kline returns historical bars. There is no overlap or ambiguity between them.
All three tools follow the same lowercase snake_case verb_noun convention: get_quote, search_stock, get_kline. The naming pattern is consistent and predictable.
Three tools is within the reasonable range and each one earns its place, but for a server calling itself a 'stock analyst' the set is slightly lean. It covers the basics without bloat.
The core search -> quote -> kline workflow is well covered, and the read-only nature of the domain means CRUD operations are not expected. However, a true analyst toolset might also include fundamentals, market indices, or order book data, so there are minor gaps.
Maintenance
Related MCP Connectors
Provide access to Chinese stock market data including historical prices, real-time data, news, and…
Access real-time and historical market data for China A-shares and Hong Kong stocks, along with ne…
China A-share market data over MCP: 22 tools for quotes, K-line, financials, money flow, top-trader boards, sectors, macro, convertible bonds and factor screening. Five tools need no API key, so you can connect and try it immediately.
TradeOS MCP: ticker search, My Agent, chart TA, macro news. npm stdio or HTTP.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides real-time market data for A-shares, Hong Kong, and US stocks using the Tencent Finance API. It enables users to manage stock positions and watchlists through an AI assistant.1217 npm1ISC
- AlicenseNot gradedqualityDmaintenanceProvides free Chinese A-share stock data including real-time quotes, historical K-lines, market scanning, and multi-factor stock screening via BaoStock and Sina Finance APIs.MIT
- FlicenseNot gradedqualityBmaintenanceProvides real-time A-share stock quotes and historical K-line data via public APIs from Sina/Tencent, deployable on Cloudflare Workers.-
- FlicenseNot gradedqualityBmaintenanceProvides stock market data (search, quotes, real-time, charts) for A-share, Hong Kong, and US stocks via MCP tools.-