Log in with Didit
The hosted server (https://mcp.didit.me/mcp) is an OAuth 2.1 resource server. The Didit Business Console (business.didit.me) is the authorization server that hosts the consent screen and issues tokens. Your MCP client drives the standard flow automatically:
1
Discover
The client posts to That document names the resource (
/mcp without a token and gets 401 with a WWW-Authenticate: Bearer header whose resource_metadata points at the protected-resource metadata (RFC 9728):https://mcp.didit.me/mcp), the authorization server (https://business.didit.me) and the supported scopes. The same document is also served at the origin root, https://mcp.didit.me/.well-known/oauth-protected-resource, for clients that probe there first.2
Register (dynamic client registration)
The client reads the authorization server’s metadata at
https://business.didit.me/.well-known/oauth-authorization-server and, if it has no client id yet, registers itself at the registration_endpoint (RFC 7591). There is nothing to pre-provision on your side: local clients with a loopback or native callback (Claude Code, Cursor, MCP Inspector) and cloud-hosted clients with a reviewed callback (Claude) both register this way. A client that cannot open a browser registers for the device grant instead (see Sign in without a browser). A remote callback URL Didit has not reviewed is refused with invalid_redirect_uri; that client needs an operator to register it first.3
Authorize (PKCE)
The client opens
https://business.didit.me/authorize with an S256 PKCE challenge. You sign in (or register) and see exactly which permissions are requested. Clients are public: the token endpoint accepts no client secret (token_endpoint_auth_methods_supported is none), so PKCE is what binds the code to the client.4
Consent
You approve. The console mints a session for that app, bound to the scopes you approved, and returns an authorization code, which the client exchanges at the
token_endpoint for an access token and a refresh token.5
Call tools
The client sends the access token with every request. The MCP validates it with RFC 7662 token introspection against the Didit auth service (the tokens are opaque, not JWTs), reads your organization permissions from the introspection response, and acts as you for the duration of that request.
Scopes
The resource metadata advertises three scopes. The consent screen shows the ones a client asks for in plain language:
Both scopes include
analytics. Managing lists requires didit:management; accessing blocklist requires didit:verification.
The tools reference lists the scope each tool falls under. The scopes you approve are carried on the token and enforced server-side, so an app connected with didit:verification alone is refused on the management surface even when your own role would allow it. The authorization server also knows the OpenID scopes (openid profile email); a connection that requests only those can tell who you are and nothing else.
An app’s effective permissions are the intersection of the approved scopes and your console role — never the wider of the two.
To create a verification session with didit_session_create, you need the didit:verification scope and a role with create:sessions or write:sessions. The Developer role includes create:sessions. Approving didit:management alone does not allow session creation, even if your role has the required permission.
Roles and permissions
The hosted token represents you, so the agent can work across every organization you belong to in a single connection — the cross-app tools (didit_session_search, didit_analytics, didit_context_get, and the other *_search tools) aggregate over all of them automatically.
Your role is always enforced by the Didit backend, per organization. Each tool maps to one backend permission string (for example write:sessions for didit_session_update_status, delete:sessions for didit_session_delete); the tools reference shows it per tool. The server also checks that permission before it sends the request, using the permissions the introspection response carries for your organization:
- In
enforcemode a tool your role cannot run is left out oftools/list, and calling it anyway returns amissing_scopeerror that names the permission ("Your role in this organization does not include the permission 'delete:sessions' that didit_session_delete requires."). - In
shadowmode (the server default) every tool is listed and the call goes through to the backend, which answers403when the role lacks the permission; the verdict is only recorded in the server’s audit log.
READER can list and read; an OWNER or ADMIN can write and delete.
Token lifetime
An approved app gets its own session, separate from the browser session you approved it from. Access tokens are short-lived; the client refreshes them silently with the refresh token (grant_types_supported includes refresh_token), and a refresh keeps the app’s scopes and stays bound to that app. If a refresh fails (for example after you disconnect the app), the client re-runs Log in with Didit on the next call.
Signing out of the console does not sign out connected apps, and disconnecting an app never signs you out anywhere.
Disconnecting an app
1
From the console
Settings → Authentication → Connected apps lists every app you have approved, with its registered name and the permissions it was granted. Disconnect ends that app’s access immediately: both its access token and its refresh token stop working, and nothing else is affected.
2
From the app (RFC 7009)
A client can hand its own access back by posting the token to the authorization server’s
revocation_endpoint, advertised in the metadata at https://business.didit.me/.well-known/oauth-authorization-server. As RFC 7009 requires, a successful call answers 200 whether or not the token was still live, so the response never tells you whether a token was valid. A 503 means the revocation could not be applied: treat the token as still valid and retry.API keys and a signed-in connection.
didit_org_list_api_keys shows key metadata with the values redacted; the tool that reveals a raw key is hidden on the hosted connector.
When the integration you are building needs a key, didit_org_create_api_key creates one for it: one key per connected app and application, scoped to what you can do (never full access or key management), rate-limited and audit-logged, with the secret returned once.
The key is listed with the connected app in Account settings, and disconnecting the app revokes it.Sign in without a browser (device code)
Didit supports the OAuth 2.0 Device Authorization Grant (RFC 8628) for MCP clients and coding agents that run where no browser is available: Claude Code or Codex on a remote machine over SSH, a CI job, a container, or any terminal MCP client. The client shows a short code and a URL, and you approve it from any device that has a browser, such as your laptop or phone. The approval is the same consent as in the browser flow: same scopes, same organization choice, same role limits.The hosted server at
mcp.didit.me signs in through the browser. Device code is for clients that run the sign-in themselves, such as the local server below, and for any client you build against the authorization server.With the Didit MCP local server
1
Start the sign-in
On the machine without a browser, run:The command prints the URL (
https://business.didit.me/device) and an 8-character code such as WDJB-MJHT, then waits for your approval.2
Approve on any device
Open
business.didit.me/device (or the complete URL the command prints) in a browser and sign in if needed; the code is kept through sign-in. Type or paste the code, check which app is asking, then choose your organizations and approve.3
Use the server
The command stores the credentials in
~/.config/didit/mcp-credentials.json (file mode 0600) and exits. From then on the local stdio server (npx -y @didit-protocol/mcp-server) uses them and refreshes them on its own.npx -y @didit-protocol/mcp-server logout revokes the credentials and deletes the file.
An agent can also run the sign-in from the conversation with two tools that exist only on the local server: didit_account_device_login_start returns the URL and code to show you, and didit_account_device_login_poll waits for your approval and stores the credentials. The hosted server does not offer them.
What you see on the approval page
The page atbusiness.didit.me/device shows which app is asking, the device name, when and from where the request was made, and the code itself, with the line Approve only if this code matches the one in your terminal. After you approve, it says You can go back to your terminal. This page can be closed.
Security
- The device grant gets exactly the same scopes, organization choice and role limits as the browser consent. The scopes are capped by your role.
- Five wrong codes lock code entry for that account for 15 minutes.
- Device requests are rate-limited per network.
- A code expires after 10 minutes and can be approved once: one approval issues one grant.
- The connection appears with your other apps under Account settings → Connected apps and under Developers → MCP and agents, and you can revoke it there. The client can also revoke its own refresh token at the
revocation_endpoint(RFC 7009).
Build a device client
A device client is public: it has no secret. It registers at theregistration_endpoint with no redirect_uris, then asks for a code, shows it to the person and polls the token endpoint.
device_authorization_endpoint (https://business.didit.me/api/auth/oauth-device-authorization). A client registered only for the authorization code grant cannot use the device grant (unauthorized_client), and the reverse is also true.
Device authorization request (POST /api/auth/oauth-device-authorization, form or JSON):
Response:
Errors:
invalid_client, unauthorized_client, invalid_scope and invalid_request. A network that sends too many requests gets HTTP 429 with slow_down and a Retry-After header.
Polling (POST /api/auth/oauth-token) answers with these errors until the person decides:
On approval the response carries
access_token, refresh_token (only for a client that registered refresh_token), token_type (Bearer), expires_in and scope.
Troubleshooting device sign-in
The code expired
The code expired
A code lives 10 minutes (
expired_token). Run the command again to get a new one.The page says the code is wrong
The page says the code is wrong
Check the 8 characters against your terminal. The dash and the case do not matter, and the alphabet has no
0, O, 1, I or L. Five wrong codes lock code entry for your account for 15 minutes.The client reports access_denied
The client reports access_denied
The request was denied on the approval page. Run the command again and approve it.
The client reports slow_down or HTTP 429
The client reports slow_down or HTTP 429
Poll no faster than
interval, and add 5 seconds after each slow_down. A 429 with Retry-After means this network sent too many device requests: wait that long.Sign in with the account tools (local server)
On the local server an agent can also sign in by itself with an email address and a password. Usedidit_account_login for an existing account, then didit_account_verify_2fa when the account has an authenticator app.
Use didit_account_register and didit_account_verify_email for a new account.
The local server keeps that sign-in, so the tools that follow are authenticated with nothing passed between them.
- The sign-in is kept in the same credentials file as a device code sign-in (
~/.config/didit/mcp-credentials.json, readable by you only) and refreshed before it expires. A server you start later picks it up. - The answer of these tools carries no refresh token. The server holds it, because a refresh token works once.
- When the file cannot be written, for example in a container with a read-only home directory, the sign-in is kept in memory until the server stops.
- If you signed in both ways, the server uses the more recent sign-in.
DIDIT_ACCESS_TOKEN, when set, takes precedence over both. npx -y @didit-protocol/mcp-server logoutremoves the sign-in from the machine.- An account that signs in with a passkey or SSO has no password: use the device code.
Connect with an API key (headless agents and CI)
An agent that runs with no person present has no browser to sign in with. It connects to the hosted server with the application API key it already sends to the Didit API, in thex-api-key header.
- Claude Code
- Cursor
- Any client or your own agent
.mcp.json in your project:DIDIT_API_KEY from the environment each time it connects, so the key itself is never written to the file.What an API key connection is
- One application.
The connection acts on the application the key belongs to, so there are no ids to pass.
didit_context_getnames the application, says whether it isliveorsandbox, and reportsconnection.type: "api_key". A call that names another organization or application is refused. - The key’s own access. The key is forwarded to the Didit API exactly as on a direct API call, and the API decides what it may do. Give an agent a scoped key with an expiry instead of a full-access key.
- Sandbox first. Connect with the sandbox application’s key to build and test: every check is simulated and nothing is billed.
- Works with toolsets and read-only mode.
For example
https://mcp.didit.me/mcp?toolsets=core&read_only=true. - Revoked like any key. Revoke or rotate the key in the Business Console and the connection stops within a minute. Every tool call is logged with the key’s id, never the key.
What needs a person
These tools are neither listed nor run on an API key connection:- members, roles and API key management;
- the organization’s plan, cards, receipts and billing details;
- the audit log, and
didit_workflow_build_graph(usedidit_workflow_create, or the graph toolsdidit_workflow_create_draft,didit_workflow_validate_graphanddidit_workflow_set_graph); - download links for session PDFs and signature files (request the file from the Didit API with the same key).
A key limited to specific IP addresses is refused, because the Didit API would see the MCP server’s address and not yours.
Use a key without an IP limit for the MCP.
From nothing to a first verification, with no browser
1
Create the account
On the local server, call
didit_account_register, then didit_account_verify_email with the code sent to the email address.
The answer carries the new organization with its live and its sandbox application, each with its API key, and the local server is signed in from that moment.2
Build in the sandbox
In the same conversation, create a workflow with
didit_workflow_create and a session with didit_session_create, passing the sandbox application’s id.3
Run it anywhere
Store the keys in your secret store.
Connect your agent or CI job to the hosted server with the sandbox key, and switch to the live key to go live.
4
Keep an eye on credit
didit_org_get_balance reads the credit balance.
When credit is needed, see Transport and endpoints for the payments endpoint and agent top-ups.Connecting from each client
Every client runs the same flow; only the way you give it the URL differs.- Claude
- Claude Code
- Cursor
- Generic client
Use the deep link the Business Console shows on its integrate page. It opens claude.ai with the Add custom connector dialog pre-filled:Confirm, then complete Log in with Didit. Claude Desktop uses the same URL under Settings → Connectors → Add custom connector. Details on Connect Claude.
Auth failures
401 from /mcp means the token is missing, expired or was revoked: the client should refresh or run Log in with Didit again.
On an API key connection a 401 means the key is invalid, revoked or expired, or limited to specific IP addresses; the error_description says which.
A 403 there means the key’s access does not cover the action, or the action needs a person.
A 403 or a missing_scope error on a specific tool usually means either your role lacks that permission (e.g. a READER attempting a write) or the connection was approved without the scope that tool needs — not that the whole connection is broken. Reconnecting and approving both scopes fixes the second case; the first needs a role change.
If every tool fails, check Settings → Authentication → Connected apps in the console: an app that was disconnected there has to be approved again.
Tools reference
What each tool does, its scope and its role permission.
Advanced
Roles, cross-app behavior, and self-hosting.