Logo de MCP Server Gateway

MCP Server Gateway

Comunidade
harish-gaggar

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

Publicado porharish-gaggar
Repositóriomcp-server-gateway
IdiomaPython
Forks
18
Estrelas
90
Ferramentas disponíveis
0
Tipo de transportestdio
Links
  • Conecte ferramentas a fluxos de trabalho de IA

    MCP Server Gateway disponibiliza recursos MCP que podem ser usados por clientes e agentes de IA compatíveis.

  • 0 ferramentas disponíveis

    Confira abaixo as ações que podem ser chamadas, incluindo nomes e descrições quando fornecidos pelo servidor.

  • Configuração pronta para copiar

    Use os exemplos de instalação para configurar este servidor no seu cliente MCP preferido.

  • Indicadores da comunidade de código aberto

    90 estrelas e 18 forks no repositório vinculado.

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.

Use o MCP de MCP Server Gateway com vários modelos de IA

O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho. Assim, após conectar MCP Server Gateway, é possível usá-lo com diferentes modelos de IA no TypingMind, em vez de configurá-lo separadamente para cada modelo. Este MCP é executado localmente no seu dispositivo por meio do conector MCP do TypingMind.

Guia de configuração para usar o conector local

Use esta opção quando o servidor MCP precisar acessar arquivos locais, aplicativos ou recursos privados no seu computador.

1

Abra as configurações de MCP

No TypingMind, vá até Configurações, Configurações avançadas e depois Model Context Protocol e selecione Configurar conector.

  1. Abra o TypingMind no navegador.
  2. Clique no ícone de Ajustes.
  3. Acesse Configurações avançadas.
  4. Abra a seção Model Context Protocol.
  5. Clique em Configurar conector e selecione Este dispositivo.
Tela de configuração do conector MCP do TypingMind com a opção Este dispositivo selecionada
2

Execute o comando do conector

Selecione Este dispositivo, copie o comando do TypingMind e execute-o no Terminal. Mantenha o processo em execução enquanto usa o MCP.

  1. Copie o comando de configuração exibido pelo TypingMind.
  2. Abra o Terminal no macOS ou o Windows Terminal no Windows.
  3. Cole e execute o comando.
  4. Autorize a instalação do pacote se o Terminal pedir confirmação para continuar.
  5. Mantenha o processo em execução na janela do Terminal enquanto usa as ferramentas MCP.
3

Adicione MCP Server Gateway como servidor

Quando o status do conector for Pronto, clique em Editar e cole a configuração do servidor MCP.

  1. Aguarde até que o status do conector mostre Pronto.
  2. Clique em Editar.
  3. Cole a configuração do servidor MCP de MCP Server Gateway.
  4. Salve a lista de servidores.
  5. Atualize para confirmar se o conector ainda está pronto para uso.
Configurações de MCP do TypingMind mostrando um servidor ativo e o botão Editar
{
  "mcpServers": {
    "mcp-server-gateway": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use a conexão com diferentes modelos

Salve a lista de servidores, abra Plugins, ative as ferramentas MCP de MCP Server Gateway, selecione qualquer modelo de IA compatível no TypingMind e use as ferramentas no chat ou atribua-as a um agente de IA.

  1. Abra a página Plugins no TypingMind.
  2. Ative as ferramentas MCP de MCP Server Gateway.
  3. Inicie um chat e escolha o modelo de IA que deseja usar.
  4. Use as ferramentas MCP no chat ou atribua-as a um agente de IA.
  5. Mude para outro modelo de IA sempre que necessário, sem reconectar o MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar MCP Server Gateway para me ajudar nesta tarefa?
MCP Server Gateway
Claro. Já li.
Veja o que encontrei usando MCP Server Gateway.

Perguntas frequentes

Para que serve o servidor MCP MCP Server Gateway?

MCP Server Gateway é um servidor MCP que permite que aplicativos de IA compatíveis se conectem a ferramentas externas e informações de contexto. No TypingMind, basta adicionar esse servidor MCP uma vez para disponibilizar suas ferramentas no seu espaço de trabalho com IA.

Posso usar o MCP MCP Server Gateway com vários modelos de IA no TypingMind?

Sim. O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho, permitindo usar MCP Server Gateway com diferentes modelos de IA, como Claude, ChatGPT, Gemini ou outros modelos configurados no TypingMind, sem configurar o servidor MCP separadamente para cada modelo.

Por que usar o MCP MCP Server Gateway com o TypingMind?

O TypingMind é uma das melhores interfaces de chat com LLMs porque reúne vários modelos de IA, prompts, plugins, agentes de IA, chaves de API e ferramentas MCP em um só espaço de trabalho. Com MCP Server Gateway conectado, é possível usar suas ferramentas MCP nos seus modelos preferidos e manter seu fluxo de trabalho de chat organizado no TypingMind.

Como conecto o MCP MCP Server Gateway ao TypingMind?

MCP Server Gateway funciona por meio do conector MCP local do TypingMind. Essa é a melhor opção quando o servidor MCP precisa acessar arquivos locais, apps de desktop, ferramentas de linha de comando ou recursos privados no seu computador.

Quais ferramentas o MCP MCP Server Gateway oferece no TypingMind?

MCP Server Gateway disponibiliza recursos MCP que podem ser ativados na página Plugins do TypingMind e usados no chat ou atribuídos a agentes de IA.

Preciso compartilhar minhas chaves de API com o TypingMind para usar o MCP MCP Server Gateway?

Não. O TypingMind prioriza o uso local e permite manter seus provedores de modelos, chaves de API, prompts e configuração MCP sob seu controle. Se MCP Server Gateway exigir autenticação, adicione os cabeçalhos, as configurações OAuth ou a configuração local exigidos por esse servidor MCP ao criar a conexão.

Servidores MCP relacionados

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇