Authn8 MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Authn8 MCP Server get me the 2FA code for AWS Production"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@authn8/mcp-server
MCP server for Authn8, shared 2FA for teams. It lets AI agents fetch TOTP codes for the 2FA accounts your team shares in Authn8, so an agent can finish a sign-in without anyone reading a code out of a phone. Every code it fetches is recorded in Authn8's access log with the name of the token that asked for it. An agent can also add a 2FA account from its secret, for example after it turns on 2FA for a new service, and put it in your team's groups.
Works with OpenAI Codex, Cursor, Claude Code, Claude, GitHub Copilot in VS Code and any other MCP client. Each one has a step-by-step guide at authn8.com/integrations.
Listed in the MCP Registry as
io.github.authn8/mcp-server.
Requirements
An Authn8 business on the Premium or Enterprise plan, which include MCP and the REST API. A business's tokens stop working if its subscription ends.
An MCP token. In Authn8, open Settings → Tokens and the MCP Tokens tab (how to create an MCP token). Tokens start with
pat_. A token only reaches the 2FA accounts its creator can already access, and you can narrow it further to chosen groups and give it an expiry date. It can add accounts to groups its creator owns or has Can manage access to, and a token narrowed to groups adds only to those.Node.js 18 or later, if you run the npm package. The hosted endpoint needs nothing installed.
Related MCP server: keywarden
Two ways to connect
Hosted endpoint | npm package | |
Install | None |
|
Transport | Streamable HTTP | stdio |
Address |
|
|
Token |
|
|
Both offer the same five tools: list_accounts, get_otp, whoami, list_groups
and add_account. Use the hosted endpoint unless your client only runs local
(stdio) servers: there is nothing to install or keep up to date.
Hosted endpoint
Point any MCP client that supports Streamable HTTP at https://api.authn8.com/mcp
and send your token in the Authorization header as Bearer pat_your_token_here.
Clients that read a config file can take the token from an environment variable, so
it never sits in the file. The examples below use AUTHN8_TOKEN:
# macOS and Linux (add to ~/.zshrc or ~/.bashrc)
export AUTHN8_TOKEN="pat_your_token_here"# Windows (PowerShell)
setx AUTHN8_TOKEN "pat_your_token_here"Open a new terminal, or restart your editor, after setting it.
OpenAI Codex
The Codex CLI and the Codex IDE extension share one config file,
~/.codex/config.toml. Let Codex add the server:
codex mcp add authn8 --url https://api.authn8.com/mcp --bearer-token-env-var AUTHN8_TOKENLeave AUTHN8_TOKEN as it is: --bearer-token-env-var takes the variable's name,
not the token. The command writes this table, which you can also add by hand:
[mcp_servers.authn8]
url = "https://api.authn8.com/mcp"
bearer_token_env_var = "AUTHN8_TOKEN"Type /mcp in Codex to see the server. If Codex was already running when you set
the variable, run codex app-server daemon stop and start Codex again, so its
background service sees the variable.
Codex asks before it calls an Authn8 tool, so codex exec and other runs with no one
to answer refuse the call. To let them read codes, approve get_otp:
[mcp_servers.authn8.tools.get_otp]
approval_mode = "approve"Cursor
Add this to ~/.cursor/mcp.json for all projects, or to .cursor/mcp.json in a
project. Cursor fills in ${env:AUTHN8_TOKEN} from your environment:
{
"mcpServers": {
"authn8": {
"url": "https://api.authn8.com/mcp",
"headers": {
"Authorization": "Bearer ${env:AUTHN8_TOKEN}"
}
}
}
}Cursor's cloud agents take the same URL, with the header
Authorization: Bearer pat_your_token_here, from the Cursor dashboard. The
Cursor setup guide also has an Add to
Cursor button.
Claude Code
claude mcp add --transport http --scope user authn8 https://api.authn8.com/mcp \
--header "Authorization: Bearer pat_your_token_here"--scope user makes the server available in all your projects. Leave it out to add
it to the current project only.
To share the setup through a repository, commit a .mcp.json that reads each team
member's own token from AUTHN8_TOKEN:
{
"mcpServers": {
"authn8": {
"type": "http",
"url": "https://api.authn8.com/mcp",
"headers": {
"Authorization": "Bearer ${AUTHN8_TOKEN}"
}
}
}
}Claude (claude.ai and the desktop app)
In Claude, click Plugins in the sidebar, then Add and Add custom
connector. Enter https://api.authn8.com/mcp as the server URL, choose No
sign-in under Authentication, and add a request header named authorization with
the value Bearer pat_your_token_here.
Request headers are a beta that only some Claude organizations have. Without them, run the npm package from Claude Desktop's config file (below).
On Team and Enterprise, an Owner adds the connector once and every member shares that one token.
Claude Code signed in with the same Claude account can use the connector too.
VS Code (GitHub Copilot)
Add this to Copilot's user MCP file, ~/.copilot/mcp-config.json. GitHub Copilot
CLI reads the same file.
{
"mcpServers": {
"authn8": {
"type": "http",
"url": "https://api.authn8.com/mcp",
"headers": {
"Authorization": "Bearer ${AUTHN8_TOKEN}"
},
"tools": ["*"]
}
}
}Other clients
Give the client the server URL and the Authorization header over Streamable HTTP.
For Gemini CLI, add this to ~/.gemini/settings.json (its httpUrl key means
Streamable HTTP):
{
"mcpServers": {
"authn8": {
"httpUrl": "https://api.authn8.com/mcp",
"headers": {
"Authorization": "Bearer pat_your_token_here"
}
}
}
}npm package
For clients that only run local (stdio) servers. The package calls the Authn8 REST API with your token and offers the same five tools.
Claude Desktop
Open Settings → Developer → Edit Config, or edit the file directly:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"authn8": {
"command": "npx",
"args": ["-y", "@authn8/mcp-server"],
"env": {
"AUTHN8_API_KEY": "pat_your_token_here"
}
}
}
}Quit and restart Claude Desktop after saving.
Claude Code
claude mcp add --env AUTHN8_API_KEY=pat_your_token_here --transport stdio --scope user authn8 \
-- npx -y @authn8/mcp-serverOther clients
Run npx -y @authn8/mcp-server as a stdio server with AUTHN8_API_KEY set.
Environment variables
Variable | Required | Default | Description |
| Yes | - | Your MCP token ( |
| No |
| API base URL |
On startup the server checks the token and prints the business name, token name, account count and expiry date to stderr. If the token is missing or rejected, it prints why and keeps running: clients can still list the tools, and every tool call returns that error until the token is fixed.
Tools
All tools declare an output schema and return structuredContent alongside the
text block, so clients get typed results without re-parsing JSON out of text.
list_accounts
Returns all 2FA accounts accessible to this token.
Example response:
{
"accounts": [
{
"id": "924c52a6-4457-4970-a39f-4dc620217683",
"name": "AWS Production",
"issuerDomain": "amazon.com"
}
]
}get_otp
Generates a TOTP code for a specific account.
Parameters:
account_id(string, optional): UUID of the accountaccount_name(string, optional): name or issuer domain to search for (case-insensitive partial match)
Provide either account_id or account_name. If more than one account matches
the name, the tool returns them in multipleMatches so you can retry with an
account_id.
Example response:
{
"name": "AWS Production",
"code": "483920",
"length": 6,
"remainingSeconds": 17
}remainingSeconds is the number of seconds until the code changes. To get a fresh
code, wait that long and call once, instead of calling until the code changes.
Ambiguous match:
{
"error": "Multiple accounts match 'aws'. Please be more specific or use account_id.",
"length": 0,
"multipleMatches": [
{
"id": "924c52a6-4457-4970-a39f-4dc620217683",
"name": "AWS Production",
"issuerDomain": "amazon.com"
}
]
}whoami
Returns information about the current token.
Example response:
{
"tokenName": "Claude Code",
"businessName": "Acme Ltd",
"scopedGroups": [
{ "id": "cfeba14a-e990-49e8-b6e5-61d63f7d68c8", "name": "Engineering" }
],
"expiresAt": "2027-06-30T23:59:59Z",
"accountCount": 12
}list_groups
Returns the groups this token can add accounts to, sorted by name: groups the token's
creator owns or has Can manage access to, and only the token's scoped groups if it has
any. Call it before add_account.
Example response:
{
"groups": [
{ "id": "cfeba14a-e990-49e8-b6e5-61d63f7d68c8", "name": "Engineering" }
]
}add_account
Adds one 2FA account from its secret and puts it in the chosen groups. The account belongs to the token's creator and counts toward the plan's account limit, and the secret is encrypted as soon as it arrives.
Parameters:
secret(string, required): a Base32 key, or theotpauth://link from the setup QR code. A Google Authenticator export link (otpauth-migration://) holds several accounts and is refused: add one account per call.name(string, optional): the account's name, usually the service it signs in to. Required unlesssecretis anotpauth://link with an issuer or label.issuer_domain(string, optional): the service's domain, for examplegithub.com. Looked up from the name when left out.description(string, optional): notes about the account.group_ids(array of UUIDs, optional): groups fromlist_groups, each once. A token with scoped groups must name at least one of them, so it can see the account it added.
It is all or nothing: if any input or group is refused, nothing is added, and the
tool returns an error that starts with a code such as GROUP_REQUIRED or
SECRET_INVALID. The response never includes the secret or a code: call get_otp
with the returned id to read one. Authn8's Activity Log records "Account '[name]'
added" with the device MCP, and one more entry for each group the account went into.
Example response:
{
"id": "5b0f7d1e-2c4a-4e8b-9f3d-7a6c1e2b4d8f",
"name": "GitHub",
"issuerDomain": "github.com",
"groups": [
{ "id": "cfeba14a-e990-49e8-b6e5-61d63f7d68c8", "name": "Engineering" }
]
}Links
Authn8: shared 2FA for teams
2FA codes for AI agents: scoped tokens, the Access Log and revoking
Available Tools
5 toolsadd_accountAInspect
Adds one shared 2FA account from its secret and puts it in the chosen groups. Call list_groups first: only groups from list_groups are accepted, and a token limited to groups must put the account in at least one of them. All or nothing: if any input or group id is refused, nothing is added. Returns the new account's id, name, issuerDomain and groups, never a code: call get_otp with the id to read one. Errors start with a code, for example GROUP_REQUIRED or SECRET_INVALID.
Inputs: secret (required), name, group_ids, description, +1 more. Returns: id, name, error, groups, +1 more
get_otpAInspect
Generates a TOTP code for a specific account. REQUIRED: Provide either account_id OR account_name (at least one must be specified). Returns name, code, length and remainingSeconds, the seconds until the code changes: if you need a fresh code, wait that long instead of calling again. Errors: Returns 'No account found' if the name doesn't match any account. Returns 'Multiple accounts match' with a list of matches in the 'multipleMatches' field if the name is ambiguous - use the returned account_id to retry.
Inputs: account_id, account_name. Returns: code, name, error, length, +2 more
list_accountsAInspect
Returns all 2FA accounts accessible to this token. Use this to see what accounts are available before requesting an OTP code. Each account includes: id (UUID for get_otp), name, and issuerDomain. Returns an empty list if no accounts are accessible.
Inputs: no named parameters. Returns: error, accounts
list_groupsAInspect
Returns the groups this token can add accounts to: groups its team member owns or is a group admin of, and only the token's own groups if it is limited to some. Each group includes: id (UUID for add_account's group_ids) and name. Call this before add_account. Returns an empty list if there are none.
Inputs: no named parameters. Returns: groups
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: listing accounts, generating an OTP, checking token identity, listing groups, and adding an account. list_accounts and list_groups both list resources but target different entities and are well explained.
Four tools follow a consistent verb_noun pattern: list_accounts, get_otp, list_groups, add_account. whoami is a minor deviation but is a conventional command name and remains understandable.
Five tools are well-scoped for a 2FA account server focused on discovery, OTP retrieval, identity, and adding shared accounts. Each tool has a clear role without excessive surface area.
The set covers listing accounts, adding shared accounts, retrieving OTPs, and checking identity/groups. However, it lacks obvious lifecycle operations such as updating or removing accounts, which limits full account management.
Maintenance
Related MCP Connectors
Shared TOTP authenticator codes for teams and AI agents, with scoped, audited agent keys.
Give AI agents and headless browsers automated 2FA login support. Receive email OTPs, magic links, SMS verification codes, and authenticator TOTP tokens without human intervention (works with Claude Code, Cursor, Playwright, Stagehand, and Browser Use). Powered by dedicated US Telnyx carrier SMS DIDs, <200ms atomic Redis Lua delivery, deterministic <8ms code/link extraction (zero LLM tokens), and rollover-safe Cloud KMS TOTP with zero persistent disk storage.
Identity for AI agents: email inboxes, OTPs, magic links and TOTP for apps you own.
Governed access to sensitive data, secrets and APIs for AI agents. A signed proof for each decision.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to securely perform privileged actions like creating GitHub issues by minting short-lived, single-purpose tokens on demand, with policy enforcement and audit logging.MIT
- AlicenseAqualityDmaintenanceEnables AI agents to make authenticated API calls and run commands with secrets injected, while keeping credentials completely hidden from the model, with policy enforcement, grants, and audit logging.6MIT
- AlicenseAqualityCmaintenanceEnables AI agents to securely manage local credentials, obtain short-lived tokens for authenticated API access, and audit every use by purpose.9MIT
- AlicenseAqualityBmaintenanceEnables AI agents to look up stored logins by URL, name, or alias and use them without seeing the secrets, injecting authentication into HTTP requests, running commands with credentials in the environment and scrubbed output, and fetching 2FA codes, subject to per-credential policies and user approval.23MIT