> ## Documentation Index
> Fetch the complete documentation index at: https://nuggets.life/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Authentication

> Model Context Protocol authentication integration. Add secure identity verification to MCP servers using OIDC with QR code authentication flows.

<video controls className="w-full aspect-video" src="https://mintcdn.com/nuggets-b89005a2/nUdoZWSc5gGcRIEv/assets/mcp-chat.mp4?fit=max&auto=format&n=nUdoZWSc5gGcRIEv&q=85&s=276411525061d8485c75a783e002e622" data-path="assets/mcp-chat.mp4" />

<Card title="Demo" icon="github" href="https://github.com/NuggetsLtd/ai">
  See an example of Nuggets authentication within an MCP server.
</Card>

If you're running an MCP server and want to add secure, verifiable authentication
to your chat, Nuggets makes this easy using **OpenID Connect (OIDC)**.

With Nuggets, users authenticate by scanning a QR code with their mobile app, proving specific attributes (e.g. identity, role, age) using Verifiable Credentials. This brings strong identity into the chat experience—without relying on usernames or passwords.

#### How to Integrated Nuggets into My MCP Server

To get started, create an **OIDC Application Client** in the Nuggets Account Portal. Here you will receive:

* A **Client ID**
* A **private key** for signing requests
* The ability to configure **redirect URIs** and **verifications**

Once set up, your MCP server simply:

1. **Generates an OIDC authentication request**
2. **Displays a QR code** in the chat UI
3. **Waits for the callback** to receive the `id_token`
4. **Verifies the token**, extracts the claims, and authenticates the user in chat

Here’s what makes it powerful:

* Strong identity based on Verifiable Credentials
* Seamless UX with QR-based login
* Custom claims in the token (like `did`, `role`, or other verified attributes)

<Warning>
  Make sure to securely store the private key.
</Warning>

If you're already running OIDC flows in your backend, this plugs in with minimal changes. And if not, Nuggets provides everything you need to get started securely.
