Cybersecurity and programming, explained plainly

OTPKit Lets an AI Agent Read Test Codes. Choose the Inbox Carefully.

Artificial Intelligence · Nov 24, 2026 ·By Mohamed Ghareeb

A signup test gets awkward at the same point every time: the application sends a code, and somebody has to leave the test, open an inbox and copy it back.

OTPKit puts that receiving step within an agent's reach. It is useful for testing systems you own or are authorized to test. It is also easy to misunderstand what a temporary address or shared phone number actually protects.

The missing piece is receiving the message

A browser automation can fill out a form and press Submit. An end-to-end verification test also needs to establish that a message arrived, extract the intended code or link and confirm the application accepted it.

OTPKit is a Python project under the MIT license that exposes this work through Model Context Protocol, or MCP. The project uses the stdio transport: a client starts a local process and exchanges protocol messages through standard input and output.

Local transport does not mean the whole workflow stays on your machine. OTPKit contacts external mailbox and SMS providers. Its session state being held in memory says nothing about how those providers store messages.

The result is a list of candidates, not a verified answer

The usual flow is to create a temporary address, use it in your test form, wait for a message and receive structured data containing possible OTPs and links.

The code uses patterns to extract four-to-eight-digit sequences and prioritize links containing verification-related words. That can mistake an order number for a code. A link containing "verify" is not automatically safe or relevant.

Extraction finds something that looks useful. Your test still has to prove it is the right thing.

Match the expected sender, recipient, time and application context. Do not blindly follow whichever link sorts first, especially when the inbox is shared.

Eleven tools cover email, SMS and extraction

The email tools are create_temp_email, check_email, wait_for_email and list_temp_emails. They create an address, read mail, wait for delivery and list addresses from the current session.

The public-SMS tools are list_free_sms_numbers, read_free_sms and wait_for_sms. Optional paid-provider tools are get_sms_providers, buy_temp_number and check_paid_sms. The remaining tool, extract_otp_from_text, processes text supplied to it.

The reviewed documentation caps email waiting at 120 seconds and SMS waiting at 300 seconds. These are polling conveniences, not delivery guarantees.

Read the project before installing it

The project requires Python 3.10 or later and lists mcp and httpx as dependencies. Its documented quick start uses uv:

uvx otpkit

It also documents installation from its repository:

pip install git+https://github.com/SecFathy/otpkit.git

Review and pin a known version for repeatable tests rather than automatically executing whatever the repository's default branch contains later. Installation can run third-party code; a familiar hosting site is not a security audit.

A documented Claude Code setup is:

claude mcp add otpkit -- uvx otpkit
claude mcp list

For a compatible desktop client, the project's example has this shape:

{
  "mcpServers": {
    "otpkit": {
      "command": "uvx",
      "args": ["otpkit"]
    }
  }
}

Check your client's current configuration format. Paid SMS providers require their own credentials and funds. Keep real API keys in an appropriate secret store and out of screenshots, repositories and shared example files.

A localhost test still sends mail outside localhost

For an application you control, create a test account, wait for its message and verify either the code or confirmation link. Then check the application's actual account state. A page saying "success" is not the only assertion worth making.

Test with synthetic details. If the message contains a localhost link, remember it resolves on the machine opening it, which may differ from the machine running your app.

Free, private and temporary mean different things

The reviewed project offers Grabmail, Catchmail, Guerrilla Mail and Maildrop email options. Maildrop is explicitly public. Some other paths rely on knowing an address rather than authenticating as its owner.

The reviewed Grabmail path can generate an address using a timestamp. That is not equivalent to a password-protected inbox. A label saying "private" should not persuade you to send confidential reset links there.

Free SMS numbers are public and shared. Other people may read messages sent to the same number, and you may encounter messages not intended for you. Do not use or retain somebody else's codes.

Paid options such as 5sim and SMSPool offer a different rental model, but a rented temporary number is still not a number you permanently control. Provider retention and reassignment remain relevant.

For reliable tests, prefer a controlled receiving system

For local email testing, Mailpit gives your application a test SMTP destination and a message interface. It avoids relying on a public disposable inbox for ordinary development tests.

Hosted test-inbox services can help when testing from deployed environments. Review their privacy, retention and pricing rather than assuming all testing mail is harmless.

Firebase Authentication documents fictional phone numbers with configured codes for testing without sending real SMS. That tests the supported authentication path without buying numbers, though it does not test carrier delivery.

At unit-test level, separate your application's message-sending adapter and replace it with a controlled fake. Keep test codes out of production logs. Use an external delivery test only when that is the behavior you need to measure.

Keep the test inside your authorization

A temporary number is not permission to bypass another service's rules, impersonate someone or access their messages. Terms differ by service, and legal consequences depend on what you do and where.

For this use case, keep the scope simple: your application, an authorized test environment and no real user secrets. OTPKit can remove a manual step. It cannot turn a public inbox into a safe recovery channel.

Related reading: when a disposable inbox is the wrong choice is in Temporary Email Is Useful. Just Do Not Build an Account on It, and what happens when a real address leaks is in Email Breach Check.

Sources

Comments