Roo操作模式
STDIO管理自定义运行模式的MCP服务器
管理自定义运行模式的MCP服务器
An MCP server for managing Roo's custom operational modes, providing programmatic control over mode configuration and management.
# Clone the repository git clone https://github.com/mkc909/modes-mcp-server.git cd modes-mcp-server # Install dependencies npm install # Build the project npm run build
Copy .env.example
to .env
and adjust as needed:
cp .env.example .env
Available environment variables:
MODES_CONFIG_PATH
: Path to custom modes configuration file (default: %APPDATA%/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_custom_modes.json
)Create a JSON file for your custom modes configuration. See examples/modes.example.json
for the format:
{ "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" }], "command", "mcp" ], "customInstructions": "Example custom instructions for the mode." } ] }
Add the server configuration to your MCP settings file (typically at %APPDATA%/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json
). See examples/mcp-settings.example.json
for the format:
{ "mcpServers": { "modes": { "command": "node", "args": ["/path/to/modes-mcp-server/build/index.js"], "env": { "MODES_CONFIG_PATH": "/path/to/custom/modes.json" }, "disabled": false, "alwaysAllow": [] } } }
The server manages a comprehensive set of operational modes:
Planning Mode 🎯
Analytics Mode 📊
Research Mode 🔍
Implementation Mode ⚙️
Troubleshooting Mode 🔧
Quality Control Mode ✅
Integration Mode 🔄
Documentation Mode 📝
Session Management Mode ⚡
graph TD A[Planning] --> B[Research] B --> C[Implementation] C --> D[Integration] D --> E[Quality Control] E --> F[Analytics] F --> G[Troubleshooting] G --> H[Documentation] H --> A
Lists all custom modes currently configured.
Get details of a specific mode by its slug.
Parameters:
slug
: The unique identifier of the modeCreate a new custom mode.
Parameters:
slug
: Unique identifier (lowercase letters, numbers, and hyphens)name
: Display name for the moderoleDefinition
: Detailed description of the mode's role and capabilitiesgroups
: Array of allowed tool groupscustomInstructions
: (optional) Additional instructions for the modeUpdate an existing custom mode.
Parameters:
slug
: The unique identifier of the mode to updateupdates
: Object containing the fields to update (name, roleDefinition, groups, customInstructions)Delete a custom mode.
Parameters:
slug
: The unique identifier of the mode to deleteValidate a mode configuration without saving it.
Parameters:
mode
: Complete mode configuration object to validateinterface CustomMode { slug: string; // Lowercase letters, numbers, and hyphens only name: string; // Display name roleDefinition: string; // Detailed description groups: (string | [string, { fileRegex: string, description: string }])[]; customInstructions?: string; // Optional additional instructions }
src/
npm run build
npm start
Mode Selection
Mode Transitions
Configuration Management
The server uses standard MCP error codes:
InvalidParams
: Invalid input parameters or mode not foundMethodNotFound
: Unknown tool requestedInternalError
: File system errors or other internal issuesSee TESTING.md for comprehensive test cases and validation procedures.
MIT License - see LICENSE for details