MCP Remote Server

by sirmews
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Integrated for type checking and linting in the project, chosen for its 'gofmt'-like capabilities in JavaScript development.

  • Used as the JavaScript runtime for the MCP server, selected for its speed and all-in-one capabilities.

コードベースに基づいたより技術的な詳細を記載した拡張 README を以下に示します。

mcp-リモートサーバー

リモート設定から動的に機能を読み込む、設定可能なモデルコンテキストプロトコル(MCP)サーバーです。ModelContextProtocol利用して、ローカル MCP クライアントと通信できるローカルサーバーを作成します。

概要

mcp-remote-server MCP クライアントとリモート API 間のブリッジとして機能します。リモートホスト構成( MCP_CONTROL_PLANE_URLで指定)を解析します。この構成には、リモート API エンドポイントを指すツール、リソース、プロンプトのリストが含まれています。

主な特徴

  • 動的構成: サーバーの機能はリモートJSON構成を通じて定義されます
  • 自動更新: 設定は60秒ごとに自動的に更新されます
  • すべてのMCPプリミティブをサポート:
    • ツール: リモート API 呼び出しを通じてアクションを実行する
    • リソース: リモートデータを読み取り可能なリソースとして公開する
    • プロンプト: 再利用可能なプロンプトテンプレートを定義する

設定形式

{ "tools": [{ "name": "tool-name", "description": "Tool description", "inputSchema": { "type": "object", "properties": { // JSON Schema for tool inputs } }, "handler": "https://api.example.com/tool-endpoint" }], "resources": [{ "uri": "resource://identifier", "name": "Resource Name", "description": "Resource description", "mimeType": "application/json", "handler": "https://api.example.com/resource-endpoint" }], "prompts": [{ "name": "prompt-name", "description": "Prompt description", "arguments": [{ "name": "arg-name", "description": "Argument description", "required": true }], "handler": "https://api.example.com/prompt-endpoint" }] }

ハンドラーAPIの要件

リモート ハンドラーは、適切にフォーマットされた応答を返す必要があります。

  • ツールハンドラー: 文字列化され、MCP ツール応答にラップされる JSON を返します。
  • リソースハンドラ: 指定された mimeType に一致するコンテンツを返します
  • プロンプトハンドラ: 文字列(メッセージに自動的にラップされる)またはMCP形式のメッセージの配列を返します。

インストール

bun install

使用法

  1. コントロール プレーンの URL を設定します。
export MCP_CONTROL_PLANE_URL="https://your-config-endpoint"
  1. サーバーを実行します。
bun run index.ts

制限事項

  • HTTP/HTTPSハンドラーエンドポイントのみサポート
  • 構成はHTTP GETリクエスト経由でアクセス可能である必要がある
  • ハンドラのレスポンスはJSON互換である必要があります
  • ローカルでのみ実行(標準の MCP 制限)

このプロジェクトは、bun v1.1.32 のbun initを使用して作成されました。Bun高速なオールインワン JavaScript ランタイムです。Bun を選んだのは、高速であることと、少し変わったものを試してみたかったからです。

このプロジェクトでも、型チェックとリンティングにBiomeを使用しています。Bunと同じ理由でBiomeを選びました。何か違うものを探していたので、JSにgofmtのようなツールがあればいいのにと思いました。これは良いスタートです。

-
security - not tested
F
license - not found
-
quality - not tested

リモート構成から機能を動的にロードし、MCP クライアントとリモート API を橋渡ししてアクションの実行、リソースへのアクセス、プロンプト テンプレートの利用を可能にする、構成可能な MCP サーバーです。

  1. Overview
    1. Key Features
    2. Configuration Format
    3. Handler API Requirements
  2. Installation
    1. Usage
      1. Limitations
        ID: 2q6b1i9jpz