Logotipo de MCP Proxy

MCP Proxy

Comunidad
itmaaa

Turn OpenAPI/Swagger services into managed MCP tools with a dashboard, authentication, path controls, and metrics.

Editoritmaaa
Repositoriomcp-proxy
IdiomaGo
Forks
0
Estrellas
79
Herramientas disponibles
0
Tipo de transportestdio
LicenciaApache-2.0
Enlaces
  • Conecta herramientas a flujos de trabajo con IA

    MCP Proxy ofrece funciones MCP que pueden usar los clientes y agentes de IA compatibles.

  • 0 herramientas disponibles

    Explora a continuación las acciones que se pueden invocar, con sus nombres y descripciones cuando el servidor los proporcione.

  • Configuración lista para copiar

    Usa los ejemplos de instalación para configurar este servidor en tu cliente MCP preferido.

  • Indicadores de interés en el código abierto

    79 estrellas y 0 forks en el repositorio enlazado.

MCP Proxy

English | 简体中文

MCP Proxy turns OpenAPI/Swagger endpoints into runnable MCP tools. It loads upstream API specs, generates MCP tool schemas, starts one MCP server per configured endpoint, and provides a dashboard for managing endpoints, tool visibility, request examples, response examples, health status, and metrics.

Dashboard

MCP Proxy dashboard

Demo

Import an OpenAPI document, enable a generated tool, and call it through MCP:

OpenAPI to MCP tool call demo

Features

  • Generate MCP tools from OpenAPI 3 and Swagger 2 specifications.
  • Run endpoints in HTTP, SSE, or STDIO mode.
  • Manage upstream endpoints from the embedded dashboard.
  • Enable or disable individual Swagger paths without editing upstream specs.
  • Show copyable tool-call request examples and response examples.
  • Validate required path/query/header/form/body parameters before calling upstream.
  • Forward upstream auth with none, basic, bearer, or api_key.
  • Optional dashboard admin key for write operations.
  • Optional app-client JWT auth for MCP server access.
  • Prometheus metrics for upstream request latency and status classes.
  • MySQL-backed storage for endpoints, cached swagger specs, and path toggles.

Requirements

  • Go 1.24.1 or newer

Quick Start

  1. From the repository root, initialize a fresh database with the bundled SQL file. Run this once; skip it when reusing an initialized database:

    bash
    mysql -u root -p -e "source docs/endpoints.sql"

    This creates the mcp_proxy database, the required tables, and the test-params endpoint used by the local demo.

  2. Update config.yaml with your MySQL connection:

    yaml
    db:
      driver: "mysql"
      host: "127.0.0.1"
      port: 3306
      user: "root"
      password: ""
      database: "mcp_proxy"
      params: "parseTime=true&charset=utf8mb4&collation=utf8mb4_unicode_ci"
  3. Start the bundled mock upstream in a separate terminal:

    bash
    go run ./test_tools/mock_upstream

    The mock API listens on http://127.0.0.1:18900, and its OpenAPI document is available at http://127.0.0.1:18900/openapi.json.

  4. Start the proxy:

    bash
    go run ./cmd --config config.yaml
  5. Open the dashboard:

    text
    http://localhost:18081/mcp/
  6. Select test-params in the Dashboard. It was created by the SQL script in step 1. If you skipped database initialization and the endpoint does not exist, click New and enter the following values:

    json
    {
      "name": "test-params",
      "enabled": true,
      "version": "1.0.0",
      "mode": "http",
      "host": "0.0.0.0",
      "port": 18993,
      "timeout": "30s",
      "base_url": "http://127.0.0.1:18900",
      "gateway_url": "http://127.0.0.1:18900",
      "doc_path": "/openapi.json",
      "auth_type": "none",
      "auth_config": {},
      "headers": {}
    }
  7. Open test-params in the Dashboard and enable /ping or any other paths you want to expose. New upstream paths are disabled by default.

  8. Connect an MCP client to:

    text
    http://127.0.0.1:18993/mcp/

    The generated tools now call the local mock upstream and return the request details it received, so the full OpenAPI-to-MCP request flow can be tested without an external API.

Runtime Layout

The process exposes two kinds of HTTP servers:

  • Dashboard server: defaults to 0.0.0.0:18081
  • Endpoint MCP servers: one server per enabled endpoint row in the database

The dashboard server provides:

  • /mcp/: embedded dashboard UI
  • /mcp/servers: aggregated running MCP server and tool information
  • /mcp/api/endpoints: endpoint management API
  • /mcp/api/tools: per-path enable/disable API
  • /mcp/api/docs: Swagger UI for the dashboard API
  • /mcp/api/openapi.yaml: dashboard OpenAPI document
  • /metrics: Prometheus metrics

Endpoint MCP servers expose generated MCP tools on their configured port using the selected transport mode.

Configuration

config.yaml contains process-wide settings:

yaml
server:
  name: "MCP Proxy"
  version: "1.0.0"

logging:
  level: "info"
  format: "json"
  color: true
  disable_stacktrace: false
  output_path: "logs/mcp-proxy.log"
  append_to_file: true
  disable_console: false

app_auth:
  enabled: false
  jwt_secret: "test-secret-key-for-development-use-32bytes-minimum"
  token_expiry: "24h"

dashboard:
  admin_key: ""

Dashboard Admin Key

When dashboard.admin_key is empty, dashboard write operations are allowed. When it is non-empty, non-GET requests under /mcp/api/* must include:

text
X-Admin-Key: <admin_key>

The dashboard UI will prompt for the key when write access is required.

Upstream Authentication

Each endpoint can configure how requests are authenticated when forwarded to the upstream API:

  • none: no auth headers are added
  • basic: uses auth_config.username and auth_config.password
  • bearer: sends Authorization: Bearer <token>
  • api_key: sends auth_config.key in header auth_config.header

Example:

json
{
  "auth_type": "bearer",
  "auth_config": {
    "token": "upstream-token"
  }
}

App Client Authentication

When app_auth.enabled is true, MCP server access can be guarded by app-client JWTs. App clients are managed through /mcp/api/app-clients, and tokens are issued by /auth/token.

The dashboard API documentation at /mcp/api/docs includes the app-client schemas and auth endpoints.

Tool Generation Behavior

For each enabled Swagger/OpenAPI path, MCP Proxy creates tools from supported HTTP methods:

  • GET
  • POST
  • PUT
  • DELETE
  • PATCH

Generated tool names use the pattern:

text
<method>_<path>

For example, GET /v1/items/{id} becomes:

text
get_v1_items_id

Request arguments follow these rules:

  • Path, query, and header parameters stay at the top level.
  • JSON request bodies must be wrapped under the top-level body key.
  • Multipart form fields stay flat.
  • Required parameters are validated before the proxy calls upstream.

Example JSON-body call arguments:

json
{
  "id": "item-1",
  "trace_id": "abc",
  "body": {
    "name": "demo"
  }
}

Metrics

Prometheus metrics are exposed at:

text
GET /metrics

Custom upstream metrics include:

  • mcp_proxy_upstream_requests_total
  • mcp_proxy_upstream_request_duration_seconds

Labels are intentionally bounded:

  • endpoint
  • method
  • path
  • status_class

The default Go runtime and process collectors are also enabled.

Development

Run tests:

bash
go test ./...

Run with a specific config file:

bash
go run ./cmd --config config.yaml

Print version information:

bash
go run ./cmd --version

Notes

  • Swagger specs are cached in MySQL after the first successful fetch.
  • Dashboard reload clears the cached swagger document and restarts the endpoint.
  • New remote paths are inserted into swagger_paths disabled by default.
  • Deleted remote paths are removed from swagger_paths during sync.
  • Spring Actuator paths are skipped and are not exposed as tools.

Usa el MCP de MCP Proxy con varios modelos de IA

TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que, una vez conectado MCP Proxy, puedes usarlo con distintos modelos de IA en TypingMind sin tener que configurarlo por separado para cada modelo. Esta integración MCP se ejecuta localmente en tu dispositivo a través del conector MCP de TypingMind.

Guía de configuración para usar el conector local

Usa esta opción si el servidor MCP necesita acceder a archivos locales, aplicaciones o recursos privados de tu ordenador.

1

Abre los ajustes de MCP

En TypingMind, ve a Ajustes, luego a Ajustes avanzados y a Model Context Protocol, y elige Configurar conector.

  1. Abre TypingMind en tu navegador.
  2. Haz clic en el icono de Ajustes.
  3. Ve a Ajustes avanzados.
  4. Abre la sección Model Context Protocol.
  5. Haz clic en Configurar conector y elige Este dispositivo.
Pantalla de configuración del conector MCP de TypingMind con «Este dispositivo» seleccionado
2

Ejecuta el comando del conector

Elige Este dispositivo, copia el comando de TypingMind y ejecútalo en Terminal. Mantén el proceso en ejecución mientras uses MCP.

  1. Copia el comando de configuración que muestra TypingMind.
  2. Abre Terminal en macOS o Windows Terminal en Windows.
  3. Pega y ejecuta el comando.
  4. Acepta la instalación del paquete si Terminal te pide confirmación para continuar.
  5. Mantén el proceso en ejecución en la ventana de Terminal mientras uses las herramientas MCP.
3

Añade MCP Proxy como servidor

Cuando el estado del conector sea «Listo», haz clic en «Edita servidores» y pega la configuración del servidor MCP.

  1. Espera hasta que el estado del conector indique «Listo».
  2. Haz clic en Edita servidores.
  3. Pega la configuración del servidor MCP de MCP Proxy.
  4. Guarda la lista de servidores.
  5. Actualiza para comprobar que el conector sigue listo.
Ajustes de MCP de TypingMind con un servidor activo y el botón «Edita servidores»
{
  "mcpServers": {
    "itmaaa-mcp-proxy": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Úsala con distintos modelos

Guarda la lista de servidores, abre Plugins, activa las herramientas MCP de MCP Proxy y selecciona cualquier modelo de IA compatible en TypingMind para usar las herramientas en el chat o asignárselas a un agente de IA.

  1. Abre la página Plugins en TypingMind.
  2. Activa las herramientas MCP de MCP Proxy.
  3. Inicia un chat y elige el modelo de IA que quieras usar.
  4. Usa las herramientas MCP en el chat o asígnalas a un agente de IA.
  5. Cambia a otro modelo de IA cuando lo necesites sin volver a conectar MCP.
Chat de TypingMind que usa herramientas MCP activadas con un modelo de IA seleccionado
¿Puedes usar MCP Proxy para ayudarme con esta tarea?
MCP Proxy
Claro. Lo he leído.
Esto he encontrado usando MCP Proxy.

Preguntas frecuentes

¿Para qué sirve el servidor MCP MCP Proxy?

MCP Proxy es un servidor MCP que permite a los clientes de IA compatibles conectarse a herramientas y contexto externos. En TypingMind, basta con añadir este servidor MCP una vez para que sus herramientas estén disponibles en tu espacio de trabajo de IA.

¿Puedo usar el servidor MCP MCP Proxy con varios modelos de IA en TypingMind?

Sí. TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que puedes usar MCP Proxy con distintos modelos de IA, como Claude, ChatGPT, Gemini u otros que hayas configurado en TypingMind, sin configurar el servidor MCP por separado para cada modelo.

¿Por qué usar el conector MCP de MCP Proxy con TypingMind?

TypingMind es una de las mejores interfaces de chat con LLM porque reúne varios modelos de IA, prompts, plugins, agentes de IA, claves de API y herramientas MCP en un solo espacio de trabajo. Con MCP Proxy conectado, puedes usar sus herramientas MCP con tus modelos preferidos y mantener organizado tu flujo de trabajo de chat en TypingMind.

¿Cómo conecto el servidor MCP MCP Proxy a TypingMind?

MCP Proxy funciona a través del conector MCP local de TypingMind. Es la mejor opción cuando el servidor MCP necesita acceder a archivos locales, aplicaciones de escritorio, herramientas de línea de comandos o recursos privados de tu ordenador.

¿Qué herramientas ofrece el servidor MCP MCP Proxy en TypingMind?

MCP Proxy ofrece funciones MCP que puedes activar desde la página Plugins de TypingMind y usar en el chat o asignar a agentes de IA.

¿Tengo que compartir mis claves de API con TypingMind para usar el servidor MCP MCP Proxy?

No. TypingMind prioriza el funcionamiento local y te permite mantener el control de tus proveedores de modelos, claves de API, prompts y configuración MCP. Si MCP Proxy requiere autenticación, añade las cabeceras, los ajustes de OAuth o la configuración local necesarios para ese servidor MCP al crear la conexión.

Servidores MCP relacionados

Ver todos

Crea ya tu propio espacio de trabajo IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇