AKShare Financial Data MCP server

Provides direct access to AKShare's financial data capabilities for retrieving and analyzing market data, economic indicators, and financial statistics from Chinese and global markets without switching contexts.
Back to servers
Setup instructions
Provider
wukan
Release date
May 09, 2025
Stats
2 stars

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.

Installation

To install AKShare MCP Server, follow these steps:

  1. Set up a virtual environment (recommended)
  2. Install the package using pip:
pip install akshare_mcp

Or using uv:

uv pip install akshare_mcp
  1. Verify the installation by running:
python -m akshare_mcp -h

This command will display the help information and the location of the configuration file.

Configuration

MCP Client Configuration

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.

Selecting Specific Interfaces

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:

  1. Find the location of the configuration file by running:

    python -m akshare_mcp -h
    
  2. 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

  3. Refresh and reconnect your MCP client to the server

Using Custom Configuration

If you don't have permission to modify the default configuration file in the installation directory, you can:

  1. Copy the config.py file from the GitHub repository to any location
  2. Use the --config parameter to specify your custom configuration:
python -m akshare_mcp --config /path/to/your/config.py

Usage

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.

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later