Logo di MCP Server Gateway

MCP Server Gateway

Community
harish-gaggar

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

Autoreharish-gaggar
Repositorymcp-server-gateway
LinguaPython
Fork
18
Stelle
90
Strumenti disponibili
0
Tipo di trasportostdio
Link
  • Collega gli strumenti ai flussi di lavoro IA

    MCP Server Gateway mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    90 stelle e 18 fork nel repository collegato.

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.

Usa MCP MCP Server Gateway con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso MCP Server Gateway, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi MCP Server Gateway come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di MCP Server Gateway.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "mcp-server-gateway": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di MCP Server Gateway, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di MCP Server Gateway.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare MCP Server Gateway per aiutarmi con questa attività?
MCP Server Gateway
Certo. Ho letto.
Ecco cosa ho trovato con MCP Server Gateway.

Domande frequenti

A cosa serve il server MCP MCP Server Gateway?

MCP Server Gateway è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare MCP Server Gateway MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare MCP Server Gateway con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP MCP Server Gateway con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando MCP Server Gateway, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego MCP Server Gateway MCP a TypingMind?

MCP Server Gateway funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre MCP Server Gateway MCP in TypingMind?

MCP Server Gateway mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare MCP Server Gateway MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se MCP Server Gateway richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇