Custom Modes (Roo Code) MCP server

Enables custom behavioral mode management for defining, loading, and applying tailored AI behaviors through configuration files in Roo Code
Back to servers
Provider
ccc0168
Release date
Jan 27, 2025
Language
TypeScript
Stats
24 stars

This MCP server provides programmatic control over custom operational modes, allowing you to create, manage, and configure different modes with specific permissions and functionality.

Installation

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

Configuration

Environment Variables

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)

Custom Modes Configuration

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."
    }
  ]
}

MCP Settings

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": []
    }
  }
}

Operational Modes Framework

The server manages two categories of operational modes:

Core System Modes

  • Planning Mode 🎯 - Strategic planning specialist
  • Analytics Mode 📊 - Data analysis expert
  • Research Mode 🔍 - System research specialist
  • Implementation Mode ⚙️ - Operations implementation expert
  • Troubleshooting Mode 🔧 - System resolution specialist
  • Quality Control Mode ✅ - Quality assurance expert
  • Integration Mode 🔄 - Systems integration specialist
  • Documentation Mode 📝 - Knowledge management specialist
  • Session Management Mode ⚡ - Session management specialist

Specialized Modes

  • Trade Ops Manager - For systematic trading, risk management, and market analysis

Using the MCP Tools

The following tools are available to manage operational modes:

Listing All Modes

Use the list_modes tool to see all currently configured custom modes.

Getting Mode Details

To view details of a specific mode:

get_mode
Parameters:
- slug: "example-mode"

Creating a New 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"

Updating a Mode

To update an existing mode:

update_mode
Parameters:
- slug: "existing-mode"
- updates: {
    "name": "Updated Mode Name",
    "groups": ["read", "edit", "command"]
  }

Deleting a Mode

To remove a custom mode:

delete_mode
Parameters:
- slug: "mode-to-delete"

Validating a Mode Configuration

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"]
  }

Mode Configuration Schema

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
}

Best Practices

Mode Selection

  • Choose the appropriate mode for each task
  • Follow mode-specific workflows
  • Use only the designated tool groups for each mode

Mode Transitions

  • Follow the natural transition flow between modes
  • Complete current mode tasks before transitioning
  • Preserve context when moving between modes

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later