MCP gateway with OAuth, IdP groups RBAC, and SIEM logging
You are helping me build an MCP Gateway, an internal service that puts one governed front door in front of all of our corporate tools' MCP servers. ## What the gateway is The gateway is itself an MCP server. Clients (Claude Code, Cursor, scripts, etc.) connect to the gateway; the gateway connects to the real MCP servers behind it. Because it sits in the middle of the JSON-RPC stream, it can enforce identity, filter tools, and log every call. Flow: client --connect--> gateway (OAuth via IdP: SSO + device trust + group) client --tools/list--> gateway looks up user's groups, forwards to real servers, returns a FILTERED list (unauthorized servers/tools are invisible, not just blocked) client --tools/call--> gateway checks the call is allowed for this user, forwards to the real server, logs everything (user, server, tool, arguments, response) to our SIEM, returns the result ## MVP scope (build in this order) 1. **OAuth against IdP** for inbound client auth. Enforce group membership at the login hop. 2. **Server registry.** A registered-servers config/store. A server does not exist to clients until it's registered. Each entry: upstream URL, auth to the upstream, which IdP groups may see it. 3. **Passthrough proxy.** Full MCP JSON-RPC proxying to registered upstream servers, preserving the protocol faithfully (initialize, tools/list, tools/call, notifications, errors). 4. **Payload logging** of every tools/call (user, server, tool, arguments, response) shipped to our SIEM. Users must not be able to disable it. 5. **RBAC + tool filtering.** Filter each user's tools/list by their IdP groups. Reject tools/call for denied tools. Support name-pattern blocklists (e.g. block create_*/delete_*, allow get_*/list_*).
What this prompt builds
An MCP Gateway that sits between AI clients (like Claude Code) and enterprise MCP servers, enforcing OAuth authentication, role-based access control via IdP groups, and comprehensive audit logging. The gateway filters available tools based on user group membership, proxies requests to upstream MCP servers, and sends all interactions to a SIEM. IT teams can manage tool allowlists, user agent restrictions, and access policies through an admin panel.
The problem
Enterprise tools are rapidly adding MCP server features that extend agentic AI tools like Claude Code, but IT teams face a critical security gap: most MCP implementations lack role-based access control and audit logging. Without these controls, enabling MCP features exposes sensitive corporate tools to unmonitored, unrestricted access. Teams need a governed front door that enforces identity, filters capabilities by role, and logs every interaction before they can safely unlock MCP's potential across their organization.
Solution and impact
This gateway solves the problem by acting as a security-enforced proxy between AI clients and corporate MCP servers. Users authenticate via OAuth with device trust and group-based access policies enforced by the organization's IdP. The gateway then filters which MCP tools each user can see and use based on their IdP group memberships, proxies allowed requests to upstream servers, and logs every authentication, tool call, and admin change to the company's SIEM. IT teams gain a central admin panel to allowlist tools per group, control client access, and maintain full visibility—enabling secure, compliant adoption of MCP across the enterprise.