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.
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.
| Tool Name | Read-Only | Purpose |
|---|---|---|
| wait_for_verification_code | No (consumes match) | Long-polls up to 45s (<200ms wake-up) for Email/SMS OTP, magic link, or non-auth message |
| get_latest_verification_code | No (consumes match) | Instant non-blocking Redis ZSET timeline check (1..300s lookback) |
| get_totp_code | Yes | Generates live RFC 6238 TOTP from Cloud KMS with automatic <=4s window rollover wait |
| list_identities | Yes | Lists accessible Identities (@in.sentryrelay.com addresses, SMS DIDs, TOTP counts) |
| create_identity | No | Provisions a new isolated Identity inbox for a workflow or client |
| store_totp_secret | No (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.mdNative 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,
)