No description
Find a file
Glen Maddern 140f30c6f9 0.0.10
2025-03-25 20:05:07 +11:00
src If popups are blocked, the link should now work 2025-03-25 20:04:56 +11:00
.gitignore Ported v0.0.4 from mcp-remote-examples 2025-03-20 11:11:45 +11:00
.prettierignore format 2025-03-24 10:48:46 +00:00
.prettierrc Ported v0.0.4 from mcp-remote-examples 2025-03-20 11:11:45 +11:00
LICENSE Ported v0.0.4 from mcp-remote-examples 2025-03-20 11:11:45 +11:00
package.json 0.0.10 2025-03-25 20:05:07 +11:00
pnpm-lock.yaml Update pnpm-lock.yaml 2025-03-24 14:19:41 +00:00
README.md add a space 2025-03-24 18:25:54 -07:00
tsconfig.json fix types and pass build 2025-03-24 09:49:44 +00:00

mcp-remote

Connect an MCP Client that only supports local (stdio) servers to a Remote MCP Server, with auth support:

Note: this is a working proof-of-concept but should be considered experimental.

Why is this necessary?

So far, the majority of MCP servers in the wild are installed locally, using the stdio transport. This has some benefits: both the client and the server can implicitly trust each other as the user has granted them both permission to run. Adding secrets like API keys can be done using environment variables and never leave your machine. And building on npx and uvx has allowed users to avoid explicit install steps, too.

But there's a reason most software that could be moved to the web did get moved to the web: it's so much easier to find and fix bugs & iterate on new features when you can push updates to all your users with a single deploy.

With the MCP Authorization specification nearing completion, we now have a secure way of sharing our MCP servers with the world without running code on user's laptops. Or at least, you would, if all the popular MCP clients supported it yet. Most are stdio-only, and those that do support HTTP+SSE don't yet support the OAuth flows required.

That's where mcp-remote comes in. As soon as your chosen MCP client supports remote, authorized servers, you can remove it. Until that time, drop in this one liner and dress for the MCP clients you want!

Usage

Claude Desktop

Official Docs

In order to add an MCP server to Claude Desktop you need to edit the configuration file located at:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

If it does not exist yet, you may need to enable it under Settings > Developer.

{
  "mcpServers": {
    "remote-example": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://remote.mcp.server/sse"
      ]
    }
  }
}

Restart Claude Desktop to pick up the changes in the configuration file. Upon restarting, you should see a hammer icon in the bottom right corner of the input box.

Cursor

Official Docs

Add the following configuration to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "remote-example": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://remote.mcp.server/sse"
      ]
    }
  }
}

Windsurf

Official Docs

Add the following configuration to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "remote-example": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://remote.mcp.server/sse"
      ]
    }
  }
}

Building Remote MCP Servers

For instructions on building & deploying remote MCP servers, including acting as a valid OAuth client, see the following resources:

In particular, see:

For more information about testing these servers, see also:

Know of more resources you'd like to share? Please add them to this Readme and send a PR!

Debugging

Check your Node version

Make sure that the version of Node you have installed is 16 or higher. Claude Desktop will use your system version of Node, even if you have a newer version installed elsewhere.

Restart Claude

When modifying claude_desktop_config.json it can helpful to completely restart Claude

VPN Certs

You may run into issues if you are behind a VPN, you can try setting the NODE_EXTRA_CA_CERTS environment variable to point to the CA certificate file. If using claude_desktop_config.json, this might look like:

{
 "mcpServers": {
    "remote-example": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://remote.mcp.server/sse"
      ],
      "env": {
        "NODE_EXTRA_CA_CERTS": "{your CA certificate file path}.pem"
      }
    }
  }
}