MCP Stock Assistant
The MCP Stock Assistant server provides real-time and historical Chinese A-share stock market data through the East Money API, requiring no authentication.
Core Capabilities:
Real-time Stock Information - Retrieve current data including price, change percentage, P/E ratio, trading volume, turnover, turnover rate, and 5-level bid/ask spread data
Stock Search - Query stocks using 6-digit codes (e.g., 600519) or company names (e.g., 贵州茅台) with intelligent fuzzy matching
Historical K-line Data - Access daily, weekly, or monthly historical data for up to 500 days, including opening, closing, high, and low prices
Market Index Tracking - Monitor major indices including Shanghai Composite Index (上证指数) and Shenzhen Component Index (深证成指)
Multi-board Support - Coverage for all Chinese A-share markets including Shanghai Main Board (600, 601, 603, 605), STAR Market (688), Shenzhen Main Board (000), SME Board (002), and ChiNext (300, 301)
Click on "Install 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 Assistantshow me the current price and change for Apple stock"
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 Assistant
一个基于模型上下文协议 (MCP) 的股票信息服务器,使用东方财富API提供实时股票数据。
功能特性
📈 获取实时股票数据(支持股票代码或名称查询)
📊 获取股票历史K线数据(日K、周K、月K)
🏛️ 获取大盘指数信息(上证指数、深证成指)
💹 详细的买卖盘口信息
📋 支持中国A股市场(沪深两市)
🔍 智能股票搜索(支持股票名称模糊匹配)
Related MCP server: Stock Data MCP Server
安装说明
克隆仓库:
git clone <repository-url> cd mcp-stock安装依赖:
pnpm install构建项目:
pnpm run build
使用方法
配置MCP客户端
在Claude Desktop或其他MCP客户端的配置文件中添加以下配置:
{
"mcpServers": {
"mcp-stock": {
"command": "node",
"args": [
"/Users/zhangyanhua/Documents/augment-projects/mcp-stock/build/index.js" // 打包后的真实路径
]
}
}
}该服务器实现了模型上下文协议,可以与任何支持MCP的客户端配合使用,如Claude Desktop。
可用工具
服务器提供以下三个工具:
get-stock-info: 获取股票实时信息参数:
stock_code- 股票代码或名称(例如:600519 或 贵州茅台)
get-stock-history: 获取股票历史数据参数:
stock_code- 股票代码或名称period- 时间周期(1d=日K线, 1w=周K线, 1m=月K线,默认1d)days- 获取天数(1-500天,默认30天)
get-market-index: 获取大盘指数信息无参数,返回上证指数和深证成指的实时数据
使用示例
1. 获取股票实时信息
股票信息: 600519 (贵州茅台)
当前价格: 1756.00
跌幅: -0.85%
涨跌额: -15.00
开盘价: 1770.00
最高价: 1775.00
最低价: 1750.00
昨收价: 1771.00
成交量: 45678.00手
成交额: 8023456.00万
换手率: 0.36%
市盈率(动态): 35.2
振幅: 1.41%
更新时间: 15:00:00
买卖盘口:
卖5: 1758.00 / 120.00手
卖4: 1757.00 / 89.00手
卖3: 1756.50 / 156.00手
卖2: 1756.20 / 234.00手
卖1: 1756.00 / 67.00手
买1: 1755.80 / 145.00手
买2: 1755.50 / 78.00手
买3: 1755.20 / 203.00手
买4: 1755.00 / 167.00手
买5: 1754.80 / 89.00手2. 获取股票历史数据
📈 贵州茅台(600519) 历史数据 (最近10个交易日)
日期 开盘 收盘 最高 最低 成交量(手) 涨跌幅
─────────────────────────────────────────────────────────────────
2024-01-15 1770.00 1756.00 1775.00 1750.00 45678.00 📉-0.85%
2024-01-12 1780.00 1771.00 1785.00 1765.00 52341.00 📈+0.57%
...
📊 统计信息:
最高价: 1785.00
最低价: 1720.00
平均价: 1752.50
总成交量: 456789.00手3. 获取大盘指数信息
📊 大盘指数信息
指数名称 当前点位 涨跌幅 涨跌点 成交量(手) 成交额(万)
──────────────────────────────────────────────────────────────────
上证指数 2956.48 📉-0.42% -12.56 123456789.00 45678901.00
深证成指 9234.67 📉-0.38% -35.23 98765432.00 32109876.00
🕐 更新时间: 15:00:00股票代码格式
支持以下格式的股票查询:
按代码查询
沪市A股: 6位数字代码(如:
600519、601318、688981)深市A股: 6位数字代码(如:
000858、002415、300750)
按名称查询
股票全名: 如
贵州茅台、平安银行股票简称: 如
茅台、平安
代码规则
沪市主板: 600、601、603、605开头
科创板: 688开头
深市主板: 000开头
中小板: 002开头
创业板: 300、301开头
技术说明
📡 使用东方财富API获取实时股票数据
🔌 基于stdio传输协议,与MCP客户端完全兼容
🆓 无需API密钥,免费使用(可能存在频率限制)
🚀 支持智能搜索,可通过股票名称模糊匹配
📊 提供完整的技术指标和盘口数据
开源协议
ISC
Available Tools
3 toolsget-market-indexB
获取大盘指数概览信息,包括上证指数和深证成指等主要指数的实时数据
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. The description mentions '实时数据' (real-time data), which is useful behavioral context about freshness. However, it doesn't disclose other important traits: whether this is a read-only operation, authentication requirements, rate limits, error conditions, or what format the data returns. For a data retrieval 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 a single, efficient Chinese sentence that states exactly what the tool does. Every word earns its place: it specifies the action (获取 - get), the resource (大盘指数概览信息 - market index overview information), and the scope (上证指数和深证成指等主要指数的实时数据 - real-time data for Shanghai Composite, Shenzhen Component and other major indices). No wasted words.
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?
Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is reasonably complete for a basic data retrieval tool. It tells what data is returned and that it's real-time. However, without annotations or output schema, it should ideally mention more about the return format, data fields, or authentication requirements to be fully complete.
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?
The tool has 0 parameters with 100% schema description coverage. The description appropriately doesn't discuss parameters since none exist. It does mention the scope ('大盘指数概览信息' - market index overview information) which helps understand what data will be returned, adding value beyond the empty schema.
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 tool's purpose: '获取大盘指数概览信息' (get market index overview information) with specific resources mentioned ('上证指数和深证成指等主要指数' - Shanghai Composite Index, Shenzhen Component Index, and other major indices). It distinguishes from sibling tools (get-stock-history, get-stock-info) by focusing on market indices rather than individual stocks. However, it doesn't explicitly contrast with siblings in the description text.
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 provides no guidance on when to use this tool versus alternatives. While it's clear this tool is for market indices rather than individual stocks (implied differentiation from siblings), there's no explicit 'when-to-use' or 'when-not-to-use' guidance, nor any mention of prerequisites or context for usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-stock-historyB
获取单个股票的历史数据、过去价格、K线数据,支持日K、周K、月K线,用于分析股票过去的表现
| Name | Required | Description | Default |
|---|---|---|---|
| stock_code | Yes | 股票代码或名称 (例如: 600519 或 贵州茅台) | |
| period | No | 时间周期: 1d=日K线, 1w=周K线, 1m=月K线 | 1d |
| days | No | 获取天数 (1-500天) |
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 mentions data retrieval ('获取') and supports different K-line periods, but fails to disclose critical traits such as rate limits, authentication requirements, data freshness, error handling, or response format. For a data-fetching tool with zero annotation coverage, this leaves significant gaps in understanding its operational behavior.
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 concise and front-loaded, stating the core purpose in the first clause. It uses two sentences efficiently: one for the main action and another for usage context. There's no wasted text, and it avoids redundancy, though it could be slightly more structured for clarity.
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?
Given the tool's complexity (3 parameters, no output schema, no annotations), the description is incomplete. It covers the basic purpose and implied usage but lacks details on behavioral aspects (e.g., rate limits, auth), response format, and explicit sibling differentiation. Without annotations or output schema, more context is needed for effective agent use, making it inadequate for a data retrieval tool.
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%, with all parameters well-documented in the schema itself (e.g., 'stock_code' as stock code/name, 'period' as time cycle with enum values, 'days' as number of days). The description adds minimal value beyond the schema, only reiterating support for daily, weekly, and monthly K-lines without providing additional syntax or usage details. Baseline score of 3 is appropriate as the schema does the heavy lifting.
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 tool's purpose: '获取单个股票的历史数据、过去价格、K线数据' (get historical data, past prices, K-line data for a single stock). It specifies the resource (stock) and actions (retrieve historical data), distinguishing it from siblings like 'get-market-index' and 'get-stock-info' by focusing on historical price data rather than market indices or general stock information. However, it doesn't explicitly contrast with siblings in the text, keeping it from a perfect score.
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 usage context with '用于分析股票过去的表现' (used for analyzing past stock performance), suggesting when to use this tool. However, it lacks explicit guidance on when to choose this over alternatives like 'get-stock-info' (which might provide current data) or 'get-market-index', and doesn't mention any prerequisites or exclusions. The guidance is present but not comprehensive.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-stock-infoB
获取单个股票的实时当前信息,包括当前价格、涨跌幅、成交量等实时数据
| Name | Required | Description | Default |
|---|---|---|---|
| stock_code | Yes | 股票代码或名称 (例如: 600519 或 贵州茅台) |
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 states the tool provides '实时当前信息' (real-time current information), which implies it's a read-only operation with fresh data, but it doesn't disclose critical traits like rate limits, authentication needs, data freshness guarantees, error handling, or whether it's a safe operation. For a tool with zero annotation coverage, this leaves significant gaps in behavioral understanding.
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 a single, efficient sentence that front-loads the core purpose ('获取单个股票的实时当前信息') and lists key data points without unnecessary elaboration. Every word earns its place, making it highly concise and well-structured for quick comprehension.
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?
Given the tool's low complexity (one parameter, no nested objects) and lack of annotations or output schema, the description is minimally adequate. It covers the basic purpose and data scope, but it doesn't address behavioral aspects (e.g., safety, performance) or provide usage guidance relative to siblings. For a simple read tool, this is borderline viable, but it could be more complete by adding context on limitations or alternatives.
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?
The schema description coverage is 100% (the single parameter 'stock_code' is fully documented in the schema with a clear description and examples). The description adds no additional meaning about parameters beyond what the schema provides—it doesn't explain parameter semantics, constraints, or usage nuances. With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.
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 tool's purpose: '获取单个股票的实时当前信息' (get real-time current information for a single stock). It specifies the verb (获取/get) and resource (股票/stock), and lists key data points like price, change percentage, and volume. However, it doesn't explicitly distinguish this tool from its sibling 'get-stock-history' (which likely provides historical data), so it doesn't fully achieve sibling differentiation.
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 provides no guidance on when to use this tool versus alternatives. It doesn't mention the sibling tools 'get-market-index' (for market indices) or 'get-stock-history' (for historical data), nor does it specify any prerequisites, exclusions, or contextual cues for selection. Usage is implied by the description's focus on '实时当前信息' (real-time current information), but this is insufficient for explicit guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly distinct purpose: get-market-index focuses on market indices, get-stock-history retrieves historical data for individual stocks, and get-stock-info provides real-time information for individual stocks. There is no overlap in functionality, making it easy for an agent to select the appropriate tool.
All tool names follow a consistent verb_noun pattern with hyphens (e.g., get-market-index, get-stock-history, get-stock-info). The naming is uniform and predictable, using the same verb 'get' followed by a descriptive noun phrase.
With only 3 tools, the server feels thin for a stock assistant domain. While the tools cover basic data retrieval (indices, historical data, real-time info), it lacks operations for analysis, trading, or portfolio management, which are common in stock-related tools. The count is borderline but reasonable for a minimal setup.
The tool surface is significantly incomplete for a stock assistant. It only provides read-only data retrieval (get operations) with no ability to create, update, or delete (e.g., no tools for setting alerts, managing watchlists, or executing trades). This will cause agent failures when trying to perform common stock-related tasks beyond basic queries.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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…
Fetch current stock prices and key data for symbols across global markets. Look up companies like…
Look up the latest stock prices by ticker symbol across global markets. Get current price and esse…
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables real-time stock market analysis through AKShare API integration. Supports retrieving live stock prices, historical data, technical indicators (MA, MACD, RSI), market sentiment analysis, stock search, and financial news.5
- AlicenseNot gradedqualityDmaintenanceEnables querying financial data including stocks, indices, funds, and futures from Chinese, Hong Kong, and US markets. Provides real-time market information, financial indicators, news, and trading suggestions through Eastmoney and Sina data sources.133ISC
- 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.1220ISC
- AlicenseNot gradedqualityDmaintenanceEnables users to query Chinese A-share stock data, including stock basics, historical prices, financial reports, and macroeconomic indicators.1MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/qqzhangyanhua/mcp-stock'
If you have feedback or need assistance with the MCP directory API, please join our Discord server