# AKShare

Gives the model three tools to search, inspect and call AKShare functions for China market data. Useful when a fixed list of sources is not enough.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 570
- Author: agentpit-io
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/agentpit-io/hunter-community/tree/HEAD/tools/akshare-mcp
- Updated: 2026-10-14
- HTML: https://affpapa.org/en/nevibecode/mcp/akshare

## What it does

AKShare is a Python library, not an HTTP service, so you cannot wire it up with a single URL. The server runs locally and exposes three tools: `akshare_search` finds functions by query, `akshare_signature` shows what arguments a function takes, and `akshare_call` runs it. Nothing has to be enumerated in advance — the model finds the right interface itself.

Start it with Docker: build the image in `tools/akshare-mcp` and run the container on port `8931`. The image is about 1.5G because AKShare pulls in pandas, lxml and beautifulsoup4, so the first build takes a few minutes. To check it is up, hit `http://localhost:8931/sse`.

Most AKShare interfaces reach upstream sites inside China. On a machine outside the country many calls will time out, so run the server on a Chinese host or give the container a proxy. Keep it off the public internet: there is no auth, and AKShare sends requests to third-party sites, which means anyone could route those requests through your machine.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `AKSHARE_MAX_ROWS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env AKSHARE_MAX_ROWS=<AKSHARE_MAX_ROWS> --transport stdio akshare-mcp -- uvx agentpit-akshare-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from agentpit-akshare-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add akshare-mcp --env AKSHARE_MAX_ROWS=<AKSHARE_MAX_ROWS> -- uvx agentpit-akshare-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from agentpit-akshare-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "akshare-mcp": {
            "command": "uvx",
            "args": [
                "agentpit-akshare-mcp"
            ],
            "env": {
                "AKSHARE_MAX_ROWS": "<AKSHARE_MAX_ROWS>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from agentpit-akshare-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "akshare-mcp": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "agentpit-akshare-mcp"
            ],
            "env": {
                "AKSHARE_MAX_ROWS": "<AKSHARE_MAX_ROWS>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from agentpit-akshare-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e AKSHARE_MAX_ROWS=<AKSHARE_MAX_ROWS> akshare-mcp uvx agentpit-akshare-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from agentpit-akshare-mcp <command>

## When to use it
- find an AKShare function by the Chinese name of a metric
- check which arguments a given interface expects
- call a function and get a table with its original Chinese columns
- cap the number of rows so the response does not flood the model context
- run local access to China market data without an external service

## Example prompts
- Search AKShare for 龙虎榜 and show me the function signature
- Call `stock_lhb_detail_em` and show the first rows
- Find functions for 北向资金 and call the right one

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [CCXT](https://affpapa.org/en/nevibecode/mcp/ccxt.md) — MCP server · ★ 44583
- [Finance Toolkit](https://affpapa.org/en/nevibecode/mcp/finance-toolkit.md) — MCP server · ★ 5458
- [EdgarTools](https://affpapa.org/en/nevibecode/mcp/edgartools.md) — MCP server · ★ 2814
- [LetsFG — Flights & Hotels](https://affpapa.org/en/nevibecode/mcp/letsfg-flights-hotels.md) — MCP server · ★ 2188
- [AutoTS](https://affpapa.org/en/nevibecode/mcp/autots.md) — MCP server · ★ 1434

From the same set: [agentpit-io/hunter-community](https://affpapa.org/en/nevibecode/by/agentpit-io/hunter-community.md) — 3 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
