Skip to main content
Glama
jiaweizhang1995

jq-docs-mcp


问题: AI 写聚宽策略时总是瞎编函数签名、搞错参数名、返回值类型全靠猜。

方案: 把聚宽官方文档塞进 AI 的工具箱,查了再写,一次写对。

jq-docs-mcp 是一个 MCP 服务器,内置 221 个 API 函数2,479 个数据表字段 的完整文档。一行命令安装,AI 直接查表写代码。

30 秒安装

Claude Code:

claude mcp add jq-docs -- uvx --from git+https://github.com/jiaweizhang1995/jq-docs-mcp jq-docs-mcp

没了。重启 Claude,开始用。

编辑 ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "jq-docs": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/jiaweizhang1995/jq-docs-mcp",
        "jq-docs-mcp"
      ]
    }
  }
}

Related MCP server: Quant Research Platform MCP Server

效果演示

装好之后,直接对 Claude 说人话:

👤  get_price 怎么用?有哪些参数?
🤖  [调用 lookup_function] → 返回完整签名、8个参数说明、返回值类型、示例代码

👤  搜索融资融券相关的 API
🤖  [调用 search_docs] → 找到 get_mtss、get_margincash_stocks 等 4 个 API

👤  balance_sheet 表有哪些字段?
🤖  [调用 lookup_table_columns] → 返回 123 个字段的名称、类型、中文含义

👤  帮我写一个获取茅台近一年日线数据的策略
🤖  [先查 get_price 文档,确认参数] → 写出正确代码,不靠猜

没有这个工具: AI 靠记忆编代码 → 参数名拼错 → 运行报错 → 来回改

有了这个工具: AI 先查文档再写 → 一次正确 → 直接跑

6 个查询工具

工具

用途

示例

lookup_function

精确查询函数文档

"get_price 的参数是什么"

search_docs

中英文关键词搜索

"搜索融资融券"

list_by_section

按分类浏览

"获取股票数据分类下有哪些函数"

search_in_section

分类内搜索

"在财务数据里搜索 balance"

list_functions

列出全部 221 个函数

"都有哪些可用的 API"

lookup_table_columns

查询数据表字段

"income_statement 有哪些列"

数据覆盖

从聚宽官方 9 个帮助页面完整抓取:

📊 221 个 API 函数    — 签名、参数、返回值、示例代码
📋 2,479 个表字段    — 字段名、类型、中文含义
🔍 支持中英文搜索    — "融资融券" 和 "get_mtss" 都能找到
❌ 找不到时给建议    — 输错函数名会推荐相似函数

高级用法

自定义数据库

默认使用内置数据库。如果你自己抓取了更新的数据:

JQ_DB_PATH=/path/to/your/jq_knowledge.db jq-docs-mcp

重新抓取

git clone https://github.com/jiaweizhang1995/jq-docs-mcp.git
cd jq-docs-mcp
uv sync
uv run python run_scrape.py

API 文档页面公开可访问,无需登录。策略页面需要手机号登录。

技术栈

  • 运行时依赖:FastMCP — 轻量、零配置

  • 数据库: SQLite 只读模式,757KB,随包分发

  • 传输协议: stdio(本地运行,无需网络)

License

MIT


Available Tools

6 tools
list_by_sectionB

List all API functions in a specific documentation section. 列出某个文档分类下的所有API函数。

Args: section: Section name (e.g. '获取股票数据', '获取融资融券标的列表')

ParametersJSON Schema
NameRequiredDescriptionDefault
sectionYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full responsibility for disclosing behavioral traits. It only states the basic action and gives parameter examples, but does not mention edge cases (e.g., invalid section names), potential side effects, pagination, or authorization requirements. The behavior is treated as a black box, which is insufficient for a tool without structured annotation support.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief and front-loaded, with the main statement in the first line and the parameter explanation following. The bilingual Chinese translation is redundant but not harmful. It earns a high score for efficiency, slightly reduced by the unnecessary repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity and the presence of an output schema, the description covers the basic action and parameter. However, it lacks context about how section names are defined, what happens when a section is empty, and how this tool relates to the sibling tools. These gaps make it only minimally complete for a tool in a family of similar operations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides only a type for the 'section' parameter, but the description supplies critical context with examples ('获取股票数据', '获取融资融券标的列表') and clarifies it is a section name. This meaningfully compensates for the 0% schema description coverage, giving the agent a concrete sense of valid values.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'List all API functions in a specific documentation section.' It identifies the verb ('list'), resource ('API functions'), and scope ('specific documentation section'). However, it does not explicitly differentiate from sibling tools like 'list_functions' or 'search_in_section', though the section-scoping is implicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as 'search_in_section' or 'lookup_function'. It only states what the tool does, with no exclusions or contextual triggers. This absence of usage direction leaves the agent without clear selection criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_functionsA

List all available JoinQuant API function names, grouped by section. 列出所有可用的聚宽API函数名,按文档分类分组。

Use this to discover what functions are available before looking up specific ones.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the core behavior (list names, grouped by section) but omits any note about read-only nature, potential result size, or output structure. For a simple list operation this is adequate but not extra informative.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences in English and Chinese, plus a clear usage note. No extraneous information. Front-loaded with the primary purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool is simple (no params), and output schema exists, so description doesn't need to explain return values. It covers the main function and usage purpose. Could mention if it returns descriptions or just names, but for discovery it's sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema is empty with zero parameters, so baseline is 4. Description adds nothing about parameters (none exist), but this is fine since the schema trivially covers everything and no parameter semantics are needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it lists all available JoinQuant API function names, grouped by section. This is a specific verb+resource and differentiates from siblings like list_by_section (which lists a specific section) and lookup_function (which finds details).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit usage context: 'Use this to discover what functions are available before looking up specific ones.' This indicates when to use (for initial discovery) and implicitly contrasts with looking up specific functions. No formal alternatives named, but the guidance is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

lookup_functionA

Look up complete documentation for a JoinQuant API function by exact name. 查询聚宽API函数的完整文档,包括参数列表、返回值和示例代码。

Args: function_name: Exact function name (e.g. 'get_price', 'get_fundamentals')

ParametersJSON Schema
NameRequiredDescriptionDefault
function_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses that this is a non-mutating read operation (lookup) and explains what the returned documentation includes (parameters, return value, example code). It does not cover error behavior or exact-match handling, but the core behavior is transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise but includes redundant bilingual repetition (English and Chinese say the same thing). The Args section is well-structured and front-loaded. Minor redundancy prevents a perfect score.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, output schema present), the description provides sufficient context for correct invocation. It explains what the output includes and the exact-name constraint. Missing error-case details are a minor gap, but overall it's nearly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema only specifies 'function_name' as a string with no description. The description's Args section adds critical meaning: 'Exact function name' and concrete examples ('get_price', 'get_fundamentals'). This fully compensates for the 0% schema coverage and clarifies the expected input format.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it looks up complete documentation for a JoinQuant API function by exact name, which is specific and distinguishes it from search or listing by implying exact-name matching. However, it does not explicitly contrast with sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when you know the exact function name, but it provides no explicit guidance on when not to use it or mentions alternatives. 'By exact name' is the only contextual clue differentiating it from search_docs or list_functions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

lookup_table_columnsA

Look up all column definitions for a JoinQuant data table. 查询聚宽数据表的所有字段定义(字段名、类型、含义)。

Critical for get_fundamentals queries where exact column names are needed.

Args: table_name: Table name (e.g. 'balance_sheet', 'income_statement')

ParametersJSON Schema
NameRequiredDescriptionDefault
table_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses that the tool performs a read-only lookup of column definitions and, via the Chinese text, specifies the output fields. It does not mention any limitations or side effects, but for a simple metadata lookup, this is adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured: the core purpose is stated upfront, followed by a usage hint and a clearly formatted Args section. The bilingual line (English + Chinese) adds value by clarifying what 'definitions' means, and no extraneous content is present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter tool with an output schema, the description is complete. It explains the tool's purpose, provides a usage scenario, and documents the parameter with examples. There is no need to explain return values since an output schema exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides only a string parameter with no description (0% coverage). The description compensates by explicitly documenting the parameter: 'table_name: Table name (e.g. 'balance_sheet', 'income_statement')', including concrete examples, which is highly useful for an agent.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'looks up all column definitions for a JoinQuant data table', specifying both the action and resource. It also includes a Chinese translation that enumerates the returned fields (name, type, meaning), distinguishing it from sibling tools that handle functions or documentation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a concrete use case: 'Critical for get_fundamentals queries where exact column names are needed.' This tells the agent when to use the tool, but it does not explicitly mention alternatives or when not to use it, so it falls short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_docsA

Search JoinQuant API docs by keyword (English or Chinese). 搜索API文档,支持英文和中文关键词搜索(函数名、中文名、描述、调用签名)。

Args: keyword: Search term in English or Chinese

ParametersJSON Schema
NameRequiredDescriptionDefault
keywordYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses that the search covers function names, Chinese names, descriptions, and call signatures, and supports both languages. This adds meaningful behavioral context beyond a generic 'search docs', though it doesn't mention any limits or output details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded with the core purpose, followed by a short bilingual repetition and an Args section. Every sentence earns its place without unnecessary fluff, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, output schema present), the description covers the essential purpose, search scope, and parameter semantics. It lacks explicit guidance on when to use sibling tools, but overall it is adequate for an agent to select and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides no description for the single 'keyword' parameter (0% coverage). The description compensates by explaining 'keyword' is a search term in English or Chinese and that it matches specific doc fields, adding value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'Search JoinQuant API docs by keyword', with a specific verb and resource. It also specifies scope (English/Chinese, matching function names, descriptions, signatures), distinguishing it from sibling tools like lookup_function which likely target exact lookups.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for keyword-based search across docs, and the mention of English/Chinese and searchable fields gives context. However, it does not explicitly state when to prefer this over alternatives like lookup_function or list_by_section, nor provide exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_in_sectionA

Search API docs within a specific section only. 在指定文档分类中搜索API函数。

Args: keyword: Search term in English or Chinese section: Section name to search within (e.g. '获取股票数据')

ParametersJSON Schema
NameRequiredDescriptionDefault
keywordYes
sectionYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry behavioral disclosure. It adds useful context: keyword can be English or Chinese, and section is a category name (with example). But it does not mention return format, edge cases, or authorization, though it's a simple search tool with no destructive side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise: two sentences and an Args list. The purpose is front-loaded, and every sentence contributes meaning. The Chinese translation is an extra but not wasteful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-parameter search tool with an output schema, the description covers purpose, parameter semantics, and scope. It does not explicitly direct users to alternatives, but the sibling names and the 'only' qualifier cover the main contextual gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description compensates by explaining 'keyword' as a search term with language flexibility and 'section' with a concrete example. This adds meaning beyond the bare schema names and types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description directly states action ('Search'), resource ('API docs'), and scope ('within a specific section only'), clearly distinguishing it from sibling tools like search_docs (global) and list_by_section (listing without keyword).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'within a specific section only' clearly sets the context for section-scoped searches, implying when to use this tool. However, it does not explicitly name alternatives or exclusions, but the context is clear enough.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv1.0.0
    • First observedlist_by_section
    • First observedlist_functions
    • First observedlookup_function
    • First observedlookup_table_columns
    • First observedsearch_docs
    • First observedsearch_in_section

TDQS

A4/5.0

Scored across 6 tools

Disambiguation4/5

Each tool has a clear primary purpose, but search_docs and search_in_section overlap as both perform searches; the latter is just a filtered version of the former. All other tools are distinctly about lookup, listing, or column definitions.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern (lookup_function, search_docs, list_by_section, etc.), making the naming predictable and easy to infer.

Tool Count5/5

Six tools is well within the ideal range for a documentation lookup server, covering search, listing, and detail retrieval without unnecessary bloat.

Completeness5/5

The tool surface covers the full documentation workflow: discover functions via listing/searching, get detailed docs, and retrieve table column definitions. No obvious gaps for the stated purpose.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers