# VS Code recipes

> Use BlueBot’s MCP server from VS Code’s agent mode.

Three recipes for VS Code. 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 VS Code 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.

## Check your Mac from agent mode

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

### Steps

1. Add [https://usebluebot.com/mcp](https://usebluebot.com/mcp) to VS Code’s MCP configuration with your API key as the bearer token.
2. Open the chat in agent mode and ask: “Is my Mac online, and is anything held?”
3. The agent calls get_device_status and tells you when the Mac last checked in.

### 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.

## Write a reply handler against a real text

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

### Steps

1. Ask the agent to fetch your latest incoming text with list_messages.
2. Have it write a handler for message.received that reads the fields that text has.
3. Run your app and the handler on localhost to try 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.

## Try your webhook handler locally

| Part             | What it is                           |
| ---------------- | ------------------------------------ |
| Trigger          | You run your app on localhost        |
| Action           | VS Code acts on what BlueBot reports |
| Connects through | [API](https://usebluebot.com/docs/api)                     |

### Steps

1. Run npx bluebot listen and point it at your local server.
2. Send a test event to the endpoint from BlueBot’s dashboard or with POST /v1/webhooks/{id}/test.
3. Watch your handler verify the signature and read the event.

### Test it

Try it once with your own number before you turn it on for anyone else.

## 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)
- [VS Code with BlueBot](https://usebluebot.com/integrations/vs-code) on the integrations page says what else the two do together.
