The Middleware Layer for your AI tools.
As AI clients multiply (Claude, Cursor, IDEs) and MCP servers proliferate (GitHub, Postgres, Slack), direct connections create an NΓM fragmentation problem. Debugging is a nightmare, security is an afterthought, and context overload degrades model performance.
Local MCP Gateway is the Control Plane that solves this. It acts as a central hub where you configure your MCP servers once and expose them through curated Profilesβgiving each AI assistant exactly the tools it needs, nothing more.
Local First: Your data and tools stay under your control. No cloud dependency, no SaaS API keys.
Run Local MCP Gateway instantly without cloning the repository:
curl -fsSL https://raw.githubusercontent.com/DXHeroes/local-mcp-gateway/main/docker-compose.hub.yml \
-o local-mcp-gateway.yml && \
docker compose -f local-mcp-gateway.yml up -d --pull always- UI: http://localhost:9630
- MCP Endpoint: http://localhost:9631/api/mcp/default
- Data: Stored in
~/.local-mcp-gateway-data/
To stop: docker compose -f local-mcp-gateway.yml down
For more details, see Docker Quick Start Guide.
- π Proxy & Aggregator: Combine multiple MCP servers (stdio, SSE, remote) into one
- π οΈ Custom MCP Support: Write your own MCP servers in TypeScript with hot-reload
- π Security: Built-in API Key management and OAuth 2.1 support
- π Observability: Real-time request/response logging and inspection
- π₯οΈ Web Interface: Modern UI to manage servers, profiles, and logs
- π³ Docker Ready: Easy deployment with Docker Compose
or you can use the default gateway API endpoint and change your profile dynamically in the MCP Gateway UI
2.1. Using the default gateway API endpoint that changes the profile dynamically according to the profile set in the UI
{
"mcpServers": {
"mpc_gateway": {
"type": "http",
"url": "http://localhost:9631/api/mcp/gateway"
}
}
}{
"mcpServers": {
"profile_development": {
"type": "http",
"url": "http://localhost:9631/api/mcp/development"
}
}
}{
"mcpServers": {
"profile_marketing": {
"type": "http",
"url": "http://localhost:9631/api/mcp/marketing"
}
}
}{
"mcpServers": {
"mpc_gateway": {
"type": "http",
"url": "http://localhost:9631/api/mcp/gateway"
}
},
"profile_marketing": {
"type": "http",
"url": "http://localhost:9631/api/mcp/marketing"
},
"profile_development": {
"type": "http",
"url": "http://localhost:9631/api/mcp/development"
}
}If you want to develop or build from source:
- Node.js 22+
- pnpm 9+
# Install dependencies
pnpm install
# Initialize database
pnpm db:seed
# Start development
pnpm devStart both backend and frontend with hot-reload:
pnpm dev- Backend: http://localhost:3001
- Frontend: http://localhost:3000
For Claude Desktop (HTTPS):
Start with HTTPS tunnel (using localtunnel):
pnpm dev:https- Backend: http://localhost:3001
- HTTPS Tunnel: Public URL (displayed in console) -> http://localhost:3001
- Frontend: http://localhost:3000 (configured to show the HTTPS tunnel URL)
Use the HTTPS tunnel URL in your mcp.json configuration to avoid SSL certificate errors in Claude Desktop.
pnpm build# Run all tests
pnpm test
# Unit tests only
pnpm test:unit
# Integration tests
pnpm test:integration
# E2E tests
pnpm test:e2e
# Coverage
pnpm test:coverageTo run the production build locally:
pnpm startThis will:
- Build the application.
- Start the backend on http://localhost:3001.
- Start the frontend on http://localhost:3000.
Data Persistence:
Data is stored in ~/.local-mcp-gateway-data (your home directory) to ensure it persists across restarts and updates.
Build and run from source using Docker:
docker compose up -d --buildThis provides:
- UI: http://localhost:3000
- Backend API: http://localhost:3001
- MCP Endpoint: http://localhost:3001/api/mcp/default
- Data: Stored in
~/.local-mcp-gateway-data/
- Run
pnpm dev:https - Copy the public HTTPS URL from the terminal (e.g.,
https://blue-sky-42.loca.lt) - Configure your
mcp.json:"My Profile": { "type": "http", "url": "https://blue-sky-42.loca.lt/api/mcp/my-profile" }
- AI Prompt: In the frontend (Profile page), copy the "AI Prompt" (TOON format) and paste it into your chat to give the AI full context about available tools.
local-mcp-gateway/
βββ packages/ # Shared packages
β βββ core/ # Core types and abstractions
β βββ database/ # Prisma ORM + SQLite
β βββ config/ # Shared configuration
β βββ ui/ # Shared UI components
βββ apps/ # Applications
β βββ backend/ # NestJS 11.x backend
β βββ frontend/ # React 19 frontend
βββ mcp-servers/ # MCP server packages (auto-discovered)
βββ docs/ # Documentation
- β Profile management
- β MCP server management
- β OAuth 2.1 support (PKCE, DCR)
- β API key management
- β MCP proxy endpoints per profile
- β Debug logging
- β HTTPS Tunneling for Claude Desktop
- β AI Prompt Generation (TOON format) for easy context sharing
Elastic License 2.0 - Free to use, modify, and distribute. Cannot be provided as a hosted service to third parties.

