AM

ameshkov/mcp-compress-router

Developer tools

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

21 stars 4 forks 品質 72 トレンド 24MIT

すべての接続されたMCPを単一のルータMCPに圧縮し、トークンの99%まで保存します

概要

すべての接続されたMCPを単一のルータMCPに圧縮し、トークンの99%まで保存します。 MCP Compress Router は、複数の MCP サーバーをコーディング エージェントに接続する開発者向けの単一の MCP サーバーです。 直接接続し、各リクエストは、すべてのツール定義を処理します。約26Kトークンは3つの人気サーバーで、50ターンセッションで約0.19ドルです。 ルータは、これらのリストを2つのツール、get tool schema、invoke toolに置き換え、エージェントがそれを尋ねるときにのみ、ツールの完全なスキーマを返します。 同じ3つのサーバーは、約600トークンのカタログに圧縮され、オーバーヘッドを約97.7%削減します。 コストモデルのトークンオーバーヘッドを参照してください。 - 各エージェントをルータに接続し、すべてのダウンストリームMCPサーバーを1か所に管理します。 - ルータは、エージェントがすべての定義をすべてのターンに送信する最もを保存します。 実際の節約は、コーディングエージェントに依存します。一部のエージェントは、独自のアルゴリズムでリクエストからツールの定義を既に保持しています(以下、測定保存を参照してください).

概要(AI 翻訳)

すべての接続されたMCPを単一のルーターMCPに圧縮し、99%まで保存します トークン。

説明

MCP Compress Router は、MCP サーバを 1 台で接続する開発者向けです。 コーディングエージェントに複数のMCPサーバーがあります。 直接接続、各リクエスト ツール定義の全てを運ぶ — 約 26K トークン 3 人気のサーバー、50ターンのセッションで約0.19ドル。 ルーター それらのリストを2つのツール、[get_tool_schema]に置き換え、 [invoke_tool] は、エージェントが要求したときにのみ、ツールのフルスキーマを返します。 お問い合わせ 同じ3つのサーバーが約600のカタログに圧縮 トークンは、オーバーヘッドをおよそ97.7%で切断します。 お問い合わせ コストのトークンオーバーヘッドについて モデル。

ルータは2つのケースでほとんど役立ちます。

  • 複数のコーディングエージェントを使用する。 各エージェントを各エージェントに接続 ルーターを一度に管理し、すべての下流MCPサーバーを1か所に管理します。
  • あなたのエージェントは、すべてのリクエストに完全なツール定義をロードします。 ザ・オブ・ザ・ ルーターは、エージェントがすべての定義をすべての定義に送信する最も保存します。 ターン。

実際の貯蓄は、コーディングエージェントに依存します: すでにいくつかのエージェントは、 独自のアルゴリズムでリクエストのツール定義(参照) 測定された保存の下の)。

前提条件

  • **ノード.

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

README

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

MCP Compressing Router

Compress all connected MCP into a single router MCP and save up to 99% on
tokens.

Description

MCP Compress Router is a single MCP server for developers who connect several MCP servers to a coding agent. Connected directly, each request carries all of their tool definitions — about 26K tokens for three popular servers, roughly $0.93 over a 50-turn session. The router replaces those listings with two tools, get_tool_schema and invoke_tool, and returns a tool’s full schema only when the agent asks for it. The same three servers compress to a catalog of about 600 tokens, cutting the overhead by roughly 97.7%. See About token overhead for the cost model.

The router helps most in two cases:

  • You use more than one coding agent. Connect each agent to the router once and manage every downstream MCP server in one place.
  • Your agent loads full tool definitions on every request. The router saves the most where the agent sends every definition on every turn.

The actual savings depend on the coding agent: some agents already keep tool definitions out of their requests with their own algorithms (see Measured savings below).

Prerequisites

  • Node.js 24 or later — the router runs on Node.js and is launched via npx, so no separate install step is needed.
  • A coding agent that supports stdio MCP servers — opencode, Claude Code, Codex, GitHub Copilot, Cursor, and most other modern agents.

Quick Start

The router is published on npm as mcp-compress-router. You do not need to install it — just run it with npx.

Setup is two steps: connect your coding agent to the router, then add the MCP servers you want to compress.

1. Connect your coding agent

Register the router the same way you register any other stdio MCP server, at the user scope (or your agent’s equivalent). It reads its server list from a user-wide config file, so every project shares one compressed catalog:

opencode mcp add mcp-compress-router -- npx -y mcp-compress-router@latest

See Connect your coding agent for Claude Code, Codex, GitHub Copilot (VS Code), and other agents.

2. Add downstream MCP servers

GitHub で README 全文を見る

インストール

npx mcp-compress-router@latest add playwright \
MCP 初心者?mcpskill.org のガイドから始めましょう →