stock-mcp-query

Query historical market data via MCP (A-shares, HK stocks, ETFs, indices). Used for daily K-lines, financial statements, market indicators, filtering, or other bulk data. DeepSeek Harness clients should call stock_list_tools first, then stock_call_tool. The remote HTTP MCP on port 8001 still requires STOCK_MCP_TOKEN.

Last repository push
GitHub Stars
199
Forks
50
Issues / PRs
3

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "stock-mcp-query" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-d3ad268dbaaa4e70ad46baa6fc79308b5cfa774a3b3a21c9a334cc024e1b973b. Verify the upstream source and version against https://github.com/Yourdaylight/stock_datasource before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Query historical market data via MCP (A-shares, HK stocks, ETFs, indices). Used for daily K-lines, financial statements, market indicators, filtering, or other bulk data. DeepSeek Harness clients should call stock_list_tools first, then stock_call_tool. The remote HTTP MCP on port 8001 still requires STOCK_MCP_TOKEN.

0 Downloads

Introduction source: third_party · Yourdaylight · 0.0.1 Reference

SkillPi interpretation

Tasks
Query historical stock market data (A-shares, HK stocks, ETFs, indices) via MCP. Use when the user wants daily K-line, financial statements, market indicators, screening, or other batch data. DeepSeek Harness clients should call stock_list_tools then stock_call_tool. Remote HTTP MCP on port 8001 still requires STOCK_MCP_TOKEN.
Software, accounts and paid services
This skill requires: 1. **STOCK_MCP_TOKEN** environment variable — a JWT token purchased from the management platform (nps_enhanced) 2. **STOCK_MCP_SERVER_URL** environment variable (optional) — the MCP server URL, defaults to the URL provided at purchase time
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: stock-mcp-query
description: Query historical stock market data (A-shares, HK stocks, ETFs, indices) via MCP. Use when the user wants daily K-line, financial statements, market indicators, screening, or other batch data. DeepSeek Harness clients should call stock_list_tools then stock_call_tool. Remote HTTP MCP on port 8001 still requires STOCK_MCP_TOKEN.

Stock MCP Query

Query historical stock market data including daily OHLCV, financial reports, index data, ETF data, and more through the MCP protocol.

Prerequisites

This skill requires:

  1. STOCK_MCP_TOKEN environment variable — a JWT token purchased from the management platform (nps_enhanced)
  2. STOCK_MCP_SERVER_URL environment variable (optional) — the MCP server URL, defaults to the URL provided at purchase time

Setup Check

Before using any data query tools, verify the environment is configured:

# Check if token exists
echo ${STOCK_MCP_TOKEN:+Token is set}${STOCK_MCP_TOKEN:-ERROR: STOCK_MCP_TOKEN not set}

If STOCK_MCP_TOKEN is not set:

  1. Visit the management platform (nps_enhanced web panel)
  2. Navigate to "MCP Data Query" subscription page
  3. Purchase a query quota pack (e.g., 10k records for 10 CNY)
  4. Copy the issued token
  5. Set the environment variable:
    export STOCK_MCP_TOKEN="eyJ..."
    export STOCK_MCP_SERVER_URL="https://your-node:8001/messages"

DeepSeek Harness

When running inside DeepSeek Harness (dsh), do not call the raw plugin tools. Use:

  1. mcp__stock__stock_list_tools — category is one of market|basic|financial|index|etf|hk|realtime|toplist|other; query is a keyword such as daily or a ts_code prefix.
  2. mcp__stock__stock_call_tool — tool_name must be a name returned by the list tool (example: tushare_daily_get_daily_data); arguments is a JSON object matching that tool's inputSchema.

Keep queries narrow (one ts_code / code and a short date range). Results are truncated.

Start dsh with this repo's overlay instead of pointing at localhost:8001/messages:

export STOCK_DATASOURCE_ROOT=/absolute/path/to/stock_datasource
dsh web --patch "$STOCK_DATASOURCE_ROOT/integrations/dsh/stock.cordis.yml"

Stdio MCP spawned by dsh does not use STOCK_MCP_TOKEN.

MCP Server Configuration (Claude Code / Cursor / PicoClaw)

Add to your MCP client configuration:

{
  "mcpServers": {
    "stock-data": {
      "type": "streamable-http",
      "url": "${STOCK_MCP_SERVER_URL}",
      "headers": {
        "Authorization": "Bearer ${STOCK_MCP_TOKEN}"
      }
    }
  }
}

Available Data Categories

Category Description Example Tools
Daily K-line OHLCV + volume + turnover tushare_daily_*
Daily Basics PE, PB, market cap, volume ratio tushare_daily_basic_*
Adj Factor Forward/backward adjustment factors tushare_adj_factor_*
Financial Balance sheet, income, cash flow tushare_balancesheet_*, etc.
Index Index daily, weights, components tushare_index_*
ETF ETF daily prices and holdings tushare_fund_*
HK Stock Hong Kong stock daily data akshare_hk_*
Market Market overview, trading calendar tushare_trade_cal_*

Usage Notes

  • Each tool call returns data and counts against your query quota
  • The response includes _usage.record_count showing records returned
  • The response includes _usage.quota_remaining showing remaining quota
  • When quota is exhausted, purchase additional packs from the management platform
  • Data is sourced from ClickHouse and covers the full available history

Billing

  • Billed per record (data row) returned by each tool call
  • Query packs are valid for 90 days from purchase
  • Multiple packs stack additively (quota accumulates)
  • Usage is reconciled asynchronously between the MCP server and management platform

Troubleshooting

  • 401 "API key required": STOCK_MCP_TOKEN is not set or not passed in Authorization header
  • 401 "Token expired": Your token has expired. Purchase a new quota pack to get a fresh token
  • 401 "Invalid token": Token is malformed or the server's public key doesn't match
  • No data returned: Check that the requested date is a trading day, or the stock code is valid
  • Quota exhausted: The _usage.quota_remaining will show 0. Purchase additional packs

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value65/100

Highlights

  • 提供通过 MCP 协议查询历史股市数据(A股、港股、ETF、指数)的明确功能,满足特定金融数据需求
  • 涵盖日K线、财务报表、市场指标等多种数据类型,功能范围清晰
Trigger Precision80/100

Highlights

  • 触发条件描述清晰:当用户需要日K线、财务报表、市场指标、筛选或批量数据时使用
  • 明确了 DeepSeek Harness 客户端的调用顺序 (stock_list_tools -> stock_call_tool)
Structure and Standards75/100

Areas to improve

  • 缺少独立的 When to Use/示例章节 Reported severity: Minor

    文档主体描述了用法,但未设置独立的 'When to Use' 或 'Examples' 章节标题

    Recommendation: 建议添加独立的 'When to Use' 和 'Examples' 章节以提升可读性和规范性

Highlights

  • 文档结构清晰,包含 Prerequisites、Setup Check、DeepSeek Harness、MCP Server Config、Data Categories、Usage Notes、Billing、Troubleshooting 等完整章节
  • 提供了具体的 bash 命令和 JSON 配置示例,便于用户理解和操作
Execution Reliability85/100

Highlights

  • 详细说明了环境变量要求 (STOCK_MCP_TOKEN, STOCK_MCP_SERVER_URL) 和设置检查方法
  • 提供了完整的故障排查指南,涵盖常见 HTTP 错误 (401)、配额耗尽等场景
  • 明确了计费模式 (按记录计费)、配额管理和购买流程
Evidence Verifiability (mean of the first four)76/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Accounts, secrets or authorization

    Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.

    Mentioned in main document · lines 104
Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • your-node

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

This skill requires: 1. **STOCK_MCP_TOKEN** environment variable — a JWT token purchased from the management platform (nps_enhanced) 2. **STOCK_MCP_SERVER_URL** environment variable (optional) — the MCP server URL, defaults to the URL provided at purchase time

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.