mcpField
A
ashareport

ashareport

Local
github.com/CloudCorpRecordsFinance0Updated 1w ago

About ashareport

ashareport is a CLI and stdio MCP server for querying China A-share market data. Its tools cover quotes, history, news, financial statements, metrics, inner trades, and local trading-time information; market-data calls require a configured endpoint.

Key features

  1. 01Historical stock data
  2. 02Realtime quotes and news
  3. 03Financial statements and metrics
  4. 04Inner-trade data
  5. 05Local time and trading-day info
  6. 06Configurable source fallback

Use cases

  1. 01Inspect a stock's historical prices
  2. 02Retrieve realtime quotes or company news
  3. 03Review statements and financial metrics
  4. 04Check the last trading day

MCP support

Exposes nine tools for A-share data and time information. Market-data tools POST requests to the endpoint configured by `ASHAREPORT_API_URL`; `get_time_info` runs locally.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"cloudcorprecords-ashareport": {
"command": "npx",
"args": [
"-y",
"@reneturcios/ashareport"
]
}
}
}
Run commandnpx -y @reneturcios/ashareport

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@reneturcios/ashareport0.1.0
ocighcr.io/cloudcorprecords/ashareport:0.1.0

Tools

9

Saved tool list · updated 1w ago

ParameterTypeRequiredDescription
adjuststringNoPrice adjustment mode, such as qfq (forward), hfq (backward), or none.
sourcestringNoData source to query, such as yahoo, sina, or eastmoney.
symbolstringYesStock ticker symbol, for example AAPL.
end_datestringNoEnd date of the history range, as YYYY-MM-DD.
fallbackbooleanNoWhen true, fall back to another source if the chosen source fails.
intervalstringNoBar interval unit, such as day, week, or month.
recent_nnumberNoReturn only the most recent N bars.
start_datestringNoStart date of the history range, as YYYY-MM-DD.
indicators_listarrayNoTechnical indicators to compute alongside the bars, such as SMA or RSI.
interval_multipliernumberNoInterval multiplier, for example 5 with interval minute gives 5-minute bars.

Details

From the project README

ashareport

ashareport exposes nine A-share (China mainland) stock-data tools — history, realtime quotes, news, balance sheet, income statement, cash flow, inner trades, and financial metrics, plus a local time tool — as a command line program and as a stdio MCP server.

How the data tools work (read this first)

The original design runs a Python market-data library in-process. This TypeScript rebuild uses an endpoint executor instead: set

export ASHAREPORT_API_URL="https://your-data-endpoint.example"

and each data tool POSTs JSON {tool, source, params} to {ASHAREPORT_API_URL}/<tool> and returns the endpoint's JSON answer. With the variable unset, data tools return an error: upstream data endpoint not configured: set ASHAREPORT_API_URL .... get_time_info is fully local and needs no endpoint.

Source fallback is implemented locally, in the documented order:

DomainSource order
historicaleastmoney → eastmoney_direct → sina → ths
realtimeeastmoney_direct → eastmoney → xueqiu → ths (xueqiu/ths skipped when no symbol is given)
newseastmoney → ths
statements / metricssina → eastmoney_direct

The requested source is tried first, then the domain order when fallback is not false, stopping at the first non-empty result. If every source fails, the error lists each source and its error. Defaults: interval day, adjust none, recent_n 100 for historical data and 10 for the other recent-N tools.

indicators_list is passed through to the endpoint, not computed locally. get_time_info walks back from today skipping Saturday and Sunday to find the last trading day; exchange holidays are not modelled.

Install

npx @reneturcios/ashareport get_time_info
docker run -i ghcr.io/cloudcorprecords/ashareport   # MCP server

CLI

ashareport get_hist_data --symbol 600519 --interval day --recent-n 20
ashareport get_realtime_data --symbol 600519
ashareport get_realtime_data            # market-wide, symbol optional
ashareport get_news_data --symbol 600519
ashareport get_balance_sheet --symbol 600519
ashareport get_income_statement --symbol 600519
ashareport get_cash_flow --symbol 600519
ashareport get_inner_trade_data --symbol 600519
ashareport get_financial_metrics --symbol 600519
ashareport get_time_info
ashareport --version

Exit codes: 0 success, 1 tool error, 2 usage error.

MCP server

npx -y @reneturcios/ashareport mcp
{
  "mcpServers": {
    "ashareport": {
      "command": "npx",
      "args": ["-y", "@reneturcios/ashareport", "mcp"],
      "env": { "ASHAREPORT_API_URL": "https://your-data-endpoint.example" }
    }
  }
}
Tools
ToolRequiredOther parameters
get_hist_datasymbolinterval, interval_multiplier, start_date, end_date, adjust, source, fallback, indicators_list, recent_n
get_realtime_data— (symbol optional)source, fallback
get_news_datasymbolsource, fallback, recent_n
get_balance_sheetsymbolsource, fallback, recent_n
get_income_statementsymbolsource, fallback, recent_n
get_cash_flowsymbolsource, fallback, recent_n
get_inner_trade_datasymbol—
get_financial_metricssymbolsource, fallback, recent_n
get_time_info—— (local: ISO time, Unix timestamp, last trading day)

Development

npm install
npm run build   # tsc -> dist/
npm test        # node test runner, fake-fetch only, no network
npm run dev     # run the CLI from source via tsx

License

MIT — see LICENSE.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.