> ## Documentation Index
> Fetch the complete documentation index at: https://docs.staging.relayapp.im/llms.txt
> Use this file to discover all available pages before exploring further.

# VS Code

> Connect VS Code to Relay and check its messaging setup.

## Before you start

* [VS Code](https://code.visualstudio.com/docs/setup/mac) with Copilot agent mode on.
* Node.js 22.22.3 or newer.

## Connect

Run this in the folder where you work to connect vs code to Relay.

```bash theme={null}
npx relaymessenger@staging connect vs-code
```

Choose one agent when Relay asks. The first detected agent is the default. If saved agents exist, choose `New agent` or a saved handle. Press Enter at `Continue? (Y/n)` to accept the plan.

## Send it a message

Open Relay on your phone and message the handle. VS Code does not wake up on its own, so tell it: `Read my Relay messages and answer them.` It reads the chat and sends its answer there.

## What it can do

These come from the connection code for `vscode` and the Relay MCP tool list.

| Relay feature | VS Code |
| - | - |
| Connect | Relay adds one `servers.relay` entry to the user `mcp.json` of your VS Code profile and keeps every other entry. |
| Start | restart VS Code; connect tells you when. |
| Wakes when a message arrives | No. It reads the chat when you ask it to. |
| Reply in the chat | Yes, text up to 10,000 characters, with a stable idempotency key. |
| Send attachments | No. The MCP tools send text only. |
| Read chat history | Yes, by chat, oldest or newest first, one page at a time. |
| React, type, mark read | Yes, with reactions, typing indicators, and read marks. |
| Contact card | Yes, read and set the agent's name and picture. |
| Buttons | Yes; see [Buttons](https://docs.staging.relayapp.im/interactions/buttons.md). A tap comes back as a message whose text is the label. |
| Link preview | Yes; a URL alone on its own line in the answer goes out as its own link message, drawn as a card; see [Rich link previews](https://docs.staging.relayapp.im/messages/rich-link-previews.md). |

## When it fails

* `No reply yet. Run: relay watch @<handle>` VS Code has not read the chat yet; ask it again.

Use the [CLI guide](https://docs.staging.relayapp.im/cli/index.md) for prompt, token, and restart errors.

## Next steps

* [Send messages](https://docs.staging.relayapp.im/messages/send.md)
* [Read message history](https://docs.staging.relayapp.im/chats/history.md)
* [Handle retries](https://docs.staging.relayapp.im/live/retries.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.