Remote-MCP
リモートMCP: リモートモデルコンテキストプロトコル
リモート MCP 通信用の型安全で双方向のシンプルなソリューション。モデル コンテキストのリモート アクセスと集中管理を可能にします。
建築
%%{init: {"flowchart": {"htmlLabels": false}} }%%
graph TD
%% Modern, Bright Color Styling with white text
classDef client fill:#22c55e,stroke:#059669,stroke-width:2px,color:#ffffff
classDef gateway fill:#06b6d4,stroke:#0891b2,stroke-width:2px,color:#ffffff
classDef backend fill:#f97316,stroke:#ea580c,stroke-width:2px,color:#ffffff
classDef resource fill:#8b5cf6,stroke:#7c3aed,stroke-width:2px,color:#ffffff
classDef server fill:#06b6d4,stroke:#0891b2,stroke-width:2px,color:#ffffff
linkStyle default stroke:#64748b,stroke-width:1.5px,stroke-dasharray: 5 5
%% Current MCP Setup (Multiple Local Servers)
subgraph Current["Current Setup (Local)"]
direction LR
subgraph ClientGroup["Client"]
A[Client]:::client
end
subgraph Servers["Local MCP Servers"]
direction TB
B1["Local MCP Server (DB)"]:::server -->|"DB Access"| C1[DB]:::resource
B2["Local MCP Server (API 1)"]:::server -->|"API Access"| C2["Web API 1"]:::resource
B3["Local MCP Server (API 2)"]:::server -->|"API Access"| C3["Web API 2"]:::resource
end
A -->|"MCP Protocol"| B1
A -->|"MCP Protocol"| B2
A -->|"MCP Protocol"| B3
end
%% Vertical separator
Current --> Proposed
%% Proposed MCP Architecture (Decoupled)
subgraph Proposed["Proposed Architecture (Remote)"]
direction LR
D[Client/Host]:::client -->|"MCP Protocol"| E["Local MCP Server (@remote-mcp/client)"]:::server
E <-->|"tRPC(HTTP)"| F["Remote MCP Server (@remote-mcp/server)"]:::backend
%% Separated Resources
F -->|"DB Access"| G1[DB]:::resource
F -->|"API Access"| G2["Web API 1"]:::resource
F -->|"API Access"| G3["Web API 2"]:::resource
endRelated MCP server: MCPKit
私がこれを作った理由(今)
はい、公式のMCPロードマップには2025年第1四半期にリモートMCPサポートが含まれていることは承知しています。しかし、リモートアクセスの必要性は私にとって、そしておそらく多くの人にとって差し迫ったものでした。このライブラリは、そのギャップを埋めるために作成されました。将来の公式実装を待つことなく、ローカルMCPクライアントからリモートMCPサーバーに今すぐ接続する方法を提供します。
注:これを複雑すぎるものにしたくはありません。今のところはこの方法でうまくいっています。
はじめる
注: このプロジェクトは現在開発中であり、実験段階です。変更や潜在的な問題が発生する可能性があります。
クライアントの使用状況
公開パッケージを使用する
MCP クライアント設定に次のコードを入力するだけです。ここでは、例として Claude を使用しています。
{
"mcpServers": {
"remote-mcp": {
"command": "npx",
"args": ["-y", "@remote-mcp/client"],
"env": {
"REMOTE_MCP_URL": "http://localhost:9512",
"HTTP_HEADER_Authorization": "Bearer <token>"
}
}
}
}独自のローカル MCP サーバーをコーディングする
インストール要件:
$ npm install @remote-mcp/client @trpc/client@next zod次に、次のような独自のコードを記述します。
import { RemoteMCPClient } from "@remote-mcp/client";
const client = new RemoteMCPClient({
remoteUrl: "http://localhost:9512",
onError: (method, error) => console.error(`Error in ${method}:`, error)
});
void client.start();サーバーの使用(リモート MCP 実装)
いくつかの例はexamplesディレクトリで参照できます。
独自のリモート MCP サーバーをコーディングする
npm install @remote-mcp/server実行すると、次のようにして独自のリモート MCP サーバーを作成できます。
import { MCPRouter, LogLevel } from "@remote-mcp/server";
import { createHTTPServer } from '@trpc/server/adapters/standalone';
import { z } from "zod";
// Create router instance
const mcpRouter = new MCPRouter({
logLevel: LogLevel.DEBUG,
name: "example-server",
version: "1.0.0",
capabilities: {
logging: {},
},
});
// Add example tool
mcpRouter.addTool(
"calculator",
{
description:
"Perform basic calculations. Add, subtract, multiply, divide. Invoke this every time you need to perform a calculation.",
schema: z.object({
operation: z.enum(["add", "subtract", "multiply", "divide"]),
a: z.string(),
b: z.string(),
}),
},
async (args) => {
const a = Number(args.a);
const b = Number(args.b);
let result: number;
switch (args.operation) {
case "add":
result = Number(a) + b;
break;
case "subtract":
result = a - b;
break;
case "multiply":
result = a * b;
break;
case "divide":
if (b === 0) throw new Error("Division by zero");
result = a / b;
break;
}
return {
content: [{ type: "text", text: `${result}` }],
};
},
);
const appRouter = mcpRouter.createTRPCRouter();
void createHTTPServer({
router: appRouter,
createContext: () => ({}),
}).listen(Number(process.env.PORT || 9512));すると、MCP クライアントで次のように表示されます。
パッケージ
このリポジトリには次のものが含まれます。
@remote-mcp/client: ローカル MCP サーバーとして機能し、リモート実装に接続するクライアント ライブラリ。@remote-mcp/server: リモートからアクセス可能な MCP サービスを作成するためのサーバー ライブラリ (リモート実装として使用)。
ロードマップ
コア機能
[x] 基本的な型安全なクライアント/サーバー通信
[x] 基本的なMCPコマンドのサポート
[x] 基本的なMCPツールのサポート
[x] 基本的なMCPプロンプトのサポート
[ ] クラッシュセーフハンドリング(WIP、最優先事項)
[ ] 完全なイベントサブスクリプションシステム
[ ] リソース変更通知
[ ] ツール/プロンプトリストの変更通知
[ ] HTTPヘッダーのサポート
[x] カスタムヘッダー
[ ] 認証ミドルウェア
[ ] 基本的なエラー処理の改善
[ ] 基本的なミドルウェアのサポート
フレームワークのサポート
[ ] Nest.js 統合 (
@remote-mcp/nestjs)
高度な機能
[ ] 双方向通信
[ ] サーバーからクライアントへのリクエスト
[ ] サーバー/クライアント間のリソース共有
[ ] 基本的な監視とログ記録
貢献する
貢献を歓迎します。詳細はCONTRIBUTING.mdをご覧ください。
免責事項
このライブラリは、既存の MCP コンセプトに基づいて構築された補完的な拡張機能であり、公式の MCP 仕様の一部ではありません。
ライセンス
このプロジェクトはMITライセンスの下で提供されています。詳細はLICENSEファイルをご覧ください。
参考文献
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceEnables type-safe, bidirectional communication with Model Context Protocol services, allowing centralized management of model contexts over HTTP.Last updated208MIT
- AlicenseDqualityCmaintenanceA simple TypeScript library for creating Model Context Protocol (MCP) servers with features like type safety, parameter validation, and a minimal code API.Last updated142MIT
- Flicense-qualityDmaintenanceA Python-based implementation of the Model Context Protocol that enables communication between a model context management server and client through a request-response architecture.Last updated
- -license-quality-maintenanceA Model Context Protocol service registry and connector framework that enables seamless integration with multiple services and models through a standardized API interface. Provides an extensible architecture for custom service adapters, API integrations, and model registries.Last updated
Related MCP Connectors
A paid remote MCP for hosted MCP server, built to return verdicts, receipts, usage logs, and audit-r
MCP (Model Context Protocol) server for Appwrite
Remote MCP for A2A dependency inspector MCP, structured receipts, audit logs, and reviewer-ready evi
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/RemoteMCP/Remote-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server