mcp-proxy

module
v0.0.0-...-629ae5f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2025 License: MIT

README

MCP Proxy

A concise proxy and UI for composing “Virtual MCP Servers” from tools discovered across your MCP hubs. The backend is Go (GORM + goose, slog), the frontend is React + Vite + Tailwind.

What it does

  • Connect to upstream MCP servers ("Hubs"), fetch capabilities and tools
  • Persist tools and create user-owned Virtual MCP Servers (VS)
  • Expose a stateless streamable MCP endpoint per VS: /servers/{virtual_server_id}/mcp
  • Simple Admin UI with four panels: Catalogue, Hub, Tools-in-Hub, Virtual Servers

Quick start

Prereqs: Go 1.22+, Node 20+ (for UI), a local MySQL-compatible DB configured in config/dev_streamable-http.toml.

Backend (dev):

make setup        # migrate + seed + run
# or
make run          # only run the server

Frontend (dev):

cd ui
npm install
npm run dev

Auth: Sign in with Google SSO or Basic credentials (dev). The UI uses the session cookie set by the backend.

Key endpoints (admin)

  • GET /api/virtual-servers — list VS for current user
  • POST /api/virtual-servers — create VS → { id }
  • PUT /api/virtual-servers/{id}/tools — replace tool IDs (cap 50)
  • PATCH /api/virtual-servers/{id}/status — set status
  • DELETE /api/virtual-servers/{id} — delete VS
  • GET /api/virtual-servers/{id}/tools — list tools for VS
  • POST /api/hub/servers — add hub (stores auth encrypted when configured)
  • POST /api/hub/servers/{id}/refresh — pull tools from upstream

Cursor config snippet: Add a Virtual MCP Server

Create a virtual MCP Server on the UI and add the below config in our cursor IDE to start using the MCP tools

{
  "mcpServers": {
    "virtual-mcp-server": {
        "transport": "http",
        "url": "http://localhost:8080/servers/<virtual-server-id>/mcp"
    }
  }
}

Directories

Path Synopsis
cmd
mcp-gateway command
Command mcp-gateway starts the Global MCP Gateway HTTP server.
Command mcp-gateway starts the Global MCP Gateway HTTP server.
migrate command
Command migrate applies SQL migrations from the migrations/ directory.
Command migrate applies SQL migrations from the migrations/ directory.
seed command
Package main seeds catalog data and users from JSON files.
Package main seeds catalog data and users from JSON files.
internal
config
Package config loads application configuration via Viper.
Package config loads application configuration via Viper.
contextkey
Package contextkey defines strongly-typed context keys used across the server.
Package contextkey defines strongly-typed context keys used across the server.
encryptor
Package encryptor provides helpers for symmetric encryption.
Package encryptor provides helpers for symmetric encryption.
httpclient
Package httpclient initialises the http client with auth headers
Package httpclient initialises the http client with auth headers
log
Package log provides a small wrapper for slog configuration.
Package log provides a small wrapper for slog configuration.
mcp/idgen
Package idgen provides helpers for generating public IDs.
Package idgen provides helpers for generating public IDs.
mcp/service/catalog
Package catalog provides access to the MCP servers catalog.
Package catalog provides access to the MCP servers catalog.
mcp/service/catalog_orchestrator
Package catalog_orchestrator coordinates higher-level workflows around catalog servers.
Package catalog_orchestrator coordinates higher-level workflows around catalog servers.
mcp/service/mcphub
Package mcphub provides hub service implementation.
Package mcphub provides hub service implementation.
mcp/service/mcphub_orchestrator
Package mcphub_orchestrator coordinates higher-level workflows around MCP hubs.
Package mcphub_orchestrator coordinates higher-level workflows around MCP hubs.
mcp/service/tool
Package tool provides the Tool service for tool operations.
Package tool provides the Tool service for tool operations.
mcp/service/user
Package user provides minimal user management for SSO.
Package user provides minimal user management for SSO.
mcp/service/virtualmcp
Package virtualmcp provides the virtual server service implementation.
Package virtualmcp provides the virtual server service implementation.
middlewares
Package middlewares contains HTTP middlewares used across the gateway.
Package middlewares contains HTTP middlewares used across the gateway.
server
Package server wires dependencies and builds the HTTP handler container.
Package server wires dependencies and builds the HTTP handler container.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL