This file contains the original npm-focused documentation for mcp-remote. For the current npm package, please visit the upstream repository.
All the most popular MCP clients (Claude Desktop, Cursor & Windsurf) use the following config format:
{
"mcpServers": {
"remote-example": {
"command": "npx",
"args": ["mcp-remote", "https://remote.mcp.server/sse"]
}
}
}To bypass authentication, or to emit custom headers on all requests to your remote server, pass --header CLI arguments:
{
"mcpServers": {
"remote-example": {
"command": "npx",
"args": ["mcp-remote", "https://remote.mcp.server/sse", "--header", "Authorization: Bearer ${AUTH_TOKEN}"],
"env": {
"AUTH_TOKEN": "..."
}
}
}
}Note: Cursor and Claude Desktop (Windows) have a bug where spaces inside args aren't escaped when it invokes npx, which ends up mangling these values. You can work around it using:
- If
npxis producing errors, consider adding-yas the first argument to auto-accept the installation of themcp-remotepackage.
"command": "npx",
"args": [
"-y"
"mcp-remote",
"https://remote.mcp.server/sse"
]- To force
npxto always check for an updated version ofmcp-remote, add the@latestflag:
"args": [
"mcp-remote@latest",
"https://remote.mcp.server/sse"
]- Port configuration: Add port number after server URL (default: 3334)
- Host configuration:
--hostflag (default: localhost) - Allow HTTP:
--allow-httpflag - Debug mode:
--debugflag - Transport strategy:
--transportflag (http-first, sse-first, http-only, sse-only) - Static OAuth metadata:
--static-oauth-client-metadataflag - Static OAuth client info:
--static-oauth-client-infoflag
Run the following on the command line (not from an MCP server):
npx -p mcp-remote@latest mcp-remote-client https://remote.mcp.server/sseThis will run through the entire authorization flow and attempt to list the tools & resources at the remote URL.
{ // rest of config... "args": [ "mcp-remote", "https://remote.mcp.server/sse", "--header", "Authorization:${AUTH_HEADER}" // note no spaces around ':' ], "env": { "AUTH_HEADER": "Bearer <auth-token>" // spaces OK in env vars } },