Modes MCP Server
🚀 模式 MCP 服务器
这是一个用于管理 Roo 的自定义操作模式的 MCP 服务器,可对模式配置和管理进行编程控制,为用户提供便捷的模式管理体验。
🚀 快速开始
本服务器提供了对自定义模式的完整管理功能。你可以通过一系列步骤完成安装、配置,并使用其提供的工具对模式进行操作。
✨ 主要特性
- 支持对自定义模式进行完整的增删改查操作。
- 运用 Zod 进行模式验证,确保数据的准确性。
- 可监控文件系统的变更,及时响应配置文件的修改。
- 处理标准 MCP 错误码,便于问题排查。
- 采用原子文件操作,保证数据的一致性。
📦 安装指南
# 克隆仓库
git clone https://github.com/mkc909/modes-mcp-server.git
cd modes-mcp-server
# 安装依赖项
npm install
# 构建项目
npm run build
📚 详细文档
配置步骤
1. 环境变量配置
复制 .env.example 到 .env 并根据需要调整:
cp .env.example .env
可用的环境变量:
MODES_CONFIG_PATH:自定义模式配置文件路径(默认:%APPDATA%/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_custom_modes.json)
2. 自定义模式配置
创建自定义模式的 JSON 配置文件。参考 examples/modes.example.json 的格式:
{
"customModes": [
{
"slug": "example-mode",
"name": "Example Mode",
"roleDefinition": "Example role definition describing the mode's capabilities and responsibilities.",
"groups": [
"read",
["edit", {
"fileRegex": "\\.md$",
"description": "Can edit markdown files only"
}],
"write"
],
"customInstructions": "These are additional instructions for using this mode."
}
]
}
3. MCP 工具配置
在 config/mcp-tools.json 中添加以下内容:
{
"modeManager": {
"class": "FileModeManager",
"args": {
"configPath": "%MODES_CONFIG_PATH%",
"schema": {
"type": "object",
"required": ["slug", "name", "roleDefinition"],
"properties": {
"slug": {"type": "string"},
"name": {"type": "string"},
"roleDefinition": {"type": "string"},
"groups": {
"type": "array",
"items": [
{"type": "string"},
{
"type": "array",
"minLength": 2,
"items": [
{"type": "string"},
{
"type": "object",
"required": ["fileRegex", "description"],
"properties": {
"fileRegex": {"type": "string"},
"description": {"type": "string"}
}
}
]
}
]
},
"customInstructions": {"type": "string", "nullable": true}
}
}
}
}
}
操作模式框架
标准模式
- 默认模式:
default-mode- 显示名称:Default Mode
- 角色定义:提供通用的文件操作功能,适用于多种任务。
- 工具组:基本文件操作 (
read,edit,write)
自定义模式
开发人员可以创建自定义模式以满足特定需求。例如:
{
"slug": "my-custom-mode",
"name": "My Custom Mode",
"roleDefinition": "A custom mode for specialized tasks.",
"groups": [
["custom-task", {
"fileRegex": "\\.custom$",
"description": "Handles files with .custom extension"
}]
],
"customInstructions": "Use this mode only for specific operations."
}
可用工具
基础用法
以下是一些常用的模式操作命令:
创建模式
POST /modes
Content-Type: application/json
{
"mode": {
"slug": "new-mode",
"name": "New Mode",
"roleDefinition": "Description of new mode.",
"groups": ["read", "write"]
}
}
获取所有模式
GET /modes
更新模式
PUT /modes/<slug>
Content-Type: application/json
{
"mode": {
"name": "Updated Mode",
"roleDefinition": "Updated description.",
"groups": ["read", "write"]
}
}
删除模式
DELETE /modes/<slug>
开发指南
- 修改源代码位于
src/目录下。 - 构建项目:
npm run build
- 启动服务器:
npm start
最佳实践
模式选择
- 根据任务选择合适的模式。
- 遵循特定模式的工作流程。
- 使用指定的工具组。
模式转换
- 按照自然转换流程操作。
- 完成当前模式的任务。
- 在模式之间保留上下文。
配置管理
- 验证变更后再保存。
- 保持清晰的角色定义。
- 文档化模式能力。
错误处理
服务器使用标准 MCP 错误码:
InvalidParams:输入参数无效或未找到模式。MethodNotFound:请求的工具未知。InternalError:文件系统错误或其他内部问题。
测试指南
参考 TESTING.md 获取全面的测试用例和验证步骤。
贡献指南
- 叉分仓库。
- 创建功能分支。
- 提交拉取请求。
- 遵循编码标准。
📄 许可证
本项目采用 MIT 许可证,详细信息见 LICENSE。

Duckduckgo MCP Server
已认证
DuckDuckGo搜索MCP服务器,为Claude等LLM提供网页搜索和内容抓取服务
Python
79.5K
4.3分

Figma Context MCP
Framelink Figma MCP Server是一个为AI编程工具(如Cursor)提供Figma设计数据访问的服务器,通过简化Figma API响应,帮助AI更准确地实现设计到代码的一键转换。
TypeScript
70.7K
4.5分

Firecrawl MCP Server
Firecrawl MCP Server是一个集成Firecrawl网页抓取能力的模型上下文协议服务器,提供丰富的网页抓取、搜索和内容提取功能。
TypeScript
138.0K
5分

Edgeone Pages MCP Server
EdgeOne Pages MCP是一个通过MCP协议快速部署HTML内容到EdgeOne Pages并获取公开URL的服务
TypeScript
30.4K
4.8分

Exa Web Search
已认证
Exa MCP Server是一个为AI助手(如Claude)提供网络搜索功能的服务器,通过Exa AI搜索API实现实时、安全的网络信息获取。
TypeScript
52.7K
5分

Context7
Context7 MCP是一个为AI编程助手提供实时、版本特定文档和代码示例的服务,通过Model Context Protocol直接集成到提示中,解决LLM使用过时信息的问题。
TypeScript
97.4K
4.7分

Baidu Map
已认证
百度地图MCP Server是国内首个兼容MCP协议的地图服务,提供地理编码、路线规划等10个标准化API接口,支持Python和Typescript快速接入,赋能智能体实现地图相关功能。
Python
47.9K
4.5分

Minimax MCP Server
MiniMax Model Context Protocol (MCP) 是一个官方服务器,支持与强大的文本转语音、视频/图像生成API交互,适用于多种客户端工具如Claude Desktop、Cursor等。
Python
59.9K
4.8分

