MCP · Sign-in

Should I connect MCP with OAuth or with an API key?

Use OAuth, the sign-in through the browser, wherever your assistant supports it: you copy no secret, and access renews itself until 90 days after your "Allow". Use the API key, called "key" in the app, for scripts and software without a browser. It lasts 90 days and is shown only once.

30 dagen proberen, geld terug
Simon OrzelCory Hisey

Gesprek boeken

Simon OrzelSimon Orzel·

When do I use OAuth, and when the API key?

OAuth, wherever the client supports it. Claude Code, Claude on the web and desktop, Copilot Studio and ChatGPT describe the browser sign-in in their guides; according to OpenAI, ChatGPT cannot send a key.

So far we have tested Claude Code, both ways.

The API key for scripts, your own agents and software that cannot open a browser. Keep it in an environment variable or a password manager, in no file you share or put in a repository.

How does the OAuth sign-in work?

The assistant opens your instance's sign-in page. You sign in, see which assistant asks for which company and where the browser returns to, and click "Allow".

OAuth is the way for software to sign in on your behalf without seeing your password. The walkthrough uses OAuth 2.1 with PKCE: only the client that started the sign-in can collect the access.

The client registers itself along the way (Dynamic Client Registration). The instance is its own sign-in service, so even when self-hosted no third party is involved.

How long does the OAuth sign-in last?

The assistant gets two tokens, passes with an expiry date. It calls the walkthrough with the access token, which lasts an hour. With the refresh token it gets a new one, and every renewal also replaces the refresh token, which lasts 30 days.

If the same refresh token comes in again within a minute, the server still accepts it. That happens when a client renews twice at once, or an answer is lost on the way.

If it comes in again later, the server treats it as copied and disconnects every assistant of that person, the key included. If the original and a copy both renewed within that minute, it shows once both renew again.

At the latest 90 days after your "Allow", the sign-in ends, however often the assistant renewed. Then you allow it again.

How does the API key work?

In Settings, "Create key" makes a key. It is shown only at that moment and stored nowhere, so the app cannot show it again.

It lasts 90 days, as you and with your role, in the company that was open when you made it. The client sends it in the Authorization header as Bearer.

You hold one key per company. A new one ends the previous key; assistants that signed in through the browser stay connected.

Why do both ask for a recent sign-in?

Both survive signing out of the browser: an assistant stays connected even after you sign out. That is why "Create key" and "Allow" ask for a sign-in from the last 15 minutes.

With an older session the page sends you to sign in and then brings you back.

The app tells you by email about every new connection. If it was not you, disconnect all assistants and change your password.

What ends a connection?

"Disconnect" in Settings ends one connection at its next call. "Disconnect all assistants" and any change to your password end the key and every browser sign-in at once.

If you leave the company or are removed, both end for good. If an admin turns off "Allow AI assistants for this company", every member's connections end. Our article on revoking MCP access has the details.

How the walkthrough does it

How people sign in is itself an item of the walkthrough.

11.1 "Record where a second factor protects": for each program and access on your list, the item records how people sign in: password only, with a second factor and which one, or not known yet.

A connected assistant can fill this in. Each row starts at "Password only", the safe assumption; give it a source, such as an overview from your account administration, and have it choose "Not known yet" where the source shows nothing.

List the assistant itself in 2.2 under "Software everyone uses", and 11.1 then also asks how you sign in to it.

Every screen an assistant wrote shows its name and the day; you finish 11.1 in the app.

Common questions

Does the MCP server support Dynamic Client Registration or CIMD?

Only Dynamic Client Registration under RFC 7591: the client registers itself at its first sign-in. Client ID Metadata Documents (CIMD), a published document a client identifies itself with, are not supported by the sign-in service. That is why you choose "Register automatically" in Claude.

Can I connect several assistants at once?

Yes. Each browser sign-in is a connection of its own, plus one key per company. Settings lists them all under "Connected", with the day each was connected and last used, and each can be disconnected on its own.

What happens after 90 days?

The key stops working; create a new one and enter it in the client. A browser sign-in ends 90 days after "Allow", and then you allow the assistant again.

Does an API key work for several companies?

No. It works in the company that was open when you made it. For another company, switch in the app and create a key there.

Read next

Sources

  • MCP specification 2026-07-28, Authorization and Security Considerations, modelcontextprotocol.io
  • RFC 7636 (PKCE) and RFC 7591 (Dynamic Client Registration), rfc-editor.org
  • open-isms, lib/mcp/oauth.ts and lib/mcp/key.ts, github.com/NISD2/open-isms
  • open-isms, lib/auth/session-age.ts and lib/auth/credential-change.ts, github.com/NISD2/open-isms
  • open-isms, MCP server documentation, content/docs/self-hosting/mcp.md, github.com/NISD2/open-isms

In de praktijk

Waar dit in de begeleide doorloop terugkomt

De begeleide doorloop maakt hier stappen van die u invult, met de wet bij elke stap uitgelegd. Open een stap om het scherm te zien, ingevuld voor een verzonnen bedrijf.

De doorloop zelf is in het Duits en het Engels.

  1. Authentication & Communications

    Record where a second factor protects

    For each program on your list: password alone, or with a second factor.

Wat de doorloop kost

NIS2 begeleide doorloop
Begeleide implementatie op nisd2.eu.

€ 4.800 netto per jaar, excl. btw

30 dagen geld terug

Op factuur, betaling binnen 30 dagen. Opzeggen in de eerste 30 dagen: factuur geannuleerd of geld terug.

Begeleide NIS 2 implementatie, stap voor stap

Een geschiedenis van wijzigingen en goedkeuringen, om aan uw toezichthouder te tonen

Deadlines en herinneringen per vereiste

Beveiligingsvragenlijst voor uw leveranciers

Export naar PDF of CSV, op elk moment

Prijzen en voorwaarden

Moet u zich met NIS2 bezighouden?

We begeleiden u stap voor stap. U vult in, wij leggen elk punt in eenvoudige woorden uit, en aan het eind tekent de directie.

30 dagen proberen, geld terug
Simon OrzelCory Hisey

Gesprek boeken

Gratis training voor uw bestuurderPrijzen en voorwaarden
De NIS2-doorloop: uw pad stap voor stap, de eerste punten afgerond