菩提MCP
人工智能代理的综合决策框架。通过精心策划的知识获得启蒙。
](https://www.npmjs.com/package/bodhi-mcp)  
菩提是什么?
Bodhi是一个MCP(模型上下文协议)服务器,它提供 预合成知识 人工智能代理无法自行推导——决策框架需要2个以上的来源和人类的判断。
与原始文档不同,Bodhi提供 提炼的智慧:从多个权威来源综合的决策指南、常见错误和可操作的清单。
快速开始
MCP兼容客户端(克劳德桌面、光标等)
添加到您的MCP客户端配置中(例如。, claude_desktop_config.json):
{
"mcpServers": {
"bodhi": {
"command": "npx",
"args": ["bodhi-mcp"]
}
}
}或者使用自定义知识路径:
{
"mcpServers": {
"bodhi": {
"command": "npx",
"args": ["bodhi-mcp", "--knowledge-path", "/path/to/your/knowledge-base"]
}
}
}本地开发
# Clone and install
git clone https://github.com/5h1vmani/bodhi-mcp.git
cd bodhi-mcp
npm install
# Build
npm run build
# Run with your knowledge base
npm start -- --knowledge-path /path/to/nucleus可用工具
所有工具都使用 bodhi_ 前缀,返回markdown和结构化JSON(response_format: "json" | "markdown"),并包括 outputSchema + annotations.
bodhi_route(task)
为给定任务找到最佳剧本。
使用INDEX.md路由表将任务与相关剧本相匹配。返回最相关的剧本,包括置信度得分和备选方案。
Input: { "task": "pitch deck design for investors" }
Output: {
"playbook": "domains/marketing/pitch-deck-strategy.md",
"confidence": 0.85,
"title": "Pitch Deck Strategy",
"domain": "marketing",
"tldr": "Stage-specific structure, investor psychology...",
"alternatives": [...]
}bodhi_search(query, domain?, limit?)
在所有剧本中进行全文搜索。
用于更广泛的查询 bodhi_route() 找不到匹配项,或探索相关主题。
Input: { "query": "UPI payment", "domain": "ux" }
Output: [
{ "path": "domains/ux/india-checkout-patterns.md", "title": "India Checkout Patterns", "score": 12.5, ... },
...
]bodhi_list(domain?, complexity?, limit?)
列出所有可用的带有元数据的剧本。
用于探索可用的知识或按领域/复杂性过滤。
Input: { "domain": "security", "complexity": "advanced" }
Output: [
{ "path": "domains/security/serverless-aws-security.md", "title": "Serverless AWS Security", ... },
...
]bodhi_read(path, section?)
阅读特定剧本的完整内容。
使用后 bodhi_route() 或 bodhi_search() 获取完整的剧本内容。
Input: { "path": "domains/ux/gamification.md", "section": "Decision Guide" }
Output: "## Decision Guide\n\n| Scenario | Approach | Why |..."bodhi_summary()
获取知识库的摘要。
返回总剧本、域和复杂性分布。
bodhi_diagnose()
健康检查和调试信息。
用于解决安装问题或验证知识库是否正确加载。
Output: {
"status": "healthy",
"version": "0.3.0",
"playbooksCount": 82,
"routesCount": 246,
"domainsFound": ["ux", "marketing", "security", ...],
"issues": [],
"recommendations": []
}领域
菩提将知识组织到各个领域:
| 域 | 主题 |
|---|---|
| 用户体验 | 设计系统、表单、移动、游戏化、结账用户体验、可访问性 |
| 营销 | GTM战略、宣传片、销售、内容、电子邮件、品牌标识 |
| 安全 | 印度合规(DPDP)、无服务器安全、CORS/CSP、OWASP |
| 后端 | 支付、电子邮件传递、无服务器成本、B2B2C架构 |
| 前端 | Next.js、PDF生成、服务器组件 |
| 开发运维 | IaC最佳实践、验证清单 |
| 人工智能发展 | 代理工作流程、MCP服务器设计、模型选择、成本优化 |
| 建筑 | 决策记录、会话切换 |
| 交流 | 基于文本的融洽关系,心理学原理 |
| 文档 | AI优化文档、API文档 |
MCP规范合规性(v0.3.0)
| 功能 | 状态 |
|---|---|
服务前缀工具名称(bodhi_*) | ✅ |
outputSchema 在所有工具上✅ | |
工具注释(readOnlyHint, idempotentHint) | ✅ |
response_format 参数(json / markdown) | ✅ |
structuredContent + content 在回复中 | ✅ |
原始资源(bodhi:// URI) | ✅ |
listChanged 能力 | ✅ |
| TTL+mtime无效的缓存 | ✅ |
| 路径遍历预防 | ✅ |
| 来源元数据(置信度、状态、陈旧性) | ✅ |
创建自己的知识库
Bodhi使用遵循Nucleus格式的任何知识库:
knowledge/
├── INDEX.md # Task routing table
├── domains/
│ ├── ux/
│ │ ├── _index.md # Domain index
│ │ ├── gamification.md
│ │ └── ...
│ ├── marketing/
│ │ └── ...
│ └── ...
└── meta/
└── contributing.md # Contribution guidelines剧本格式
每个剧本都遵循一种标准格式:
---
domain: ux
topic: gamification
tags: [engagement, retention, psychology]
complexity: intermediate
last_updated: 2025-01-15
confidence: 0.85
status: validated
review_by: 2025-07-01
---
# Gamification
> One-line value proposition.
## TL;DR
- **Key insight 1** — supporting detail
- **Key insight 2** — supporting detail
## Decision Guide
| Scenario | Approach | Why |
|----------|----------|-----|
| Specific situation | Concrete recommendation | Reasoning |
## Common Mistakes
| Mistake | Fix |
|---------|-----|
| Real failure | Specific solution |
## Checklist
- [ ] Verification item 1
- [ ] Verification item 2INDEX.md路由表
路由表将任务映射到剧本:
## Task Routing
| Task | Read This |
|------|-----------|
| Gamification | `domains/ux/gamification.md` |
| Pitch deck design | `domains/marketing/pitch-deck-strategy.md` |环境变量
| 变量 | 描述 | 默认值 |
|---|---|---|
BODHI_KNOWLEDGE_PATH | 通往知识库的道路 | ./knowledge |
BODHI_LOG_LEVEL | 日志记录级别: debug, info, warn, error, silent | info |
BODHI_CACHE_TTL_MS | 缓存生存时间(毫秒) | 300000 (5分钟) |
发展
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Lint
npm run lint
# Type check
npm run typecheck承诺公约
此项目使用 常规承诺提交消息通过commitlist进行验证。
:
# Examples:
feat: add new search filter option
fix: resolve routing table parsing error
docs: update installation instructions
chore: upgrade dependencies类型: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
许可证
麻省理工学院
贡献
- 克隆该仓库
- 创建功能分支(
git checkout -b feature/amazing-feature) - 提交您的更改(
git commit -m 'feat: add amazing feature') - 推到分支(
git push origin feature/amazing-feature) - 打开拉取请求
______________________________________________________________________
内置于❤️ 通过 菩提团队 对于寻求启示的人工智能代理。
