Save 44% with yearly billing.View Plans
textbee Logotextbee.dev

AI app builder

Add SMS to an app you build in Cursor: one prompt, a rule file and the MCP server

Published and updated

In Cursor the agent writes the integration into your own codebase, so textbee works in any stack. Put the textbee API facts in a project rule, keep the key in your .env file, and paste the prompt from this page. Add the textbee MCP server as well, and the agent can send a real test text and read the reply without leaving the editor.

Send
HTTP POST
to the textbee send endpoint
Receive
Webhook
MESSAGE_RECEIVED, flat JSON
Pace
10 to 15 / min
per Android phone
textbee code
None
uses what the tool ships today

What you need

  • Cursor on any plan, with a project open.
  • A textbee account with the Android app installed on the phone that holds the SIM, and an API key from the dashboard.
  • A server in your app: an API route, a backend service or a serverless function.
  • The textbee app on the phone. Download the app, then create an API key in the dashboard.

Send SMS from Cursor

Rules give the agent the facts every time, so it does not guess an endpoint. Files in .cursor/rules must end in .mdc; a plain .md file there is ignored. AGENTS.md in the project root works too.

  1. Add a project rule

    Create the rule with /create-rule or by hand. Apply Intelligently loads it when the agent works on SMS.

    .cursor/rules/textbee.mdc
    ---
    description: Sending and receiving SMS with textbee
    alwaysApply: false
    ---
    - Send: POST https://api.textbee.dev/api/v1/gateway/send-sms, header x-api-key from TEXTBEE_API_KEY, JSON body {"recipients": ["+E164"], "message": "..."}. recipients is always an array.
    - Replies: textbee posts MESSAGE_RECEIVED to our webhook route. Verify X-Signature (HMAC-SHA256 hex of the raw body, TEXTBEE_WEBHOOK_SECRET) in constant time.
    - Call textbee only from server code. Never expose the key to the browser.
    - Docs: https://textbee.dev/docs/agents/agent-quickstart
  2. Put the key in .env

    Add TEXTBEE_API_KEY to .env and make sure .env is in .gitignore. Your framework loads it on the server.

  3. Paste the prompt

    Paste the prompt from this page into the agent and change What I want. The agent edits your server code and adds a test path.

Receive SMS in Cursor

Replies need a public URL. In development, a tunnel such as ngrok or cloudflared exposes your local server. In production, register the deployed route.

  1. Ask for the webhook route

    Ask the agent to add a POST route that verifies X-Signature, skips repeated idempotencyKey values and handles MESSAGE_RECEIVED. The rule above already tells it how.

  2. Expose it and register it

    Start a tunnel to your dev server, or deploy, then add the public URL in the textbee dashboard under Webhooks with the MESSAGE_RECEIVED event and a signing secret that matches TEXTBEE_WEBHOOK_SECRET.

  3. Let the agent test the loop

    With the MCP server installed, ask: "Text my number, wait for my reply, and check that the webhook stored it." The agent uses send_sms and get_messages to run the check.

Paste this prompt into Cursor

The prompt below carries the endpoints, the payloads, where the key may live and the Cursor details from this page. Change the line that starts with What I want, and Cursor builds the feature without guessing an endpoint.

Prompt for your AI agent

Paste it into the Cursor chat. It carries the textbee API facts and the Cursor details the agent needs, so it does not guess.

Add SMS to the app I am building in Cursor. Use textbee, an SMS gateway that sends and receives SMS through my own Android phone.

Facts about the textbee API. Use only these. Do not invent endpoints or fields.
- Send an SMS: POST https://api.textbee.dev/api/v1/gateway/send-sms with the header x-api-key: <TEXTBEE_API_KEY> and a JSON body like {"recipients": ["+12015550123"], "message": "Hello"}. recipients must be a JSON array of E.164 numbers, even for one number. Optional fields: deviceId, simSubscriptionId, scheduledAt (ISO 8601, in the future). The response is {"data": {"success": true, "smsBatchId": "..."}}.
- Check delivery or read replies: GET https://api.textbee.dev/api/v1/gateway/messages with the same header. Filters: direction=received, smsBatchId=<id from the send>, from and to as ISO timestamps. Each row has a status such as sent, delivered, failed or received.
- Receive an SMS: textbee posts JSON to a webhook URL I register in the dashboard. A MESSAGE_RECEIVED delivery has these top-level fields: smsId, message, deviceId, webhookSubscriptionId, webhookEvent, idempotencyKey, sender, receivedAt. The header X-Signature holds an HMAC-SHA256 hex digest of the raw body, keyed with the signing secret I set on the webhook. Retries reuse the same idempotencyKey.
- Limits: One Android phone sends roughly 10 to 15 messages a minute. Text only, no MMS. Messages over 160 characters are split into segments.

Rules:
- Store the API key as a secret named TEXTBEE_API_KEY. Call textbee only from server-side code, never from code that runs in the browser.
- Do not ask me to paste the real key into this chat. Tell me where to add the secret instead.
- For incoming texts, create a public server endpoint, check the X-Signature header against a secret named TEXTBEE_WEBHOOK_SECRET, and ignore a repeated idempotencyKey.

What I want: Text new signups a welcome message with a link, and log any reply against their account.

Cursor specifics you should know:
- Follow .cursor/rules/textbee.mdc if it exists. It holds the same textbee facts as this prompt.
- Read TEXTBEE_API_KEY and TEXTBEE_WEBHOOK_SECRET from the server environment, loaded from .env in development.
- If the textbee MCP server is available, use send_sms to send me one test text and get_messages to confirm delivery.
- Add a test for the webhook route that signs a sample body with a test secret.

Build it, tell me where to add each secret in Cursor, and add a way to send one test message to my own number.

Features to build

Welcome texts
The signup handler queues a welcome text. A YES reply to the welcome can turn on reminders for that user.
Build and deploy alerts
A CI step or a deploy hook calls your send route and texts you when production changes or a job fails.
Agent-checked flows
The agent writes the feature, texts your phone through MCP, reads the reply and confirms the webhook stored it, all in one run.
Any stack
Next.js, Express, FastAPI, Rails or Laravel: the rule file stays the same, and the agent writes the call in your language.

Why Cursor builders text from their own phone

The agent can test for real
With the MCP server, the agent sends a text to your phone and reads your reply. It proves the feature works instead of guessing.
Same API in every project
One rule file and one endpoint work in every stack you open in Cursor. No provider SDK to learn per language.
Your number from the first commit
No trial restrictions or sender registration between the first prompt and the first real user.

A cloud SMS provider in Cursor vs textbee in Cursor

What you care aboutCloud SMS providertextbee
SetupProvider account, number, sender registration, an SDK per language, test numbers to verifyPair a phone, one key in .env, one rule file, one prompt
Sender the contact seesA rented virtual number, or an alphanumeric sender where the country allows itYour own mobile number, which your contacts already have saved
Monthly costPer message, plus number rental and carrier surcharges in some countriesA flat plan with messages included: Pro is $14.99 a month for 5,000 messages. No per-message fee, no number rental, no carrier surcharge.
ThroughputSet by the provider tier and by sender registrationOne phone sends roughly 10 to 15 messages a minute. Add phones to scale.
RepliesInbound webhook from the provider, or the provider app in the tooltextbee webhook: flat JSON, signed with HMAC-SHA256
Where the message leaves fromThe provider data centerAn Android phone you own, plugged in, on Wi-Fi or mobile data
Cursor costYour Cursor plan, plus the provider billYour Cursor plan only

Per-message prices by provider and country, with sources and dates, are on the provider comparison pages.

What works and what does not

Works today

  • Any backend Cursor can edit, in any language
  • Live tests through the textbee MCP server, local or hosted
  • Rules that keep the API facts in every chat
  • Webhook routes behind a tunnel during development

Not with this route

  • The browser sign-in flow of the hosted MCP server: Cursor uses the header form
  • Hosting: Cursor edits code, your app still needs a server or platform to run on
  • Calls from browser code
  • MMS

What Cursor charges

MCP servers and rules work on every Cursor plan. Plans are Free, Plus at $8 a month, Premium at $30, Super at $100 and Ultra at $200. cursor.com, checked on October 22, 2026. textbee itself charges a flat monthly plan with messages included; see pricing.

Frequently asked questions

How do I add the textbee MCP server to Cursor?

Add it to .cursor/mcp.json in the project or ~/.cursor/mcp.json for every project. Use "url": "https://mcp.textbee.dev/mcp" with a headers entry "x-textbee-api-key", or the local server with "command": "npx" and "args": ["-y", "@textbee/mcp"] and TEXTBEE_API_KEY in env. The MCP page has both blocks.

Can I keep the key out of mcp.json?

Yes. Cursor interpolates ${env:NAME} in url, headers and env, so "x-textbee-api-key": "${env:TEXTBEE_API_KEY}" reads it from your shell environment instead of the file.

Why does Cursor ignore my textbee rule?

Rules in .cursor/rules need the .mdc extension and frontmatter. A plain .md file there is skipped. Check the rule type too: Apply Manually rules only load when you mention them.

Does this work in Claude Code too?

Yes. Put the same facts in AGENTS.md or CLAUDE.md, add the server with claude mcp add, and paste the same prompt. The MCP page lists the exact command.

How do I receive webhooks on localhost?

textbee rejects localhost and private addresses as webhook URLs. Run a tunnel such as ngrok or cloudflared and register its HTTPS URL, then switch to the deployed URL in production.

Will the agent leak my key into the code?

Not if the prompt and the rule say where it lives. Both tell the agent to read TEXTBEE_API_KEY from the environment. Review the diff for a hard-coded key before you commit.

How long does the setup take?

About ten minutes: pair the phone, create an API key, add it to .env, save the rule and paste the prompt. The MCP server adds one config block.

Is there a one-click install for Cursor?

Cursor supports install links in the form cursor://anysphere.cursor-deeplink/mcp/install with a base64 config. Pasting the block from the MCP page into mcp.json does the same and is easier to review.

Sources

  1. cursor.com, checked on October 22, 2026
  2. cursor.com: MCP, checked on October 22, 2026
  3. cursor.com: Rules, checked on October 22, 2026
  4. cursor.com: MCP install links, checked on October 22, 2026

Read next

Your phone is already an SMS gateway. Switch it on.

Set up in minutes and send your first message for free. No credit card, no per-message fees, no carrier contracts.

Free tier forever No credit card required Open source

Need self-hosting help or a custom integration? See services