CodeBook — 让不会写代码的人也能理解、诊断和修改软件产品。一键安装的 MCP Server。
Project description
CodeBook MCP Server
让不会写代码的人也能理解、诊断和修改软件产品的 MCP 工具。
快速开始
cd mcp-server
# 安装依赖(macOS 请用 pip3)
pip3 install -e ".[dev]"
# 启动 MCP Server(stdio 模式,供 Claude Desktop 使用)
python3 -m src.server
# 或使用 entry point
codebook
配置 MCP 客户端
Claude Desktop
编辑 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"codebook": {
"command": "codebook-server"
}
}
}
Claude Code (CLI)
claude mcp add codebook -- codebook-server
可用工具
| 工具 | 说明 | 对应能力 |
|---|---|---|
scan_repo |
扫描项目,生成蓝图总览 + Mermaid 依赖图 | 蓝图 + 看懂 |
read_chapter |
查看指定模块的详细卡片 | 看懂 |
diagnose |
自然语言描述问题 → 追踪调用链 → 定位代码 | 定位 |
ask_about |
针对模块进行多轮追问 | 追问 |
运行测试
pytest tests/ -v
项目结构
mcp-server/
├── src/
│ ├── server.py # MCP Server 入口
│ ├── config.py # pydantic-settings 配置
│ ├── tools/ # 4 个核心工具
│ ├── parsers/ # Tree-sitter 代码解析(Phase 1.2)
│ ├── prompts/ # Prompt 模板管理(Phase 1.3)
│ ├── summarizer/ # 模块卡片生成引擎(Phase 1.3)
│ └── diagnoser/ # 问题定位引擎(Phase 1.5)
├── tests/
├── pyproject.toml
└── README.md
环境变量
| 变量 | 默认值 | 说明 |
|---|---|---|
CODEBOOK_LOG_LEVEL |
INFO |
日志级别 |
CODEBOOK_MAX_REPO_SIZE_MB |
100 |
最大仓库大小限制 |
注意: 不需要设置
ANTHROPIC_API_KEY。CodeBook 作为 MCP Server 运行在 Claude Desktop 内部,由宿主 LLM 直接推理,无需额外 API 调用。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
codebook_mcp-0.5.0.tar.gz
(247.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
codebook_mcp-0.5.0-py3-none-any.whl
(142.2 kB
view details)
File details
Details for the file codebook_mcp-0.5.0.tar.gz.
File metadata
- Download URL: codebook_mcp-0.5.0.tar.gz
- Upload date:
- Size: 247.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89b9d5cee16e73769618d68424892c34351e4d0976a2165c730683ea1789bdb6
|
|
| MD5 |
6007f3a973d3c7650184c60ae23ce499
|
|
| BLAKE2b-256 |
1691bb3a0907b869c6c5f7650b0959fc4791bb9bb5515d9a3c441f9389628cb7
|
File details
Details for the file codebook_mcp-0.5.0-py3-none-any.whl.
File metadata
- Download URL: codebook_mcp-0.5.0-py3-none-any.whl
- Upload date:
- Size: 142.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3aeb7a8127ab172f02ab2b79a615493dfd777a243eb0e445f6ee5ee3bbbf1fee
|
|
| MD5 |
52be0d82c3ae39eb66c2ddb6706afe27
|
|
| BLAKE2b-256 |
412c33a6e98f671e8fec82f2c096131ed06d6ca657872020a3cd7baf07048ce6
|