Pkulaw Mcp Law Retrieval logo

Pkulaw Mcp Law Retrieval

Community
NEU-ZHA
pkulaw-mcp-law-retrieval

北大法宝原生 MCP 的成本感知法规检索 Skill。Use when:用户要找法规、规范性文件、司法解释或精准法条。默认先用约 25 积分的 `law-keyword`/`fatiao`;只有两轮合理关键词仍不足时才升级约 125 积分的 `law-semantic`。NOT for:案例检索或网页登录操作。禁止无检索依据编造法规名称、文号、条号或效力状态。

Overview

PublisherNEU-ZHA
Repositorylegal-ai-skills
Skill namepkulaw-mcp-law-retrieval
Stars
70
Forks
7
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by NEU-ZHA on GitHub. Read the source before you install it.

Installation

Install the Pkulaw Mcp Law Retrieval AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/NEU-ZHA/legal-ai-skills/tree/main/skills/pkulaw-mcp-law-retrieval
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/NEU-ZHA/legal-ai-skills.git /tmp/legal-ai-skills
mkdir -p .claude/skills
cp -r /tmp/legal-ai-skills/skills/pkulaw-mcp-law-retrieval .claude/skills/pkulaw-mcp-law-retrieval
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Pkulaw Mcp Law Retrieval in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Pkulaw Mcp Law Retrieval on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Pkulaw Mcp Law Retrieval is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

北大法宝 MCP:法律法规检索

这个 Skill 只负责一件事:把法规资料找出来,并按可复核的方式交给后续分析或答复环节。

它和 pkulaw-legal-search 不重复:本 Skill 只走原生 MCP 的法规/法条能力;MCP 不通、当前会话没加载对应工具、返回 401/403/超时/无结果、结果不足、需要网页详情页、登录态或 Computer Use 时,立即转 pkulaw-legal-search。

当前覆盖三个原生 MCP 服务:

路径serverId什么时候优先用
关键词检索law-keyword用户已给出法规标题词、正文关键词、概念词,希望返回列表
精准法条fatiao用户已给出法规名 + 条号,或需要核对条文原文
语义检索law-semantic两轮合理关键词仍无法覆盖自然语言问题,作为升级路径

如果任务已经明确是“只查案例”,请转到 pkulaw-mcp-case-retrieval。如果任务是“已知法规名 + 条号取全文”,优先走 fatiao;如果当前会话尚未暴露该 MCP,再用 law-keyword 找法规线索并转网页端详情页核对条号和原文。

先看边界

  • 本 Skill 的目标是找依据,不是直接形成最终法律意见。
  • 返回到的法规材料,仍需结合时效、层级、适用范围、特别法与一般法关系继续判断。
  • 若用户要求形成可交付答复,应把检索结果继续交给组合型 Skill,而不是在这里直接扩写结论。

必须遵守的规则

  1. 具体法规名称、文号、条号或效力判断须有实际取得的可靠原文支持,用户材料和官方网页也可作为来源。
  2. 按实际取得的来源做摘要,不得用模型记忆补齐缺失依据,也不得将网页结果称为 MCP 返回。
  3. 关键词路径下,title 与 fulltext 至少有一项;具体参数名仍以 tools 输出为准。
  4. 认证失败、超时或工具不存在时停止该接口,按需用用户材料、官方网页或其他已授权来源继续;没有依据的部分标待核。正常返回但召回不足时按下列成本路由补检。
  5. 不得把 law-semantic 当默认入口;它约 125 积分,只能在关键词路径不足且能说明缺口时升级一次。
  6. MCP 路由失败或结果不足时,默认转 pkulaw-legal-search 的网页/Computer Use 流程继续核查。

默认路由

按下面顺序判断:

  1. 用户给的是明确词组、法规标题、正文关键词:
    • 先走 law-keyword
  2. 用户给的是明确法规名 + 条号:
    • 先走 fatiao,当前实测工具名为 get_law_item_content,参数为 title 和 tiao_num
  3. 用户给的是案情描述、业务问题、咨询问题:
    • 先提炼 1-3 个关键词,再走 law-keyword
  4. 关键词结果太少、过窄:
    • 换法律全称/简称、制度名、核心行为、责任类型或相关主体再检索
  5. 两轮有理由的关键词仍缺少相关规范:
    • 只升级调用一次 law-semantic,并记录为什么升级

不要因用户输入是自然语言就直接走语义检索。AI 本身可以先提炼关键词,通常 25 积分路径已经足够。

推荐工作流

  1. 先把用户需求收敛成“要找哪一类法规依据”。
  2. 选择 law-keyword。
  3. 用 tools 确认真实 <toolName> 与参数名。
  4. 完成一次检索。
  5. 只整理当次返回里的标题、摘要、时效、链接等信息。
  6. 若结果不足,先做一次有理由的关键词补检索;仍不足才升级语义,不并发调用。

失败与降级

允许的失败输出

只允许类似下面的结构:

markdown
当前未拿到法宝法规检索结果。

失败原因:
- [未认证 / Token 失效 / 无订阅 / 无结果 / 工具不存在 / 命令报错]

建议动作:
- 检查 `pkulaw-mcp` 配置与 Token
- 检查对应服务是否已订阅
- 将问题改写得更具体后重试

允许的降级方式

  • law-keyword 结果过宽 -> 增加标题词、正文词或限定法律部门
  • law-keyword 结果过窄 -> 换同义词、法律全称/简称、核心制度词后重试
  • 仍无结果 -> 尝试用户材料或可靠网页原文;仍无可靠依据时说明缺口,不生成无据结论

终端复现与排障

如需在终端复现,请先安装 @pkulaw/mcp-cli;安装后命令为 pkulaw-mcp。

bash
pkulaw-mcp tools law-keyword
pkulaw-mcp law-keyword <toolName> --title "劳动合同"
pkulaw-mcp tools law-semantic

说明:

  • <toolName> 必须以 pkulaw-mcp tools <serverId> 的输出为准
  • 当前实测工具名为 get_law_list,但正式环境中仍应以 tools/list 返回为准

输出结构

按下面结构输出最稳:

  1. 问题重述
  2. 检索路径(关键词或语义,为什么这样选)
  3. 关键结果片段
  4. 初步观察
  5. 待复核点

补充材料

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Pkulaw Mcp Law Retrieval AI skill do?

北大法宝原生 MCP 的成本感知法规检索 Skill。Use when:用户要找法规、规范性文件、司法解释或精准法条。默认先用约 25 积分的 `law-keyword`/`fatiao`;只有两轮合理关键词仍不足时才升级约 125 积分的 `law-semantic`。NOT for:案例检索或网页登录操作。禁止无检索依据编造法规名称、文号、条号或效力状态。

Why use Pkulaw Mcp Law Retrieval on TypingMind?

Because you install it once and use it with any model. Pkulaw Mcp Law Retrieval is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Pkulaw Mcp Law Retrieval in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/NEU-ZHA/legal-ai-skills/tree/main/skills/pkulaw-mcp-law-retrieval. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Pkulaw Mcp Law Retrieval?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Pkulaw Mcp Law Retrieval?

As many as you like. As long as a model supports skills, you can use Pkulaw Mcp Law Retrieval with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Pkulaw Mcp Law Retrieval AI skill free?

Yes. It is published on GitHub by NEU-ZHA under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇