# Cursor recipes

> Give Cursor’s agent BlueBot’s tools while you build, so it can text you when a job finishes.

Three recipes for Cursor. Each names its trigger and the BlueBot step, lists the fields to map and says how to test it with your own number before anyone else gets a text.

## How Cursor connects

- **[MCP](https://usebluebot.com/docs/mcp)**: BlueBot’s MCP server gives the assistant tools to send texts, read conversations and check your Mac.
- **[API](https://usebluebot.com/docs/api)**: Your own code calls BlueBot’s REST API and listens to its signed webhooks.

## Text me when the tests finish

| Part             | What it is                              |
| ---------------- | --------------------------------------- |
| Trigger          | You ask Cursor’s agent                  |
| Action           | The assistant calls BlueBot’s MCP tools |
| Connects through | [MCP](https://usebluebot.com/docs/mcp)                        |

### Steps

1. Add BlueBot’s MCP server to Cursor with an API key as its bearer token.
2. Ask the agent: “Run the test suite, then text me the result.”
3. When the run ends, the agent calls send_text to your own number once you approve it.

### Test it

Ask the assistant to text your own number first: “Text me at +1 555 555 0123 to say the setup works.” It shows the message BlueBot returned, and the text arrives on your phone from your own number.

## Find out why a text is waiting

| Part             | What it is                              |
| ---------------- | --------------------------------------- |
| Trigger          | You ask Cursor’s agent                  |
| Action           | The assistant calls BlueBot’s MCP tools |
| Connects through | [MCP](https://usebluebot.com/docs/mcp)                        |

### Steps

1. Ask: “Why hasn’t the text to +15555550123 gone out?”
2. The agent finds it with list_messages and reads its hold with get_message.
3. It answers in words, such as “It’s waiting for quiet hours to end at 8:00 AM,” and checks get_device_status when the hold says your Mac is offline.

### Test it

Ask the assistant to text your own number first: “Text me at +1 555 555 0123 to say the setup works.” It shows the message BlueBot returned, and the text arrives on your phone from your own number.

## Add texting to your app

| Part             | What it is                               |
| ---------------- | ---------------------------------------- |
| Trigger          | You ask Cursor’s agent to write the code |
| Action           | `POST /v1/messages`                      |
| Connects through | [API](https://usebluebot.com/docs/api)                         |

### Steps

1. Ask the agent to install bluebot from npm and send a text with POST /v1/messages.
2. Have it pass an Idempotency-Key so a retried request never sends twice.
3. Have it add a route that checks BlueBot’s webhook signature and handles message.received.

### Map the fields

| BlueBot field                | Map it to                                                                                                                                   |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `to`                         | The person’s mobile number from Cursor. US numbers can leave off the +1.                                                                    |
| `text`                       | Hi {{first_name}}, your appointment on {{date}} is confirmed. Reply here if you need to change it.                                      |
| `{{first_name}}` in the text | Cursor’s first name field.                                                                                                                  |
| `{{date}}` in the text       | Cursor’s date field.                                                                                                                        |
| `metadata`                   | `source` set to `cursor`, and `record_id` set to the record’s id, so the status and reply webhooks for this text can find the record again. |
| `service`                    | Auto, the default: iMessage when the person uses it, otherwise SMS through your iPhone.                                                     |

```bash
curl -X POST "https://usebluebot.com/api/v1/messages" \
  -H "Authorization: Bearer $BLUEBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: cursor-1042" \
  -d '{
    "to": "+15555550123",
    "text": "Hi Maria, your appointment on (date) is confirmed. Reply here if you need to change it.",
    "metadata": {
      "source": "cursor",
      "record_id": "1042"
    }
  }'
```

```ts
import BlueBot from '@usebluebot/sdk';

const client = new BlueBot({ apiKey: process.env.BLUEBOT_API_KEY });

const message = await client.messages.send({
  to: '+15555550123',
  text: 'Hi Maria, your appointment on (date) is confirmed. Reply here if you need to change it.',
  metadata: {
    source: 'cursor',
    record_id: '1042',
  },
}, { idempotencyKey: 'cursor-1042' });
console.log(message);
```

```python
import os
from bluebot import BlueBot

client = BlueBot(api_key=os.environ["BLUEBOT_API_KEY"])

message = client.messages.send(
    to="+15555550123",
    text="Hi Maria, your appointment on (date) is confirmed. Reply here if you need to change it.",
    metadata={
        "source": "cursor",
        "record_id": "1042",
    },
    idempotency_key="cursor-1042",
)
print(message)
```

### Test it

Run the request with your own number in `to`. A text arrives on your phone from your own number.

## Before you turn it on

- Text only people who asked to hear from you. Anyone who replies STOP goes on your stop list, and BlueBot cancels texts to them. [Stop words](https://usebluebot.com/docs/concepts/stop-words)
- A text that can’t go yet waits with a hold rather than failing: quiet hours, your Mac away, a daily limit. [Holds](https://usebluebot.com/docs/concepts/holds)
- [Cursor with BlueBot](https://usebluebot.com/integrations/cursor) on the integrations page says what else the two do together.
