Skip to content

jpdlr/mcp-gateway

Repository files navigation

MCP Gateway

Local gateway/control-plane MCP server for managing MCP server registry, project-scoped auth, and per-project tool access policies, now with a React dashboard.

What it does

  • Registers MCP servers (stdio or http) in a local gateway state file
  • Issues scoped tokens for clients/agents
  • Enforces project-level allow/deny tool policies
  • Exposes management actions as MCP tools so Codex/Claude/Hydra can self-serve under policy

Exposed MCP tools

  • gateway_list_servers
  • gateway_register_server
  • gateway_remove_server
  • gateway_set_policy
  • gateway_list_policies
  • gateway_issue_token
  • gateway_list_tokens
  • gateway_check_access

Quick start

npm install
npm run build
npm run dev

By default, state is stored at:

  • ./data/gateway-state.json

Override with:

  • MCP_GATEWAY_STATE_PATH=/absolute/path/state.json

Dashboard (M3 expressive UI)

The dashboard is a React + Vite app with tokenized theming (light default, dark secondary) and card-based MD3-inspired layout.

Run in development

Terminal 1 (API):

npm run dashboard:api

Terminal 2 (UI):

npm --prefix dashboard install
npm run dashboard:dev

Open:

  • http://127.0.0.1:5174

The Vite dev server proxies /api/* to http://127.0.0.1:4311.

Build dashboard

npm run dashboard:build

To serve built static files from the API server:

npm run dashboard:api

If dashboard/dist exists, it is served automatically.

Example policy model

  • Project hydra can allow git.* and fs.read
  • Explicit deny can block dangerous operations like git.push
  • Tokens can be limited to one project or *

Scripts

  • npm run dev - start MCP server over stdio
  • npm run dashboard:api - start dashboard HTTP API (and static files when available)
  • npm run dashboard:dev - start dashboard Vite dev server
  • npm run dashboard:typecheck - dashboard TypeScript validation
  • npm run dashboard:test - dashboard component + flow tests
  • npm run dashboard:build - dashboard production build
  • npm run typecheck - TypeScript validation
  • npm test - gateway unit/integration tests
  • npm run build - compile to dist/

Security notes

  • Tokens are stored locally in plaintext in the state file for MVP use
  • Use filesystem permissions and avoid sharing the state file
  • Layer this behind your own host-level auth if exposed beyond localhost

License

MIT

About

Local MCP control plane with server registry, token auth, project policies, and an expressive React dashboard.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors