Skip to main content
Glama

ThinMCP

ThinMCPは、多くのアップストリームMCPサーバーを安定した2つのツールインターフェースを通じて公開するMCPゲートウェイです:

  • search()

  • execute()

すべてのアップストリームツール定義をモデルのコンテキストに読み込む代わりに、ThinMCPはローカルカタログを保持し、モデルが必要に応じてツールを発見できるようにし、必要な呼び出しのみを転送します。

ThinMCPの利点

複数のMCPサーバーをモデルに直接接続すると、ツール数が増えるにつれてコンテキストサイズが大きくなります。ThinMCPは、モデルに面するインターフェースを固定しつつ、大規模なツールエコシステムへのアクセスを可能にします。

その結果、クライアントにとってよりシンプルな統合ポイントとなり、本番環境のデプロイメントにおいてより予測可能なランタイム構成を実現します。

Related MCP server: MCP Gateway

アーキテクチャ

flowchart LR
    A["LLM or MCP Client"] --> B["ThinMCP Gateway"]
    B --> C["Local Catalog"]
    B --> D["Execution Layer"]
    D --> E["Schema Validation"]
    E --> F["Upstream MCP Servers"]
    G["Sync Process"] --> F
    G --> C
    G --> H["Snapshots"]

主な機能

  • モデル向けの固定された2ツールインターフェース

  • HTTPおよびstdioアップストリームサーバーのサポート

  • 発見のためのローカルSQLiteベースのカタログ

  • アップストリーム実行前の入力検証

  • ゲートウェイツール呼び出しのためのサンドボックス化された実行

  • ヘルスチェックおよびメトリクスエンドポイントを備えたHTTPトランスポート

  • アップストリームツールメタデータの定期的な同期

クイックスタート

npm install
npm run build
cp config/mcp-sources.example.yaml config/mcp-sources.yaml

config/mcp-sources.yamlを編集し、同期して起動します:

npm run sync
npm start

HTTPモード:

npm start -- --transport http --port 8787

セットアップの検証:

npm run doctor

設定

ThinMCPはconfig/mcp-sources.yamlを読み取ります。各アップストリームサーバーはhttpまたはstdioトランスポートを使用できます。

最小構成例:

servers:
  - id: exa
    name: Exa MCP
    transport: http
    url: https://mcp.exa.ai/mcp
    auth:
      type: bearer_env
      env: EXA_API_KEY
    allowTools: ["*"]

  - id: local-fs
    name: Local Filesystem MCP
    transport: stdio
    command: npx
    args:
      - -y
      - "@modelcontextprotocol/server-filesystem"
      - /tmp
    cwd: .
    allowTools:
      - "filesystem.*"

sync:
  intervalSeconds: 300
  onStart: true

runtime:
  codeTimeoutMs: 15000
  maxCodeLength: 20000
  maxResultChars: 60000

catalog:
  dbPath: ../data/thinmcp.db
  snapshotDir: ../snapshots

allowToolsを使用して、各アップストリームサーバーをゲートウェイ経由で公開したいツールのみに制限します。

ThinMCPの実行

開発環境:

npm run dev

本番ビルド:

npm run build
npm start

HTTPモード:

npm start -- --transport http --host 127.0.0.1 --port 8787

利用可能なHTTPエンドポイント:

  • /mcp

  • /healthz

  • /metrics

運用

一般的なコマンド:

npm run build
npm run sync
npm run doctor
npm test
THINMCP_RUN_E2E=1 npm run test:e2e

運用上のガイダンス:

  • アップストリームの認証情報は環境変数に保持してください

  • allowToolsを最小限の有用な範囲に制限してください

  • ローカル開発環境以外でゲートウェイを公開する場合は、HTTP認証とレート制限を有効にしてください

  • カタログの鮮度が重要な場合は、デプロイメントや起動時の検証の一部としてnpm run syncを実行してください

クライアント統合

クライアントの例はdocs/CLIENT_INTEGRATIONS.mdに記載されています。

ライセンス

ISC

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    A universal gateway that aggregates multiple MCP servers into a single interface while providing advanced token optimization, result filtering, and automated summarization. It enables efficient management of large tool catalogs and reduces context usage by up to 95% for major AI clients.
    13 npm
    15
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Aggregates multiple Model Context Protocol servers into a single gateway to provide unified search, description, and execution of tools. It reduces context limit issues by dynamically fetching specific tool schemas only when needed rather than loading all available tools at once.
    13 npm
    22
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    A single MCP endpoint for AI agents to browse, inspect, and call tools from multiple upstream MCP servers without loading all schemas upfront, reducing context overhead.
    11 npm
    ISC
  • A
    license
    Not graded
    quality
    C
    maintenance
    A unified MCP gateway that reduces context token usage by exposing all services through just two tools (search and execute), supporting built-in services like Asana and Sentry as well as proxied external MCP servers.
    8 npm
    1
    MIT