AI agents
2FA codes for your AI agents, without handing over the secret
The Share Auth MCP connector and 2FA skill give Claude, ChatGPT or Codex the 2FA code an agent needs, without ever passing it the TOTP seed. Source code public on GitHub.
Source code public on GitHub. The MCP connector and the 2FA skill for agents install in a few minutes with a token from your account.
The problem
An AI agent signing in to a service protected by 2FA gets stuck on the six-digit code. The usual workarounds are both bad. Pasting the TOTP seed into the agent’s configuration hands it a permanent credential that cannot be revoked, and making it wait for a human to type the code in defeats the point of automating anything.
What the connector does
It exposes the team’s vault over the MCP protocol, as two tools:
list_otp_secretslists the team’s accounts, with an optional search, without returning any sensitive data;get_otp_codereturns the current code of an account, identified by its id or its exact name.
The agent gets the code when it needs it. It never receives the seed, which stays encrypted in the vault.
Install the connector
It requires Node.js 20 or later.
- Clone the repository and install its dependencies:
git clone https://github.com/ShareAuth/mcp-server.git, thennpm ci. - In your Share Auth profile, under API tokens, create a token with the
secrets:listandsecrets:generatepermissions. - Declare the server in your client. For Claude Desktop, Codex CLI and other
local clients, the command is
node src/index.js, with the token in theOTP_API_TOKENvariable.
For a remote client such as ChatGPT, run the server in HTTP mode behind HTTPS,
on your own infrastructure; the endpoint is /mcp. The
repository README covers both modes
in detail.
Agent skill
For an agent that can read a skill and run commands, such as Claude Code, the
2FA skill (shareauth-otp) can be cloned into its skills folder. It
calls the API with Bash and curl to find an account and get its current code,
never the seed. Token: secrets:list and secrets:generate.
Limited, logged access
The connector and the skill authenticate with an API token you create from your profile. That token carries only the permissions you choose, for 1, 7, 30 or 90 days, and you can revoke it at any time.
Every code obtained is recorded in the team’s access log, just like a code viewed on the website. The owner sees which account was used, when, and on whose behalf.
Good practice
- One token per person and per device, so you can revoke just one.
- Keep human confirmation switched on for
get_otp_codein your client: its answer is an authentication factor. - Have the agent call
list_otp_secretsfirst when the account name is uncertain. - Do not log MCP request headers or tool results.
Frequently asked questions
Local clients such as Claude Desktop or Codex CLI, and remote clients such as ChatGPT or the OpenAI Responses API, through an HTTPS endpoint that you host. Any client that speaks MCP can connect to it.
No. The connector and the 2FA skill never read or return the seed: they only get the current code, like a team reader.
The team owner. Every code obtained by an agent appears in the access log, under the name of the person who owns the token.
Revoke its token from your profile, among your API tokens. The token expires anyway at the end of the lifetime chosen when it was created: 1, 7, 30 or 90 days.
The MCP connector for a client that speaks MCP (Claude Desktop, Codex, ChatGPT). A skill for an agent that reads skills and can run commands, such as Claude Code: it only needs Bash and curl.