waldur-helm

Packaging of Waldur as Helm application

View on GitHub

Remote MCP server

AI agent clients connect to /mcp on the API host over the Model Context Protocol and read Waldur data as the signed-in user. They sign in with OAuth, or with a personal access token. A separate waldur-mastermind-mcp Deployment runs waldur mcp_server; the API serves the OAuth endpoints.

Enabling

waldur:
  mcp:
    enabled: true
    replicas: 1
    # Threads that run database calls, each holding one Postgres connection.
    dbThreads: 4
    resources: {}

Then turn on the MCP_ENABLED setting, in the admin UI or through waldur.settingsOverrides. Until then, /mcp and the OAuth endpoints answer 404.

The chart then:

What the pods get

The MCP pods face the internet, so they get less than the API pods:

Every mastermind pod mounts the same settings file, so secrets the chart writes into it reach the MCP pods too:

The pods run as the image’s waldur user. The chart sets no runAsNonRoot: the image names that user rather than a UID, which the kubelet can’t check.

Database connections

Each MCP pod holds up to dbThreads Postgres connections. replicas × dbThreads counts against Postgres max_connections, on top of the API and Celery pods.

CORS

Browser-based MCP clients call these routes from their own origin. Clients that call /mcp from a server or a desktop app don’t need CORS.

IP allow-listing

On the Ingress path, ingress.whitelistSourceRange covers the MCP routes as it covers the API. On the Gateway API path, an allow-list policy in gatewayAPI.extraPolicies covers only the routes it targets: add mcp-httproute and mcp-oauth-httproute next to api-httproute, or /mcp and the OAuth endpoints stay open to everyone.

Behind more than one proxy

The throttle on new OAuth clients keys on an X-Forwarded-For entry, as the limit on failed passwords does. waldur.trustedProxyCount sets both; see IP whitelisting.

Checking it

With MCP_ENABLED on, the resource metadata names the seeded URL:

curl -s https://<apiHostname>/.well-known/oauth-protected-resource/mcp
# {"resource": "https://<apiHostname>/mcp", "authorization_servers": [...], ...}

A request to /mcp without a token answers 401, with a WWW-Authenticate header that points at that metadata.