MCP · Docker

Docker image: ashareapi/mcp

Already using Docker? No Python, no dependencies — one command and you are in. The image contains only the MCP client; all data comes from api.ashareapi.com.

Two commands

MCP mode (stdio — for Claude Code / Cursor / Codex and other clients)

Best for: keeping Python and dependencies out of your host; clients that speak MCP over stdio

docker run -i --rm -e ASHARE_KEY=ct-你的Key ashareapi/mcp

Gateway mode (HTTP — one egress point for your intranet, easy to audit)

Best for: scripts / intranet batch jobs / a single egress with audit / key mapping (the container only forwards, it stores no data)

docker run -p 8080:8080 -e ASHARE_KEY=ct-你的Key ashareapi/mcp gateway

Then you can just curl it, for example:

curl "http://localhost:8080/v1/quote?code=600519"

Which of the three to use

OptionBest forContainer?
Local container · MCP (stdio)AI clients fetching data; no Python on the host, isolated depsYes (docker run -i)
Local container · gateway (HTTP)Scripts / intranet batch / single egress / audit / key mappingYes (-p 8080:8080)
Remote MCP (api.ashareapi.com/mcp)No container, client supports remote MCPNo

All three return the same data (same backend) with the same key and quota — the only difference is who runs the process.

What's inside

  • · Two files only: the MCP client and the entrypoint (~128 KB) on top of python:3.12-slim
  • · No data source: quotes / K-lines / financials all come from https://api.ashareapi.com
  • · No key baked in: the key is passed only via an environment variable
  • · Free tools need no key: quotes / K-lines / hot list / market overview / breadth / doc search

Environment variables

VariableMeaningDefault
ASHARE_KEYAPI key (optional for free tools)none
ASHARE_APIAPI endpointhttps://api.ashareapi.com
PORTgateway port8080

Official channels (all published)

Same key, same quota — every channel is native.

No key yet?

Free tools need no key; paid tools (financials / money flow / dragon-tiger / screening / backtests) start at ¥9.9.

Build it yourself

Source, Dockerfile and build notes live in the MCP repo:github.com/ashareapi/ashareapi-mcp/docker