AKShare MCP Server is a wrapper that exposes AKShare data interfaces as an MCP (Model Context Protocol) server. It allows you to access over 1,000 data interfaces provided by AKShare, making it convenient to retrieve various types of data through the MCP protocol.
To install AKShare MCP Server, follow these steps:
pip install akshare_mcp
Or using uv:
uv pip install akshare_mcp
python -m akshare_mcp -h
This command will display the help information and the location of the configuration file.
You need to configure your MCP client to connect to the AKShare MCP Server. Add the following configuration to your MCP client's settings:
{
"mcpServers": {
"akshare_mcp": {
"command": "/path/to/your/python",
"args": [
"-m",
"akshare_mcp",
"--format",
"markdown"
]
}
}
}
Make sure to replace /path/to/your/python
with the actual path to your Python executable.
Since AKShare provides over 1,000 interfaces, exposing all of them as tools can consume a large number of tokens. Also, some MCP clients only support a limited number of tools (e.g., Trae supports a maximum of 40 tools).
To configure which interfaces you want to use:
Find the location of the configuration file by running:
python -m akshare_mcp -h
Edit the config.py
file to add the interfaces you need. For reference on available interface names, visit https://akshare.akfamily.xyz/data/index.html
Refresh and reconnect your MCP client to the server
If you don't have permission to modify the default configuration file in the installation directory, you can:
config.py
file from the GitHub repository to any location--config
parameter to specify your custom configuration:python -m akshare_mcp --config /path/to/your/config.py
Once configured, you can start the AKShare MCP Server by running:
python -m akshare_mcp
Your MCP client will then be able to access the AKShare data interfaces as tools through the MCP protocol. The interfaces you've configured in the config.py
file will be available to use through your MCP client.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "akshare_mcp" '{"command":"python","args":["-m","akshare_mcp","--format","markdown"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"akshare_mcp": {
"command": "python",
"args": [
"-m",
"akshare_mcp",
"--format",
"markdown"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"akshare_mcp": {
"command": "python",
"args": [
"-m",
"akshare_mcp",
"--format",
"markdown"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect