文档 / 汉字词典
字

汉字词典/handict-mcp/mcp

查单个汉字给拼音、笔画、部首、释义、笔顺编号和可读笔顺;查词语成语给释义并逐字拆解。还能按拼音、部首、释义关键词反查汉字。

2 个工具7 天调用 —免费 100 次 / 天 / IP

MCP 客户端接入

一行命令,工具自动出现在 Agent 的工具列表里。

bashclaude mcp add
# Claude Code / Cursor / 任何 MCP 客户端
claude mcp add --transport http mycel-handict https://pianam.cn/handict-mcp/mcp

HTTP 直连

标准 JSON-RPC 2.0。initialize 握手不消耗额度,只有 tools/call 计数。

bash先看有哪些工具
curl -s https://pianam.cn/handict-mcp/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

工具清单

2 个工具,参数与返回结构均来自线上真实响应
01

lookup_word

2 个参数

新华字典/汉语词语查询。输入单个汉字(如'龙')返回拼音、笔画数、部首、释义、笔顺编号与可读笔顺(横/竖/撇/点/折);输入词语或成语(如'画蛇添足'、'天气'、'一帆风顺')返回该词条释义(成语附拼音与出处),并逐字拆解返回每个字的拼音/笔画/部首;库内含约1.5万汉字、26万条词语、3万条成语。detail=false 可关闭逐字拆解。

入参

参数类型必填默认说明
querystring必填—单个汉字或词语/成语,如 龙、画蛇添足、天气、一帆风顺
detailboolean可选true是否逐字拆解返回单字信息,默认 True
bash直接 curl 调(真实可跑)
curl -s https://pianam.cn/handict-mcp/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"lookup_word","arguments":{"query":"龙","detail":false}}}'
json返回示例(线上真实结果)
{
  "success": true,
  "query": "龙",
  "type": "汉字",
  "char": {
    "char": "龙",
    "pinyin": "lónɡ",
    "strokes": 5,
    "radical": "龙",
    "explanation": "龙 \n\n (象形。甲骨文,象龙形。本义古代传说中一种有鳞有须能兴云作雨的神异动物) …(此处省略约 900 字释义)",
    "bishun_code": "13534",
    "bishun_desc": "一(横) 丿(撇) 乙(折) 丿(撇) 丶(点)"
  }
}

查词语/成语时顶层是 word 字段(word / pinyin / word_type / explanation,成语的出处写在 explanation 里);detail=true 时另附 char_breakdown 数组做逐字拆解。汉字是 char 字段,词语是 word 字段,别混。释义文本很长,取用前建议自己截断。

02

search_char

2 个参数

按拼音、释义关键词或部首检索汉字列表。拼音带不带声调均可:keyword='long' 或 'lóng' 查拼音为 long 的字(龙/隆/笼等);keyword='木' 查部首为木或释义含木的字;keyword='常绿乔木' 按释义检索。返回汉字列表(含拼音、笔画、部首、笔顺)。limit 默认20(1-100)。

入参

参数类型必填默认说明
keywordstring必填—拼音(long / lóng)、释义关键词或部首
limitinteger可选20返回条数,1-100,默认 20
bash直接 curl 调(真实可跑)
curl -s https://pianam.cn/handict-mcp/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_char","arguments":{"keyword":"long","limit":2}}}'
json返回示例(线上真实结果)
{
  "success": true,
  "keyword": "long",
  "pinyin_ascii": "long",
  "total": 36,
  "results": [
    {
      "char": "龙",
      "pinyin": "lónɡ",
      "strokes": 5,
      "radical": "龙",
      "explanation": "龙 …(释义省略)",
      "bishun_code": "13534",
      "bishun_desc": "一(横) 丿(撇) 乙(折) 丿(撇) 丶(点)"
    },
    {
      "char": "拢",
      "pinyin": "lǒnɡ",
      "strokes": 8,
      "radical": "扌",
      "explanation": "拢 …(释义省略)",
      "bishun_code": "12113534",
      "bishun_desc": "一(横) 丨(竖) 一(横) 一(横) 丿(撇) 乙(折) 丿(撇) 丶(点)"
    }
  ]
}

total 是命中总数,results 只返回 limit 条。拼音检索时 pinyin_ascii 会回显去声调的检索词。

✓

免费额度:每 IP 每天 100 次

超额返回 -32002,带 X-API-Key 继续用。密钥在 pianam.cn 注册后于控制台创建。

← 回全部端点