Third-party integrations

MCP

Connect an existing OAuth-enabled MCP server to a wallet-backed Keycloak realm.

Use your MCP server's existing OAuth support with Keycloak. Keycloak connects to the Ver.iD platform; Yivi is the example wallet.

What you need

First prepare your organization in Ver.iD Studio.

  • An HTTPS MCP server with built-in OAuth resource-server support and Protected Resource Metadata.
  • An MCP client that supports Authorization Code, S256 PKCE and a pre-registered client ID.
  • Keycloak 26.8.1, configured using the Keycloak guide.

The field names depend on your MCP product. Its OAuth support must accept an external authorization server and enforce issuer, resource audience, expiry and scopes. MCP transport support alone is insufficient.

Configure Ver.iD

Add Keycloak's callback URL in Ver.iD Studio → Verify → Authentications → your flow → Redirect URIs: <keycloak-base-url>/realms/<realm>/broker/verid/endpoint. See Add redirect URIs. Your application callback is configured separately on its Keycloak client.

Configure Keycloak

Apply the verified-contact post-login flow to the Ver.iD provider so both requested contacts and their verification flags are required before account access.

  1. Complete the Keycloak guide for provider verid and the Studio wallet authentication. Keep the requested wallet claims at the broker; the MCP access token needs no email or phone.
  2. Register your MCP client with its exact callback. For a native public client, set Client authentication = Off, Standard flow = On and PKCE method = S256. Disable Implicit flow and Direct access grants. Use a separate confidential registration for a server-side client.
  3. Create an Audience mapper for the client. Set Included Custom Audience to the MCP server's canonical resource URL; enable Add to access token. Assign only basic and the client scopes required by the server. Remove unrelated profile, email and phone scopes and disable Full scope allowed.
  4. For wallet-only login, create a Basic flow containing Identity Provider Redirector as Required, with Default Identity Provider = verid. Select it under the client's Authentication flow overrides → Browser Flow.

Configure the MCP server and client

Use the server's built-in OAuth settings:

SettingValue
Authorization-server issuer<keycloak-base-url>/realms/<realm>
Discovery<keycloak-base-url>/realms/<realm>/.well-known/openid-configuration
Resource / expected audienceYour exact canonical HTTPS MCP resource URL
Required scopesThe scopes assigned to this server's tools
Token validationThe server's built-in signature validation or authenticated introspection

Configure the MCP client with that resource URL, its own registered client ID and exact callback. Use its private credential storage for a confidential client secret. Keep tokens out of prompts, tool arguments and logs. If the client requires dynamic registration, use its documented pre-registration option; these instructions use static registration.

Test the connection

Connect from the MCP client, follow the browser login through Keycloak and approve the wallet request in Yivi. Confirm that an authorized tool call succeeds. A missing, expired or wrong-audience token must be rejected; cancelling login must not authorize a call.

No particular tool or tool-response format is required by this integration. Follow the MCP authorization specification for your product's OAuth settings.

On this page