MCP Server Gatewayのロゴ

MCP Server Gateway

コミュニティ
harish-gaggar

MCP gateway & OAuth MCP servers. LangGraph agent: memory, eval/tracking, PII guard, context trimming. Docker quick start for enterprise agents.

公開者harish-gaggar
リポジトリmcp-server-gateway
言語Python
フォーク
18
スター
90
利用可能なツール
0
通信方式stdio
リンク
  • ツールをAIワークフローに接続

    MCP Server Gatewayは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには90件のスターと18件のフォークがあります。

MCP Server Gateway

A production-grade MCP Gateway, OAuth-secured MCP servers, and a governed LangGraph agent — ready to fork and run.

License: Apache-2.0 Stars Forks Docker Python

Quick Start • Design Principles • Repository Layout • Documentation


Overview

This repository is a reference stack for enterprise teams building an MCP gateway and MCP servers from scratch, often inside an air-gapped or restricted network where public SaaS patterns don't apply out of the box. It ships working gateway, server, and agent code that runs locally with Docker, so you can fork and extend it for your own internal tools, identity systems, audit rules, and deployment standards.

It is not a hosted product — it's a starting blueprint: an OAuth-ready gateway, example MCP backends (Artifactory, GitHub, Google Drive), a governed LangGraph agent, PII controls, and the operational pieces (memory, measurement, context control) that production agents usually bolt on later.

Design framework, not just an agent

An agent alone isn't a solution — it needs guardrails around it. Every request that flows through this stack passes through eight design principles, all implemented in Agents/jfrog-agent/:

#PrincipleWhat it does
01Agent frameworkTask-specific nodes with skills, prompts, and an internal plugin marketplace
02OAuth before every callEach MCP tool call runs authenticated, per user
03Customized MCPMCP tools tailored to your internal security practices
04Continuous auditEvery operation is logged at the MCP gateway
05PII / secrets strippedSensitive data is scrubbed before it ever reaches the LLM (agent-safety-kit/)
06Tracking & evalPer-query tracking of model, tools, tokens, latency, and response quality
07Memory managementConversation threads and LangGraph checkpoints persist across restarts (SQLite by default, Spanner-ready)
08Context optimizerTrims and summarizes long MCP transcripts to cut unnecessary token spend while keeping protocol-critical fields

See Agents/jfrog-agent/README.md for memory backends and environment variables, and context_optimizer for trimming presets.

Quick start

Goal: clone the repo, start Docker, and prove MCP Gateway → MCP server routing works (Artifactory in open mode; GitHub optional with OAuth).

Prerequisites

RequirementNotes
Docker Desktop or Engine + Compose v2Docker must be running before any docker compose command
Node.js 20+Only for the smoke-test scripts (node scripts/…); not required to build images
Python 3.10+Optional: OAuth demo and Agent Safety Kit
Free ports8090 gateway, 8091 Artifactory MCP (direct), 6379 Redis

1. Clone and start the stack

Important: create mcp-gateway/.env and set TOKEN_ENCRYPTION_KEY before docker compose. The setup script does that from .env.example.

bash
git clone https://github.com/harish-gaggar/mcp-server-gateway.git
cd mcp-server-gateway/mcp-gateway

chmod +x scripts/setup-local-env.sh scripts/smoke-test.sh
./scripts/setup-local-env.sh
docker compose up -d --build

Wait until every service is healthy (first build can take several minutes):

bash
docker compose ps

You should see five containers (mcp-gateway, mcp-gateway-redis, artifactory-mcp-server, github-mcp-server, gdrive-mcp-server) with status Up (healthy).

Gateway health check:

bash
curl -s http://localhost:8090/health

Success: JSON contains "status":"ok".

2. Test gateway → MCP server (no OAuth secrets needed)

This checks the gateway proxy to Artifactory MCP (initialize + tools/list) and direct health on all three MCP backends:

bash
./scripts/smoke-test.sh

Success: the script ends with smoke-test: passed and prints a tool count for Artifactory (for example 7 tools).

Manual equivalent (Artifactory only):

bash
node scripts/e2e-test.mjs

3. Optional: GitHub MCP with OAuth (live GitHub API)

Default open mode does not expose the GitHub namespace on the gateway. To test gateway OAuth → GitHub MCP → GitHub API:

  1. Create a GitHub OAuth App with callback URL http://localhost:8090/oauth2callback.
  2. In mcp-gateway/.env, set:
    • GITHUB_OAUTH_CLIENT_ID and GITHUB_OAUTH_CLIENT_SECRET
    • MCP_CONFIG_FILE=./configs/ci-mcp-config.yml
    • OAUTH_CONFIG_FILE=./configs/ci-oauth-config.yml
  3. Restart the gateway: docker compose up -d gateway
  4. Run (browser login + consent once):
bash
chmod +x scripts/test-github-mcp-oauth.sh
./scripts/test-github-mcp-oauth.sh

Success: tools/list shows GitHub tools and list_repositories returns JSON from your account. See also python3 scripts/oauth-client-demo.py --namespace github --tool get_user_info --args '{"username":"YOUR_GITHUB_LOGIN"}'.

4. Optional: reference agent UI

Start after step 1 (gateway on :8090):

bash
cd ../Agents/jfrog-agent
cp .env.example .env
docker compose up --build

UI: http://localhost:8501. Default memory is SQLite. Spanner emulator: docker compose --profile spanner up --build.

5. Optional: Agent Safety Kit (no Docker)

bash
cd ../../agent-safety-kit
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]" && pytest -v

If something fails

SymptomFix
Cannot connect to the Docker daemonStart Docker Desktop (or Colima) and retry
docker pull / x509: certificate signed by unknown authorityCorporate TLS proxy: mcp-gateway/certs/README.md
invalid IP / host-gateway on ColimaRe-run ./scripts/setup-local-env.sh (sets HOST_DOCKER_INTERNAL)
Gateway exits on startupEmpty TOKEN_ENCRYPTION_KEY — run ./scripts/setup-local-env.sh before docker compose
Gateway exits with Google OIDC errorsUse ci-oauth-config.yml for GitHub-only tests, or set GATEWAY_NODE_EXTRA_CA_CERTS per setup script on proxied networks
smoke-test cannot reach :8090docker compose ps — wait for mcp-gateway healthy
Cursor / HTTPS / monitoringdoc/howto/QUICKSTART.md

Secure mode and full setup

Per-user OAuth (Google, GitHub, Drive), Cursor, and monitoring: doc/howto/QUICKSTART.md and mcp-gateway/.env.example (OAUTH_CONFIG_FILE, MCP_CONFIG_FILE, provider client IDs).

Repository layout

mcp-server-gateway/
├── mcp-gateway/                  # Gateway, Compose, Cursor wrappers
├── artifactory/ github/ gdrive/  # Example MCP servers
├── agent-safety-kit/             # PII and secrets guard (portable)
├── Agents/jfrog-agent/           # Memory, tracking/eval, context optimizer
└── doc/howto/QUICKSTART.md

Verify the stack (contributors and CI)

From a clean clone, the path above (setup-local-env.sh → docker compose up → smoke-test.sh) is the minimum bar.

Full local CI (unit tests + stack + GitHub routing when OAuth creds are set):

bash
chmod +x mcp-gateway/scripts/verify-stack.sh
mcp-gateway/scripts/verify-stack.sh

See CONTRIBUTING.md.

Documentation

DocTopic
ContributingFull verify script and contributor workflow
QuickstartOAuth, Cursor, monitoring
JFrog agentMemory backends, tracking, env vars
Context optimizerTrimming layers and presets
Agent Safety KitInput guard and PII scanner
Gateway devLocal dev and tests

Status and license

Reference implementation; APIs may change. Do not commit .env or OAuth secrets.

Licensed under Apache-2.0. Contributions welcome — see CONTRIBUTING.md.

If this project helps you, consider giving it a ⭐ — it helps others find it too.

MCP Server GatewayのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度MCP Server Gatewayに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

MCP Server Gatewayをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. MCP Server GatewayのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "mcp-server-gateway": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてMCP Server GatewayのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. MCP Server GatewayのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
MCP Server Gatewayを使ってこのタスクを手伝ってもらえますか?
MCP Server Gateway
はい、読みました。
MCP Server Gatewayで調べた結果をお伝えします。

よくある質問

MCP Server Gateway MCPサーバーは何に使いますか?

MCP Server Gatewayは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでMCP Server Gateway MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでMCP Server Gatewayを利用できます。

TypingMindでMCP Server Gateway MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。MCP Server Gatewayを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

MCP Server Gateway MCPをTypingMindに接続するにはどうすればよいですか?

MCP Server GatewayはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでMCP Server Gateway MCPのどのようなツールを利用できますか?

MCP Server GatewayはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

MCP Server Gateway MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。MCP Server Gatewayで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇