How-To6 min read2026-11-23

Giving Claude Code, Cursor, and Browser Use Unattended Email, SMS & TOTP 2FA via MCP

Connect @sentryrelay/mcp via npx stdio or hosted Streamable HTTP (/api/mcp)—or use pip install sentryrelay-sdk—so AI coding and browsing agents clear 2FA without human intervention.

By Sentry Relay Engineering · Developer Ecosystem Team
MCPClaude CodeCursorBrowser UsePython SDK

Why Coding & Browsing Agents Need a Native 2FA MCP Server

Whether an agent is running Playwright tests inside Claude Code, signing up for a staging tenant in Cursor, or navigating a vendor portal via Browser Use, authentication is the #1 point where autonomous runs halt and ping a human.

Sentry Relay ships both a local stdio MCP server (@sentryrelay/mcp) and a zero-install hosted Streamable HTTP MCP endpoint (https://sentryrelay.com/api/mcp), exposing 6 annotated tools for Email OTPs, Magic Links, US Carrier SMS, and Cloud KMS TOTP.

Canonical Sentry Relay MCP Tools (@sentryrelay/mcp)
Tool NameRead-OnlyPurpose
wait_for_verification_codeNo (consumes match)Long-polls up to 45s (<200ms wake-up) for Email/SMS OTP, magic link, or non-auth message
get_latest_verification_codeNo (consumes match)Instant non-blocking Redis ZSET timeline check (1..300s lookback)
get_totp_codeYesGenerates live RFC 6238 TOTP from Cloud KMS with automatic <=4s window rollover wait
list_identitiesYesLists accessible Identities (@in.sentryrelay.com addresses, SMS DIDs, TOTP counts)
create_identityNoProvisions a new isolated Identity inbox for a workflow or client
store_totp_secretNo (idempotent)Vaults an otpauth:// URI or Base32 seed under Cloud KMS envelope encryption

Install in 30 Seconds: Claude Code, Cursor, Hosted HTTP & Agent Skill

Pick the transport that matches your environment—local stdio, hosted Streamable HTTP, or portable SKILL.md:

# 1. Add MCP server in one command
claude mcp add sentryrelay \
  -e SENTRY_RELAY_API_KEY=sr_live_your_api_key_here \
  -- npx -y @sentryrelay/mcp

# 2. Optional: Install portable Agent Skill (Cursor / Claude Code / Codex / Windsurf)
npx skills add https://sentryrelay.com/skills/sentryrelay/SKILL.md

Native Python SDK for Browser Use, LangGraph, CrewAI & PydanticAI

For Python agent frameworks, pip install sentryrelay-sdk provides direct action/tool adapters so you do not even need to spawn a separate MCP process:

from browser_use import Agent, Controller
from sentryrelay import AsyncSentryRelay
from sentryrelay.integrations.browser_use import register_sentryrelay_actions

controller = Controller()
relay = AsyncSentryRelay()  # Reads SENTRY_RELAY_API_KEY from env

# Registers wait_for_2fa_code and get_totp_token actions
register_sentryrelay_actions(controller, relay)

agent = Agent(
    task="Log into Stripe dashboard for identity 'stripe-ops' and resolve any 2FA challenge.",
    controller=controller,
)

Frequently Asked Questions

Does Sentry Relay expose raw TOTP seeds to the LLM over MCP?
Never. Base32 seeds are encrypted under Google Cloud KMS and decrypted in memory strictly to compute the ephemeral 6-digit RFC 6238 code.
Can I scope an MCP API key so Claude Code or Cursor only sees one Identity?
Yes! Create an API key with scopedIdentityIds in the Sentry Relay Console so coding agents can only read sandbox or specific test Identities.
Where can coding agents read full documentation automatically?
Point Cursor or Claude Code to https://sentryrelay.com/llms.txt, https://sentryrelay.com/llms-full.txt, or install our Agent Skill with npx skills add https://sentryrelay.com/skills/sentryrelay/SKILL.md.
Test Unattended 2FA in 3 Minutes with Simulated SMS

Start on the free Sandbox tier ($0/mo, 250 email extractions, Cloud KMS TOTP, Simulated SMS tester) or attach dedicated US carrier Telnyx DIDs on paid plans.