Creates a provider that verifies Keycloak access tokens and maps their claims.
Keycloak server URL, realm, and resource-server settings. Defaults to v1 environment variables.
A provider that rejects tokens not issued for the resolved MCP resource.
An Error if the server URL or realm is missing, or a TypeError if either is invalid.
Error
TypeError
import { oauthKeycloakProvider } from "mcp-use/oauth/keycloak";const oauth = oauthKeycloakProvider({ serverUrl: "https://keycloak.example.com", realm: "production",}); Copy
import { oauthKeycloakProvider } from "mcp-use/oauth/keycloak";const oauth = oauthKeycloakProvider({ serverUrl: "https://keycloak.example.com", realm: "production",});
Creates a provider that verifies Keycloak access tokens and maps their claims.