内容
# modelbound-mcp
> 本地优先的MCP服务器,用于代理技能。在Cursor、Claude、Kiro、Windsurf、VS Code和Amazon Q之间验证、检查、差异比较和转换代理技能文件 - 无需账号。可选的云同步功能与 [ModelBound](https://modelbound.co) 配合使用。
[](https://www.npmjs.com/package/modelbound-mcp)
[](LICENSE)
## 为什么选择ModelBound?
AI工具层出不穷。你今天可能使用Cursor,明天可能会切换到Claude Code,后天可能会尝试Kiro - 但你的技能、规则和上下文不应该被锁定在其中任何一个工具中。ModelBound为你提供了一个单一的地方来存储和管理你的代理技能,这样你就可以在不同工具之间自由切换,而不必每次都重新构建你的设置。只需编写一次技能,即可在多处同步,充分利用你已经付费的每个AI订阅。
## 功能
`modelbound-mcp`是一个小型 [Model Context Protocol](https://modelcontextprotocol.io) 服务器,你可以在本地通过stdio运行。它通过 **点表示法命名** 向你的IDE/代理公开工具,以实现可导航的发现(按照 [Smithery质量指南](https://smithery.ai/docs/quality)):
**本地(无需API密钥,无需网络):**
- `ide.detectLayout` — 检测仓库中使用的IDE约定
- `skills.listLocal`、`skills.readLocal`、`skills.writeLocal`
- `skills.lint` — 检查前置信息、token计数、损坏链接、TODO扫描
- `skills.validateFormat` — agentskills.io合规性
- `skills.convert` — 在IDE格式之间转换(例如Cursor → Claude)
- `skills.diff` — 比较本地技能与其云对应项
**云(使用`MODELBOUND_API_KEY`):**
- `cloud.pullSkill`、`cloud.pushSkill`、`cloud.search`
- `cloud.listSkills` — 现在接受`ai_type`和`source_platform`过滤器;每行包括`ai_type`、`source_platform`、`source_path`和`repo`
- `cloud.resourceTree` — 返回团队的完整层次结构,按平台 → 顶级目录(`.claude/skills`、`.cursor/rules`、`.kiro/steering`等) → 文件分组。在加载前使用此功能与`cloud.listSkills`配对,以便编排器映射上下文。
- `cloud.installMarketplaceSkill`
- `optimization.health`
### 资源层次结构
处理多个AI平台的编排器可以调用`cloud.resourceTree`一次,以获取完整的可用技能、规则、钩子、导向文件和系统提示的映射 - 按照每个平台在磁盘上期望的组织方式。使用此功能与`cloud.listSkills`上的新`ai_type`/`source_platform`过滤器配对,以仅加载所需的部分。参见 [`examples/resource-tree.ts`](./examples/resource-tree.ts)。
云工具是到`mcp.modelbound.co`的薄JSON-RPC代理。所有业务逻辑都保留在服务器端;此仓库永远不会触及你的数据或机密。
> **从0.1.x迁移** — 旧的蛇形命名(`detect_ide_layout`、`pull_skill`等)在0.2.0中被删除。托管的ModelBound MCP服务器为了向后兼容,仍然接受两种形式。
## 安装
```bash
npx modelbound-mcp
```
或全局安装:
```bash
npm i -g modelbound-mcp
```
## 作为MCP服务器使用
### Cursor(`.cursor/mcp.json`)
```json
{
"mcpServers": {
"modelbound": {
"command": "npx",
"args": ["-y", "modelbound-mcp"],
"env": { "MODELBOUND_API_KEY": "mb_live_..." }
}
}
}
```
`MODELBOUND_API_KEY`是可选的。没有它,本地工具仍然有效。
有关Claude Desktop、Kiro、Windsurf和VS Code配置,请参见 [`examples/`](./examples)。
## 作为CLI使用
```bash
modelbound-mcp detect # 检测哪些IDE布局存在?
modelbound-mcp ls # 列出每个技能文件
modelbound-mcp lint .cursor/rules/ # 检查目录
modelbound-mcp validate ./SKILL.md # agentskills.io合规性
modelbound-mcp convert --from cursor --to claude ./rule.mdc > out.md
```
## 贡献
我们需要帮助。具体来说:
- **新的IDE适配器** — Zed、Aider、Continue、JetBrains AI、Cline。参见 [CONTRIBUTING.md](CONTRIBUTING.md),了解约50行的配方。
- **检查规则** — token估计准确性、死链接检测、特定格式的陷阱。
- **格式转换器** — 适配器对之间的保真度改进。
浏览 [good first issues](https://github.com/ModelBound/modelbound-mcp-server/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) 和 [roadmap](ROADMAP.md)。
## 相关项目
| 项目 | 描述 |
| --- | --- |
| [ModelBound CLI](https://github.com/ModelBound/modelbound-cli) · [npm](https://www.npmjs.com/package/modelbound) | 用于token优化、技能管道和版本管理的终端 + CI |
| [Cursor Extension](https://github.com/ModelBound/modelbound-cursor-extension) · [Marketplace](https://marketplace.visualstudio.com/items?itemName=ModelBound.modelbound-cursor-extension) | 用于规则同步和MCP桥接的VS Code/Cursor扩展 |
| [Cursor Plugin](https://github.com/ModelBound/cursor-plugin) | 用于管道、信任与安全和版本的Cursor斜杠命令 |
| [Claude Code Plugin](https://github.com/ModelBound/modelbound-claude-code-plugin) | 用于管道、钩子和技能同步的Claude Code插件 |
| [Dev Packs](https://github.com/ModelBound/dev-packs) | 面向工程团队的开源AI上下文包 |
也在 [Smithery](https://smithery.ai)(通过 `npx modelbound-mcp` 使用stdio)和 [MCP Registry](https://github.com/ModelBound/modelbound-mcp-server/blob/main/server.json) 上。安装中心: [modelbound.co/connect](https://modelbound.co/connect)
## License
MIT © ModelBound