Lab 3E -- Real MCP Server

MCP Server for Claude Code

This is a real Model Context Protocol server that Claude Code can connect to. It demonstrates the OAuth confused deputy attack with actual MCP client software.

How it works:

  1. Claude Code connects to this server via SSE at /sse
  2. Server requires OAuth authentication through the gateway
  3. Gateway forwards to Kanidm (the real IdP)
  4. Authorization code flows back through the gateway

The Vulnerability:

If the gateway doesn't validate redirect_uri, an attacker can intercept the authorization code meant for Claude Code's localhost callback.

Configuration for Claude Code:

{
  "mcpServers": {
    "lab-mcp-demo": {
      "url": "http://localhost:8094/sse",
      "transport": "sse",
      "oauth": {
        "authUrl": "http://localhost:8094/oauth/start",
        "tokenUrl": "https://mcp-gateway.lab.quokkahost.com/token"
      }
    }
  }
}

Health Check