RouterMCP
Getting Started

Your First Project

A step-by-step tutorial to set up your first RouterMCP project with multiple MCP servers.

Your First Project

In this tutorial, you'll create a RouterMCP configuration that aggregates three MCP servers:

  1. Filesystem - Access local files
  2. Fetch - Make HTTP requests
  3. Memory - Store key-value data

By the end, your AI assistant will be able to use tools from all three servers through a single connection.

Prerequisites

  • Node.js 18+ installed
  • An MCP-compatible client (Claude Desktop, VS Code with Copilot, etc.)

Install RouterMCP

npm install -g routermcp

Verify the installation:

routermcp --version

Create a Project Directory

mkdir my-mcp-project
cd my-mcp-project

Initialize Configuration

Run the config command to create a starter configuration:

routermcp config

This creates routermcp.jsonc:

routermcp.jsonc

Configure Your Servers

Edit routermcp.jsonc with your servers:

routermcp.jsonc
{
  // HTTP server settings (for HTTP mode)
  "httpServer": {
    "port": 5151,
    "host": "127.0.0.1"
  },

  // Your MCP servers
  "mcpServers": {
    // Filesystem access
    "filesystem": {
      "transport": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "./"],
      "filter": {
        "tools": {
          "include": ["read_file", "list_directory", "search_files"]
        }
      }
    },

    // HTTP fetching
    "fetch": {
      "transport": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-fetch"]
    },

    // In-memory storage
    "memory": {
      "transport": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-memory"]
    }
  }
}

The filter on filesystem restricts it to read-only operations. Remove it if you want full access.

Test Your Configuration

Start RouterMCP to verify everything works:

routermcp --http

You should see output like:

RouterMCP Gateway v1.x.x
Connecting to 3 upstream servers...
  ✓ filesystem (stdio)
  ✓ fetch (stdio)
  ✓ memory (stdio)
HTTP server listening on http://127.0.0.1:5151

Press Ctrl+C to stop.

Connect Claude Desktop

Add RouterMCP to your Claude Desktop configuration.

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

claude_desktop_config.json
{
  "mcpServers": {
    "my-project": {
      "command": "routermcp",
      "args": [],
      "cwd": "/path/to/my-mcp-project"
    }
  }
}

Restart Claude Desktop to apply changes.

Verify the Connection

In Claude, you should now see your aggregated tools. Try asking:

"List the files in the current directory"

Claude will use the filesystem.list_directory tool through RouterMCP.

You can also try:

"Fetch the contents of https://example.com"

"Store the value 'hello' with key 'greeting' in memory"

Understanding Tool Names

Notice that tools are prefixed with the server name:

ServerOriginal ToolRouterMCP Tool
filesystemread_filefilesystem.read_file
fetchfetchfetch.fetch
memorystorememory.store

This namespacing prevents conflicts if multiple servers have tools with the same name.

Next Steps

Now that you have a working setup:

On this page