MCP Stock Assistant
A Model Context Protocol (MCP) server that provides real-time stock information using the Xueqiu API.
Features
Fetch real-time stock data by stock code
Support for Chinese stocks (e.g., SH600519) and US stocks (e.g., AAPL)
Returns comprehensive stock information including:
Stock name
Current price
Increase/decrease percentage
Additional market data
Installation
Clone the repository:
git clone <repository-url> cd mcp-stockInstall dependencies:
npm installBuild the project:
npm run build
Usage
Running the Server
Start the MCP server:
Using with MCP Clients
"mcp-stock": { "command": "node", "args": [ "/Users/zhangyanhua/Documents/augment-projects/mcp-stock/build/index.js" ] }
This server implements the Model Context Protocol and can be used with any MCP client, such as Claude Desktop.
The server provides the following tool:
get-stock-info
: Get real-time stock informationParameter:
stock_code
- The stock code (e.g., SH600519, AAPL)
Example Response
Stock Codes
Chinese A-shares: Prefix with exchange code
Shanghai:
SH
(e.g.,SH600519
)Shenzhen:
SZ
(e.g.,SZ000858
)
US stocks: Use ticker symbol directly (e.g.,
AAPL
,MSFT
)
Notes
This server uses the Xueqiu API to fetch real-time stock data
The server runs on stdio transport, making it compatible with MCP clients
No API key is required for basic usage, but there may be rate limits
License
ISC
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
Provides real-time stock information for Chinese A-shares and US stocks using the Xueqiu API. Enables users to fetch comprehensive market data including current price, percentage changes, volume, and other key metrics by stock code.