PM

punkpeye/mcp-remote

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

1652 stars 313 forks 品質 90 トレンド 40MIT

ローカル(stdio)サーバーのみをサポートするMCPクライアントをリモートMCPサーバーに接続します。

概要

ローカル(stdio)サーバーのみをサポートするMCPクライアントを、認証対応のリモートMCPサーバーに接続します: これまでのところ、実際のMCPサーバーの大半はstdioトランスポートを使ってローカルにインストールされています。これにはいくつかの利点があります。クライアントとサーバーの両方が、ユーザーが両方に実行権限を与えているため、暗黙のうちに信頼し合えます。APIキーのようなシークレットの追加は環境変数を使ってでき、マシンを離れることはありません。また、npxやuvxでビルドすることで、ユーザーは明示的なインストール手順を回避できるようになりました。 しかし、ウェブに移行できたほとんどのソフトウェアがウェブに移行した理由があります。バグを見つけて修正し、新機能の反復を一回のデプロイで全ユーザーにプッシュできる方がずっと簡単だからです。 最新のMCP認証仕様により、ユーザーのノートパソコン上でコードを実行せずに、MCPサーバーを安全に世界と共有できるようになりました。少なくとも、すべての人気MCPクライアントがまだ対応していれば、そうなるでしょう。

概要(AI 翻訳)

ローカル(stdio)サーバーのみをサポートするMCPクライアントを、認証対応のリモートMCPサーバーに接続します:

なぜこれが必要なの?

これまでのところ、ほとんどのMCPサーバーはローカルにインストールされており、stdioトランスポートを使っています。これにはいくつかの利点があります。クライアントとサーバーの両方が、ユーザーが両方に実行権限を与えているため、暗黙のうちに信頼し合えます。APIキーのような秘密の追加は環境変数を使って行え、マシンを離れることはありません。また、npxとuvxを基盤に構築することで、ユーザーは明示的なインストール手順を回避できるようになりました。

しかし、ウェブに移行できるはずのソフトウェアが実際にウェブに移行した理由があります。バグを見つけて修正し、新機能の反復を一回のデプロイで全ユーザーにプッシュできる方がずっと簡単だからです。

最新のMCP認証仕様により、ユーザーのノートパソコン上でコードを実行せずに、MCPサーバーを安全に世界と共有できるようになりました。少なくとも、すべての人気MCPクライアントがまだ対応していれば、そうなるでしょう。ほとんどはstdio専用で、HTTP+SSEをサポートするものも、必要なOAuthフローはまだサポートしていません。

そこでmcp-remoteの登場です。

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

mcp-remote

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

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 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!

Usage

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"
      ]
    }
  }
}

Custom Headers

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 " // 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",
GitHub で README 全文を見る

インストール

npx mcp-remote https://remote.mcp.server/sse
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

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