Local Relay
Connect local clients like Claude Desktop to your hosted MCP Servers.
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.
-
Clone the Repository: Open your terminal and clone the
local-relay
repository: -
Install Dependencies: Install the necessary Node.js packages:
-
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:
- Replace
your_api_key_here
with a valid API key. You can generate one here.
- Create a file named
-
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:
- Replace
your_target_server_id_here
with the server ID found on the servers page.
- Create a file named
-
-
Build the Project: Compile the TypeScript code into JavaScript:
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.
-
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
- macOS:
-
Edit
claude_desktop_config.json
:- Add an entry for the
local-relay
within themcpServers
object. IfmcpServers
doesn’t exist, create it. Give your relay server a name (e.g.,my_remote_server
). - The
command
should benode
. - The
args
array should contain the full, absolute path to thedist/index.js
file within your cloned and builtlocal-relay
directory.
- 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 theargs
array:
- Add an entry for the
-
Save and Restart Claude Desktop:
- Save the changes to
claude_desktop_config.json
. - Completely quit and restart the Claude Desktop application.
- Save the changes to
-
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
’smcpconfig.json
file listed under the server name you chose (e.g.,my_remote_server
).
- After restarting, look for the hammer icon (
-
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
inclaude_desktop_config.json
. - Ensure the
local-relay
project was built successfully (npm run build
completed without errors). - Make sure the
.env
andmcpconfig.json
files exist and are correctly configured inside yourlocal-relay
directory. - Check Claude’s logs for errors (see this guide for log locations).
- Double-check the absolute path to
Local Relay simplifies connecting local stdio
-based clients to your centralized MCP infrastructure by running the proxy directly from its source code.