This MCP server provides programmatic control over custom operational modes, allowing you to create, manage, and configure different modes with specific permissions and functionality.
To install the Modes MCP Server, follow these steps:
# 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 the example environment file to create your own configuration:
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. Example 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
):
{
"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 two categories of operational modes:
The following tools are available to manage operational modes:
Use the list_modes
tool to see all currently configured custom modes.
To view details of a specific mode:
get_mode
Parameters:
- slug: "example-mode"
To create a custom mode:
create_mode
Parameters:
- slug: "new-mode"
- name: "New Custom Mode"
- roleDefinition: "This mode handles specific tasks for..."
- groups: ["read", "command", "mcp"]
- customInstructions: "Additional instructions for this mode"
To update an existing mode:
update_mode
Parameters:
- slug: "existing-mode"
- updates: {
"name": "Updated Mode Name",
"groups": ["read", "edit", "command"]
}
To remove a custom mode:
delete_mode
Parameters:
- slug: "mode-to-delete"
To check if a mode configuration is valid without saving it:
validate_mode
Parameters:
- mode: {
"slug": "test-mode",
"name": "Test Mode",
"roleDefinition": "Testing mode configuration",
"groups": ["read", "command"]
}
Each custom mode must follow this structure:
interface 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
}
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.