CNEquity

Read-only MCP access to a self-built local Parquet lake of China A-share market and company data

By rootSunc (individual) Python Local · stdio Finance and paymentsDatabases

47 popularity score ★ 973 ↓ 3.3k/mo

Connect your client

Local (PyPI)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

FirstTerminal
pip install cnequity
cne init --profile demo
Claude CodeTerminal
claude mcp add cnequity -- cne mcp --config '<ABSOLUTE_PATH_TO_CONFIG>'
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "cnequity": {
      "command": "cne",
      "args": [
        "mcp",
        "--config",
        "<ABSOLUTE_PATH_TO_CONFIG>"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "cnequity": {
      "command": "cne",
      "args": [
        "mcp",
        "--config",
        "<ABSOLUTE_PATH_TO_CONFIG>"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "cnequity": {
      "type": "stdio",
      "command": "cne",
      "args": [
        "mcp",
        "--config",
        "<ABSOLUTE_PATH_TO_CONFIG>"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.cnequity]
command = "cne"
args = ["mcp", "--config", "<ABSOLUTE_PATH_TO_CONFIG>"]
Gemini CLITerminal
gemini mcp add --scope user cnequity cne -- mcp --config '<ABSOLUTE_PATH_TO_CONFIG>'

What it does

CNEquity is a Python toolkit that collects China market data from public sources (Tongdaxin protocol, Eastmoney, Sina, Baostock, CNINFO, the exchanges and others) into a Parquet data lake on your own disk. Its `cne mcp` command exposes that lake to an assistant over stdio, so questions about daily prices, adjustment factors, financial statements, valuation, fund flows, index membership, announcements and delisted stocks are answered from the stored history rather than a live quote feed.

The server has six tools, cut by the shape of the question rather than by dataset: one describes what the lake holds, one maps names to codes (delisted names included), three read bars, statement items and any other dataset, and one runs a single read-only DuckDB SELECT. Research rules are put into the responses: price queries without an adjustment mode carry a warning, and fundamentals queries refuse to run without an explicit `as_of` date so later restatements do not leak into historical answers.

Every response reports total, returned and truncated counts. In v0.16.0's tools.py a query returns 200 rows by default and at most 2000 with `limit`, with `offset` for paging. An optional `--live` mode answers symbol lookups and unadjusted daily bars straight from the sources without a lake, capped at 50 symbols and 800 days per call; every other tool refuses in that mode. A `--http` mode serves Streamable HTTP on 127.0.0.1:8788 for clients that only take a URL, such as ChatGPT through a tunnel.

What it needs

RuntimePython 3.10+

Python 3.10 or later on macOS, Linux or Windows, with the cnequity package installed so the `cne` command is on the PATH. A lake must be built first (`cne init`, or `cne init --profile demo` for a small trial; a full three-year build can take hours), and its config file passed by absolute path. No account or token is needed for the base sources; some supplementary sources need your own credentials.

Limits

The MCP server only reads; collection and daily updates are done separately with `cne init` and `cne run daily`. It refuses to start when the lake's curated folder holds no Parquet files. Queries return 200 rows by default, up to 2000 with `limit`. In `--live` mode only `resolve_symbol` and unadjusted daily bars work, and delisted stocks are not found. Minute bars, ticks, futures and options are off by default. The project is 0.x and its docs track main, so the PyPI release may lag them. No backtesting, signals or order placement. Data is under the upstream sources' own terms; public source availability and history depth change.

Who it suits

Suits quantitative researchers and analysts who want an assistant to answer historical China A-share questions (multi-year valuation percentiles, point-in-time fundamentals, behaviour of delisted stocks) from data they hold and can audit, and who are willing to build and maintain a local lake. Because it is local and read-only, it does not touch brokerage accounts. Someone who only needs an occasional latest quote will find building a lake heavy; the README suggests calling a data API directly in that case, and compares the project with AKShare and Tushare.

Tools 6

describe_lake
Reports which datasets the lake holds, their coverage and the rules for adjustment and point-in-time use; call it first
resolve_symbol
Turns a company name or partial code into a security code, including delisted stocks with their delisting date
query_bars
Reads daily, index or minute bars for given symbols, with an adjustment mode and universe
query_fundamentals
Reads financial statement items as known on a required as_of date
query_dataset
Reads any other dataset in the lake, filtered by date range and symbol
run_sql
Runs one read-only DuckDB SELECT across the lake for aggregates, rankings and percentiles

Similar servers