Run a multi-tenant MCP gateway for different teams
何时使用: Design and Eng need different MCPs, but you don't want to run two gateways.
前置条件
- A host with Node 20+ or Docker — Any small VM
- OAuth IdP (or use built-in for local) — Dex, Auth0, Okta — anything that speaks OIDC
步骤
-
Define scopes in the agent configDraft an agent config where 'design' scope exposes figma and davinci-resolve MCPs, 'eng' scope exposes github, sentry, postgres.✓ 已复制→ Config with scoped upstream mappings
-
Wire OAuthConnect the agent to our Auth0 tenant, map groups to scopes.✓ 已复制→ Users see only their scope's tools
-
Audit usageShow me the last 24h of tool calls by user, grouped by tool name.✓ 已复制→ Usage report
结果: One gateway, per-team tool views, full audit trail.
注意事项
- Scope design gets spaghetti fast — Start with 2-3 broad scopes (eng-read, eng-write, design) rather than per-tool scopes
- Audit logs balloon disk usage — Rotate logs weekly or ship to a log aggregator