The MCP Kit Local Relay is a command-line tool that acts as a bridge between your local development environment or local applications (like Claude Desktop) and a specific MCP Server hosted remotely (e.g., using the MCP Kit server project).

It allows applications that communicate using standard input/output (stdio), such as Claude Desktop’s external tools feature, to interact with a chosen hosted MCP Server as if it were running locally. You do not need Claude Pro to use MCP Kit tools with local relay.

Key Functionality:

  • Proxy: Relays requests for tool execution and resource reading to a configured remote MCP Server.
  • Local Presence: Presents the tools and resources of the single configured remote server to the local client.
  • Stdio Communication: Listens for and responds to MCP commands over stdio when executed by a client.

Setup

To use the Local Relay, you need to clone its repository and build it locally. Ensure you have Node.js and git installed.

  1. Clone the Repository: Open your terminal and clone the local-relay repository:

    git clone <repository_url> # Replace with the actual repository URL
    cd local-relay # Or navigate to the local-relay directory
    
  2. Install Dependencies: Install the necessary Node.js packages:

    npm install
    
  3. Configure: Create the required configuration files within the local-relay directory:

    • .env File:

      • Create a file named .env.
      • It must contain your MCP Kit API key:
        MCPKIT_API_KEY=your_api_key_here
        
      • Replace your_api_key_here with a valid API key. You can generate one here.
    • mcpconfig.json File:

      • Create a file named mcpconfig.json.
      • It must specify the unique ID of the single hosted MCP Server you want the relay to connect to:
        {
          "targetServerId": "your_target_server_id_here"
        }
        
      • Replace your_target_server_id_here with the server ID found on the servers page.
  4. Build the Project: Compile the TypeScript code into JavaScript:

    npm run build
    

    This creates a dist directory containing the executable file (dist/index.js).

Claude Desktop Integration

To use the Local Relay with Claude Desktop, you need to edit Claude’s configuration file to tell it how to run the relay script.

  1. Locate Claude Desktop Configuration:

    • Open the Claude Desktop application.
    • From the application menu (usually “Claude” on macOS or “File” on Windows), select “Settings…”.
    • In the Settings window, navigate to the “Developer” section.
    • Click “Edit Config”. This will open the configuration file (claude_desktop_config.json) in your default text editor and reveal its location:
      • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
      • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Edit claude_desktop_config.json:

    • Add an entry for the local-relay within the mcpServers object. If mcpServers doesn’t exist, create it. Give your relay server a name (e.g., my_remote_server).
    • The command should be node.
    • The args array should contain the full, absolute path to the dist/index.js file within your cloned and built local-relay directory.
    {
      "mcpServers": {
        "my_remote_server": {
          // Choose a name for this server connection
          "command": "node",
          "args": [
            // Replace this with the *absolute* path to your built index.js
            "/Users/yourname/projects/local-relay/dist/index.js"
          ]
        }
        // You might have other servers configured here
      }
    }
    
    • Replace the example path /Users/yourname/projects/local-relay/dist/index.js with the actual absolute path on your system.
    • Stack Size (If Needed): If you previously encountered Maximum call stack size exceeded errors, add the --stack-size=32768 argument before the script path in the args array:
    {
      "mcpServers": {
        "my_remote_server": {
          "command": "node",
          "args": [
            "--stack-size=32768", // Add this argument
            // Replace with the *absolute* path to your built index.js
            "/Users/yourname/projects/local-relay/dist/index.js"
          ]
        }
      }
    }
    
  3. Save and Restart Claude Desktop:

    • Save the changes to claude_desktop_config.json.
    • Completely quit and restart the Claude Desktop application.
  4. Verify Connection:

    • After restarting, look for the hammer icon () in the chat input area.
    • Click the hammer icon. You should see the tools provided by the remote MCP Server you configured in the local-relay’s mcpconfig.json file listed under the server name you chose (e.g., my_remote_server).
  5. Interact: You can now interact with the tools and resources of the configured remote MCP Server directly within Claude Desktop.

  • Troubleshooting: If the hammer icon doesn’t appear or the tools aren’t listed:
    • Double-check the absolute path to dist/index.js in claude_desktop_config.json.
    • Ensure the local-relay project was built successfully (npm run build completed without errors).
    • Make sure the .env and mcpconfig.json files exist and are correctly configured inside your local-relay directory.
    • Check Claude’s logs for errors (see this guide for log locations).

Local Relay simplifies connecting local stdio-based clients to your centralized MCP infrastructure by running the proxy directly from its source code.