AKShare MCP Server
AKShare MCP Server
A Model Context Protocol (MCP) server that provides financial data analysis capabilities using the AKShare library.
Features
Access to Chinese and global financial market data through AKShare
Integration with Claude Desktop via MCP protocol
Support for various financial data queries and analysis
Related MCP server: Tushare_MCP
Installation
Using uv (recommended)
# Clone the repository
git clone https://github.com/yourusername/akshare_mcp_server.git
cd akshare_mcp_server
# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies with uv
uv pip install -e .Using pip
# Clone the repository
git clone https://github.com/yourusername/akshare_mcp_server.git
cd akshare_mcp_server
# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -e .Usage
Running the server
# Activate the virtual environment
source venv/bin/activate # On Windows: venv\Scripts\activate
# Run the server
python run_server.pyIntegrating with Claude Desktop
Add the following configuration to your Claude Desktop configuration:
"mcpServers": {
"akshare-mcp": {
"command": "uv",
"args": [
"--directory",
"/path/to/akshare_mcp_server",
"run",
"akshare-mcp"
],
"env": {
"AKSHARE_API_KEY": "<your_api_key_if_needed>"
}
}
}Restart Claude Desktop
Select the AKShare MCP server from the available tools
Available Tools
The AKShare MCP server provides the following tools:
Stock data queries
Fund data queries
Bond data queries
Futures data queries
Forex data queries
Macroeconomic data queries
And more...
Adding a New Tool
To add a new tool to the MCP server, follow these steps:
Add a new API function in
src/mcp_server_akshare/api.py:async def fetch_new_data_function(param1: str, param2: str = "default") -> List[Dict[str, Any]]: """ Fetch new data type. Args: param1: Description of param1 param2: Description of param2 """ try: df = ak.akshare_function_name(param1=param1, param2=param2) return dataframe_to_dict(df) except Exception as e: logger.error(f"Error fetching new data: {e}") raiseAdd the new tool to the enum in
src/mcp_server_akshare/server.py:class AKShareTools(str, Enum): # Existing tools... NEW_TOOL_NAME = "new_tool_name"Import the new function in
src/mcp_server_akshare/server.py:from .api import ( # Existing imports... fetch_new_data_function, )Add the tool definition to the
handle_list_tools()function:types.Tool( name=AKShareTools.NEW_TOOL_NAME.value, description="Description of the new tool", inputSchema={ "type": "object", "properties": { "param1": {"type": "string", "description": "Description of param1"}, "param2": {"type": "string", "description": "Description of param2"}, }, "required": ["param1"], # List required parameters }, ),Add the tool handler in the
handle_call_tool()function:case AKShareTools.NEW_TOOL_NAME.value: param1 = arguments.get("param1") if not param1: raise ValueError("Missing required argument: param1") param2 = arguments.get("param2", "default") result = await fetch_new_data_function( param1=param1, param2=param2, )Test the new tool by running the server and making a request to the new tool.
Development
# Install development dependencies
uv pip install -e ".[dev]"
# Run tests
pytestDocker
You can also run the server using Docker:
# Build the Docker image
docker build -t akshare-mcp-server .
# Run the Docker container
docker run -p 8000:8000 akshare-mcp-serverLicense
MIT
This server cannot be installed
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 Servers
- AlicenseCqualityDmaintenanceA Model Context Protocol server providing tools for querying A-share stock market data, including historical prices, financial reports, market indices, and macroeconomic indicators.241646MIT
- Alicense-qualityBmaintenanceA Model Context Protocol server that provides intelligent stock data assistance through Tushare's financial data API, enabling users to query comprehensive stock information, financial data, and market indices through natural language.48MIT
- FlicenseBqualityDmaintenanceA financial data server that provides real-time and historical data for A-shares, Hong Kong, and US markets using the AkShare library. It enables users to query market quotes, fundamental information, and technical indicators through the Model Context Protocol.144
- Alicense-qualityCmaintenanceA Model Context Protocol server that integrates Futu OpenAPI, enabling AI models to query real-time market data and execute trades across Hong Kong, US, and A-share markets.78MIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
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…
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/ttjslbz001/akshare_mcp_server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server