by punkpeye
Connect an MCP Client that only supports local (stdio) servers to a Remote MCP Server.
# Add to your Claude Code skills
git clone https://github.com/punkpeye/mcp-remoteGuides for using mcp servers skills like mcp-remote.
mcp-remote is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by punkpeye. Connect an MCP Client that only supports local (stdio) servers to a Remote MCP Server. It has 1,689 GitHub stars.
mcp-remote's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/punkpeye/mcp-remote" and add it to your Claude Code skills directory (see the Installation section above).
mcp-remote is primarily written in TypeScript. It is open-source under punkpeye on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh mcp-remote against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
mcp-remoteConnect an MCP Client that only supports local (stdio) servers to a Remote MCP Server, with auth support:
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 latest MCP Authorization specification, 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!
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, Codex-Cli 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:
{
// 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
}
},
To keep a credential out of the process arguments — where any other user on the machine can read it from the process list — put the headers in a file instead and pass --header-file. One Name: value per line; # starts a comment.
"args": [
"mcp-remote",
"https://remote.mcp.server/sse",
"--header-file",
"/path/to/headers.txt"
]
# credentials for the example server
Authorization: Bearer my-token
X-Custom-Header: custom-value
A file that cannot be read is an error rather than a warning, so a mistyped path fails immediately instead of sending the request unauthenticated.
To run multiple instances of the same remote server with different configurations (e.g., different Atlassian tenants), use the --resource flag to isolate OAuth sessions:
{
"mcpServers": {
"atlassian_tenant1": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.atlassian.com/v1/sse",
"--resource",
"https://tenant1.atlassian.net/"
]
},
"atlassian_tenant2": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.atlassian.com/v1/sse",
"--resource",
"https://tenant2.atlassian.net/"
]
}
}
}
Each unique combination of server URL, resource, custom headers, and --authorize-param values will maintain separate OAuth sessions and token storage.
The --resource value is sent as the RFC 8707 resource indicator on the authorization, token and
refresh requests alike, so they always agree.
Some authorization servers require parameters of their own on the authorize call. Pass each as
--authorize-param key=value, repeating the flag as needed:
"args": [
"mcp-remote",
"https://remote.mcp.server/mcp",
"--authorize-param",
"access_type=offline",
"--authorize-param",
"prompt=consent"
]
Those two are what Google wants before it will part with a refresh token — it does not recognise the
offline_access scope. Auth0 wants audience=https://your-api to issue a JWT rather than an opaque
token. [email protected] is also common.
These apply to the authorization request only. resource is the exception: RFC 8707 wants the same
value on the token and refresh requests too, and only --resource puts it there. Parameters the flow
derives per request — state, code_challenge, client_id, redirect_uri, response_type — are
refused, because a value that disagrees with the real one surfaces as an opaque server error.
Changing these starts a new sign-in, since a parameter like audience decides which API the token is
for and a token issued for one is not valid for another.
Some authorization servers reject the resource parameter outright — Microsoft Entra ID v2 answers
AADSTS9010010, for example. Pass --disable-resource-parameter to omit it entirely:
{
"mcpServers": {
"entra-example": {
"command": "npx",
"args": [
"mcp-remote",
"https://remote.mcp.server/mcp",
"--disable-resource-parameter"
]
}
}
}
A server says which authorization server to sign in at in its protected-resource metadata (RFC 9728).
--authorization-server <url> signs in somewhere else instead. Everything else stays the same: the
server's metadata is still read for scopes and the resource indicator, and the chosen server's own
metadata is validated as strictly as any other.
mcp-remote does not refuse a server the resource never named, since that is your call. But it does
say so when you use one, and warns when it is not on the host of any server the resource advertises.
Tokens signed in this way are cached separately. --authorization-server cannot be combined with
--token-endpoint, which skips discovery altogether.
RFC 8414 §3.3 has a client reject authorization server metadata whose issuer is not exactly the URL
it was discovered from, and mcp-remote does. That check is what stops one authorization server's
metadata from being passed off as another's.
Entra ID's multi-tenant endpoints (/organizations/v2.0, /common/v2.0) fail that check. Their
discovery document publishes the literal template https://login.microsoftonline.com/{tenantid}/v2.0
as the issuer, so a server that points at one - Microsoft Agent 365, for example - stops at:
Issuer mismatch in authorization server metadata (RFC 8414 §3.3):
expected "https://login.microsoftonline.com/organizations/v2.0",
received "https://login.microsoftonline.com/{tenantid}/v2.0"
The fix that keeps the check is to sign in at your tenant's own endpoint, whose issuer is exactly its
own URL, with --authorization-server:
{
"mcpServers": {
"agent365-calendar": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://agent365.svc.cloud.microsoft/agents/tenants/YOUR_TENANT_ID/servers/mcp_CalendarTools",
"51001",
"--host",
"localhost",
"--callback-path",
"/",
"--static-oauth-client-info",
"{\"client_id\":\"YOUR_ENTRA_CLIENT_ID\"}",
"--authorization-server",
"https://login.microsoftonline.com/YOUR_TENANT_ID/v2.0"
]
}
}
}
contoso.onmicrosoft.com
resolves to the same endpoint, but its metadata names the GUID, so it fails the check.--static-oauth-client-info. Inline, as here, the inner quotes are
escaped because the JSON sits inside a JSON string. The field is client_id, not clientId. A
client secret is better kept out of the config as a ${VAR} placeholder, or in a file passed as
@/absolute/path/client.json (written out in full: most MCP clients start the command without a
shell, so ~ and $HOME are not expanded).http://localhost:51001/ here) must be a redirect URI of that app.HTTPS_PROXY. There mcp-remote fails with getaddrinfo ENOTFOUND until --enable-proxy is added.
Such a sandbox may not let mcp-remote open a browser either: sign in once from a terminal with the
same arguments, and the client picks up the saved tokens.--skip-issuer-metadata-validation turns that one check off instead, for when no endpoint names
itself correctly. It is off by default, and nothing else changes: TLS, PKCE, state, the RFC 9207
iss check on the callback, and the resource and scope handling all still apply.
Prefer --authorization-server where it works, and otherwise only skip the check for a server you
configured yourself, whose authorization server you trust. The check does not choose the
authorization server - protected-resource metadata does, and metadata at any URL that names itself
passes. What it guarantee