> Source: https://ashareapi.com/en/mcp/docker/  ·  Markdown version for LLMs / AI agents

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
 |
| | Option | Best for | Container?

| | Local container · MCP (stdio) | AI clients fetching data; no Python on the host, isolated deps | Yes (`docker run -i`)

| | Local container · gateway (HTTP) | Scripts / intranet batch / single egress / audit / key mapping | Yes (`-p 8080:8080`)

| | Remote MCP (`api.ashareapi.com/mcp`) | No container, client supports remote MCP | No

 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
 |
| | Variable | Meaning | Default

| | `ASHARE_KEY` | API key (optional for free tools) | none

| | `ASHARE_API` | API endpoint | `https://api.ashareapi.com`

| | `PORT` | gateway port | `8080`

## Official channels (all published)
 Same key, same quota — every channel is native.

- Python SDK — [PyPI](https://pypi.org/project/ashareapi/)

- Node.js / TypeScript SDK — [npm](https://www.npmjs.com/package/ashareapi)

- MCP server — [GitHub](https://github.com/ashareapi/ashareapi-mcp)

- Docker image — [Docker Hub](https://hub.docker.com/r/ashareapi/mcp)

- Official MCP Registry — [com.ashareapi/ashare-data-api](https://registry.modelcontextprotocol.io)

- Agent Skill — [GitHub](https://github.com/ashareapi/ashareapi-skill)

 No key yet?
 Free tools need no key; paid tools (financials / money flow / dragon-tiger / screening / backtests) start at ¥9.9.
 [Get a key](/en/pricing)[See MCP setup](/en/mcp)

## Build it yourself
 Source, Dockerfile and build notes live in the MCP repo:[github.com/ashareapi/ashareapi-mcp/docker](https://github.com/ashareapi/ashareapi-mcp/tree/main/docker)
