Skip to main content
Glama
jq-docs-mcp

jq-docs-mcp

by jimmer-code

问题: 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. '获取股票数据', '获取融资融券标的列表')

Inputs: section (required). Returns: result

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.

Inputs: no named parameters. Returns: result

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')

Inputs: function_name (required). Returns: result

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')

Inputs: table_name (required). Returns: result

search_docsA

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

Args: keyword: Search term in English or Chinese

Inputs: keyword (required). Returns: result

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. '获取股票数据')

Inputs: keyword (required), section (required). Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    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.

    Related MCP Connectors

    Related MCP Servers