Content
MCP Gateway
This is a local-only MCP gateway. You can register servers, manage profiles, and start/stop through the browser UI, and connect from the MCP client via a single connection through the `/mcp` WebSocket (specifying serverId or profile).
## Setup / Execution
```bash
pnpm install
pnpm --filter mcp-gateway-ui run build
pnpm start # http://127.0.0.1:8787
# Optional: You can pass --port=8787 --host=127.0.0.1 --data-dir=/path/to/data to cli.js
```
## Connection from MCP Client
- Specify by Server ID
`ws://127.0.0.1:8787/mcp?serverId=<ServerID>`
Example: `claude mcp add mcp-github --url ws://127.0.0.1:8787/mcp?serverId=github-mcp`
- Specify by Profile Name (connect to the first server of that profile)
`ws://127.0.0.1:8787/mcp?profile=<ProfileName>`
Example: `claude mcp add mcp-dev --url ws://127.0.0.1:8787/mcp?profile=dev`
## Sample Registration (Optional)
The initial state is empty. If you want samples, please add them via command.
```bash
pnpm init:samples # github-mcp (port 9000), fs-mcp (port 9001), add default/dev profiles
pnpm init:samples -- --force # If you want to overwrite existing ones
```
## Features
- MCP server registration/editing/deletion (command/args/env, autoStart)
- Profile creation/deletion/switching (multiple can be active simultaneously). Automatically start autoStart servers of active profiles
- Manual Start/Stop, logs are in `~/.mcp-gateway/logs/<id>.log`
- State saved: `~/.mcp-gateway/state.json`
- MCP Proxy: Switch serverId/profile via `/mcp`
## API Endpoints
- `GET /api/health`
- `GET /api/state`
- `GET /api/servers`
- `POST /api/servers`
- `PUT /api/servers/:id`
- `DELETE /api/servers/:id`
- `POST /api/servers/:id/start`
- `POST /api/servers/:id/stop`
- `GET /api/profiles`
- `POST /api/profiles`
- `PUT /api/profiles/:name`
- `DELETE /api/profiles/:name`
- `POST /api/profiles/:name/activate`
- `POST /api/profiles/active` (names: string[])
- `POST /api/reload`
- `GET /api/status`
- `GET /api/logs/:id?lines=200`
## Testing
```bash
pnpm test
```
## Directory
- `src/` : Server body, CLI, storage, process manager, WebSocket proxy
- `ui/` : Vite + React + shadcn UI
## Note
- `pnpm install` is required only for the first time. It will work offline afterwards.
- Please register `/mcp?serverId=...` or `/mcp?profile=...` from Claude and others.
Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
servers
Model Context Protocol Servers
terminal-mcp
A terminal emulator exposed via MCP for AI assistants
mighty-security
Don't Simply Trust MCP Server Code, Validate and Scan
api2mcp4j
This is a revolutionary AI MCP plugin with excellent pluggable and...