Skip to main content
Glama

TOTP MCP Server

MCP server for generating TOTP (Time-based One-Time Password) 2FA codes for Claude Code automation.

Features

  • Generate 6-digit TOTP codes for configured accounts

  • Codes are valid for ~30 seconds (standard TOTP)

  • Shows remaining validity time

  • Reads secrets from external file (not hardcoded)

Related MCP server: MCP OpenAPI Connector

Installation

cd ~/.claude/mcp-servers/totp
npm install

Configuration

  1. Create a secrets file (e.g., ~/.nutrie-secrets):

    GOOGLE_TOTP_SECRET=JBSWY3DPEHPK3PXP
  2. Update SECRETS_FILE path in index.js if needed

  3. Add accounts to the ACCOUNTS object in index.js:

    const ACCOUNTS = {
      "google": "GOOGLE_TOTP_SECRET",
      "github": "GITHUB_TOTP_SECRET",
    };

MCP Configuration

Add to your .mcp.json:

{
  "mcpServers": {
    "totp": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/.claude/mcp-servers/totp/index.js"]
    }
  }
}

Tools

get_totp_code

Generate a TOTP code for an account.

Parameters:

  • account (required): Account name (e.g., "google")

Example:

TOTP code for google: 123456
Valid for 24 more seconds

list_totp_accounts

List all configured TOTP accounts and their status.

Security

  • TOTP secrets are stored in an external file, not in the code

  • The secrets file should have restricted permissions (chmod 600)

  • Never commit secrets to git

Troubleshooting

TOTP code is rejected / invalid

TOTP codes are time-sensitive. The most common cause of invalid codes is clock drift.

  • Check system time: date — ensure it's accurate to within a few seconds

  • Sync time (Linux): sudo timedatectl set-ntp true

  • Sync time (macOS): System Settings → General → Date & Time → Set automatically

"Account not found" error

The account name must exactly match a key in the ACCOUNTS object in index.js.

  • Run list_totp_accounts to see all configured account names

  • Account names are case-sensitive (googleGoogle)

Secrets file not found

  • Verify the SECRETS_FILE path in index.js points to your actual secrets file

  • Confirm the file exists: ls -la ~/.nutrie-secrets (or your configured path)

  • Check file permissions allow reading: chmod 600 ~/.nutrie-secrets

MCP server fails to start

  • Run npm install in the totp directory to ensure dependencies are installed

  • Test manually: node index.js — any startup errors will print to stderr

  • Verify the path in .mcp.json is absolute and correct

TOTP secret is wrong / codes always fail

  • Re-scan or re-copy the TOTP secret from your account's 2FA setup page

  • Secrets are base32-encoded — ensure no extra spaces or line breaks in the secrets file

  • Confirm the correct environment variable name is mapped in ACCOUNTS

License

MIT

F
license - not found
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
<1hResponse time
Release cycle
1Releases (12mo)
Commit activity
Issues opened vs closed

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Access your team's 2FA codes from AI agents without sharing secrets. List accounts, generate TOTP codes, and maintain full audit trails. Built for DevOps, CI/CD pipelines, and automated workflows that need to authenticate to protected services.
    28
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables Claude Desktop and other MCP clients to interact with any OAuth2-authenticated OpenAPI-based API through automatic tool generation from OpenAPI specifications, with built-in token management and authentication handling.
    8
    3
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables interaction with Fidelity Investments brokerage accounts using Playwright browser automation to manage balances, positions, and trades. It supports secure 2FA authentication and session persistence for seamless account management via Claude.
    13
    4
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Stig-Johnny/totp-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server