
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
vibelawyer
Advanced tools
Local MCP server for Chinese criminal case dossier review — generates Word notes and Excel catalogs on your machine
本地 FastMCP 阅卷工具箱。给定卷宗 PDF 目录,由 任意 Coding Agent(Cursor / Kimi Code / OpenCode / Codex / Claude Desktop 等)调用工具,产出:
.docx)—— 七部分结构 + 案件基本信息 + 阅卷结论(结构化数据完整渲染,无截断).xlsx)—— 分卷总览 / 阅卷目录 / 案件信息 / 证据索引不依赖 Claude Code CLI。 LLM 推理由宿主 Agent 提供;PDF 解析、OCR、Word/Excel 生成均在本机完成,卷宗不经过本服务上传。
事实与证据须标注来源卷宗及页码(如 见《主卷》P55-76),并可机器校验,落实「禁止幻觉、结论可回溯」。
对任意刑事案件通用,不假定具体罪名或当事人。本仓库不收录真实卷宗;运行时将 PDF 放入本地
data/(已 gitignore),产物写入output/(已 gitignore)。
同一 case_id 下,完整流程与零散按需共用全部工具,工作区状态共享。
| 模式 | 何时用 | 怎么做 |
|---|---|---|
| 完整阅卷 | 「把这案件按标准流程阅完」 | create_case → start_review 拿 playbook → 按 Skill 八步顺序调工具 → 校验导出 |
| 按需调用 | 「只查某页 / 只补一条供述 / 只出 Word」 | create_case 后直接调 read_pages / record_* / write_outputs 等 |
可先按 playbook 走完大半,再零散补登;也可先散读若干页,再按 playbook 补齐缺步。服务端不强制锁步;顺序约束写在 Skill / playbook 里,由宿主 Agent 遵守。
┌──────── 宿主 Coding Agent(Cursor / Kimi / OpenCode / Codex …)────────┐
│ 读 skills/vibelawyer-review/SKILL.md;完整流程或按需调 MCP 工具 │
└───────────────────────────────┬───────────────────────────────────────┘
│ stdio / http
▼
┌──────── vibelawyer-mcp(FastMCP)─────────────────────────────────────┐
│ create_case / 读卷 / record_* / validate / write_outputs / download │
│ CaseWorkspace(case_id 隔离)+ 本机 PDF/OCR │
└───────────────────────────────┬───────────────────────────────────────┘
▼
docling → pypdfium2 → tesseract chi_sim
→ 阅卷笔录.docx + 阅卷目录.xlsx
| 组件 | 作用 |
|---|---|
vibelawyer/tools.py + tool_spec.py | 原子工具(本地 ToolSpec,无 claude-agent-sdk) |
vibelawyer/mcp_server.py | FastMCP 对外暴露;passthrough 复用 handler |
vibelawyer/playbook.py | 标准步骤与铁律;与 Skill / start_review 同源 |
skills/vibelawyer-review/SKILL.md | 宿主可加载的阅卷 Skill |
vibelawyer/sessions.py | 多案件 case_id 隔离 |
start_review 只下发 playbook,不启动后台 LLM job。
可选遗留:pip install 'vibelawyer[legacy-agent]' + python -m vibelawyer.run --legacy(需本机 Claude Code CLI,非默认路径)。
pip install vibelawyer
# 开发安装
pip install -e .
~/.local/share/docling-venv)提升扫描件 OCRtesseract + chi_sim 作为 OCR 回退uvx vibelawyer
# 等价别名:
# uvx --from vibelawyer vibelawyer-mcp
# 已 pip install 时:vibelawyer 或 vibelawyer-mcp
mcp.json{
"mcpServers": {
"vibelawyer": {
"command": "uvx",
"args": ["vibelawyer"]
}
}
}
claude_desktop_config.json){
"mcpServers": {
"vibelawyer": {
"command": "uvx",
"args": ["vibelawyer"]
}
}
}
在各自 MCP 配置中填入同一 command / args。已安装包时可将 command 改为 vibelawyer(或别名 vibelawyer-mcp)、args 留空。本地 CLI 指引用 vibelawyer-cli。
配置完成后,让 Agent 阅读并遵循:
skills/vibelawyer-review/SKILL.md
(或调用 start_review 获取与 Skill 同源的结构化 playbook。)
create_case(case_dir="/绝对路径/到卷宗目录") → case_iddefendant_hint / charge_hint / output_dir)start_review(case_id) → 拿到 steps / 铁律 / 调用约定get_case_status 或 get_workspace_summary 核实登记计数(勿信口头「已完成」)validate_citations → write_outputs → download_output(fmt="docx"|"xlsx")create_case(...)
list_volumes / search_volumes / read_pages / get_volume_outline # 只读
record_* / add_* # 补登记
write_outputs / download_output # 仅导出
python -m vibelawyer.run # 打印 MCP 接入指引
python -m vibelawyer.run --print-playbook # 打印完整 playbook(Markdown)
# 诊断 / 渲染冒烟(不调用 LLM)
python scripts/diag.py
python scripts/smoke_render.py
VIBELAWYER_MCP_TRANSPORT=http VIBELAWYER_MCP_PORT=8000 vibelawyer
# 或别名:vibelawyer-mcp
# 可选鉴权:VIBELAWYER_MCP_TOKEN=<secret>
Passthrough 读/写/校验工具签名:tool_name(case_id, args={...})。
| 工具 | 作用 |
|---|---|
create_case | 发现 PDF、建会话,返回 case_id |
list_cases / get_case_status | 会话列表与各部分登记计数 |
start_review | 下发 playbook(宿主执行;无后台 job) |
get_review_progress | 说明无后台 job,并再次附上 playbook |
download_output | 取回 docx / xlsx |
| 工具 | 作用 |
|---|---|
list_volumes | 卷宗名 / 文件 / 页数 |
get_volume_outline | 逐页概览(定位文书边界) |
read_pages | 页码区间文本(含本地 OCR) |
search_volumes | 跨卷关键词检索 |
get_page_image | 渲染页面图像(视觉) |
| 工具 | 笔录部分 |
|---|---|
set_case_basic | 案件基本信息 |
record_party | 一、当事人(仅本案被告人) |
record_indictment / add_charged_fact | 二、起诉书 / 指控事实 |
record_statement(role=defendant|codefendant|witness) | 三~五、供述与证言(宜含 full_text) |
record_procedural_doc | 六、程序性文书(含文号) |
record_documentary_evidence / add_transaction | 七、书证与资金流水 |
add_catalog_entry | 阅卷目录条目 |
record_conclusions / record_funds_summary | 结论与资金勾稽 |
| 工具 | 作用 |
|---|---|
get_workspace_summary | 各部分登记进度 |
validate_citations | 校验引用页码合法性 |
write_outputs | 生成 Word 笔录 + Excel 目录 |
与 playbook.py / Skill 一致:
add_catalog_entry,定位起诉书页set_case_basic / record_party / record_indictment / add_charged_factrecord_statement(role=defendant),含逐字 full_textrole=codefendantrole=witnessrecord_procedural_doc(尽量含文号)record_documentary_evidence + 流水类 add_transactionrecord_conclusions / record_funds_summary(不做正式辩护策略)validate_citations → write_outputs → download_outputread_pages 实际读到的内容登记,严禁编造get_volume_outline 再精读;用 search_volumes 防遗漏get_workspace_summary / get_case_status 核实计数附:阅卷目录、阅卷结论(核心事实 / 证据链条 / 矛盾点 / 待核查疑点)。
(2) 等后缀)create_case(case_dir="<绝对路径>")write_outputs无需改代码即可用于受贿、贪污、诈骗、非法吸收公众存款等;职务犯罪会提取任职情况。
validate_citations 防幻觉页码data/、output/、tessdata/ 已 gitignore,勿提交真实卷宗或当事人信息vibelawyer/
tool_spec.py 本地 @tool / ToolSpec
tools.py 原子工具 handler
playbook.py 宿主步骤与铁律(与 Skill 同源)
mcp_server.py FastMCP Server
sessions.py case_id 会话
workspace.py CaseWorkspace + 引用校验
pdf_volume.py docling / pypdfium2 / tesseract
config.py 案件发现与配置
orchestrator.py 可选 legacy(Claude Code)
agents.py 分步提示别名
run.py CLI 指引 / --print-playbook / --legacy
generators/ docx + xlsx
skills/vibelawyer-review/SKILL.md
scripts/diag.py
scripts/smoke_render.py
MIT
FAQs
Local MCP server for Chinese criminal case dossier review — generates Word notes and Excel catalogs on your machine
We found that vibelawyer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.