brsh

Connect an AI agent (MCP) ​

This page helps you connect an AI helper, such as Claude Code, to Brsh. The helper can then design in your open file.

Brsh runs an MCP server on your computer. Nobody else can reach it.

What you need ​

  • Brsh must stay open while the helper works.
  • The helper must be an MCP client. Claude Code, Claude Desktop, Cursor and Codex are examples.

How to connect ​

  1. Open Brsh.
  2. Click MCP in the top bar.
  3. Find your helper in the window that opens.
  4. Click the copy button next to its setup text.
  5. Paste the text where your helper needs it.

The window has three setups.

Claude Code ​

  1. Click MCP in the top bar.
  2. Click the copy button in the Claude Code box.
  3. Paste the command in your terminal and press Enter.

The command looks like this. The app fills in your token for you.

bash
claude mcp add --transport http brsh http://127.0.0.1:47821/mcp --header "Authorization: Bearer <your token>"

Claude Desktop ​

Claude Desktop starts a program. It does not use a web address. So Brsh gives you a setup that starts Brsh itself.

  1. Click MCP in the top bar.
  2. Click Copy config in the Claude Desktop box.
  3. In Claude Desktop, open Settings, then Developer, then Edit Config.
  4. Add the text to the file claude_desktop_config.json.
  5. Restart Claude Desktop.

Other helpers (Cursor, Codex) ​

  1. Click MCP in the top bar.
  2. Click Copy config in the Clients that take an HTTP URL box.
  3. Paste the text in your helper's MCP settings.

The address and the token ​

  • The address is http://127.0.0.1:47821/mcp. If another program uses that port, Brsh takes the next free port, up to 47830. The MCP window always shows the right address.
  • The token is in the file ~/.brsh/mcp-token. Only you can read that file.
  • The token stays the same each time you restart Brsh.
  • Do not share your token. It gives full control of the editor.

What the helper gets ​

The helper gets these tools:

  • get_workspace shows what is open and what you selected.
  • edit_design changes the open file with one script.
  • get_code gives the HTML and CSS of screens or layers.
  • preview_theme shows a theme without saving it.
  • save_document saves the file.
  • read_guide gives the helper the guide for agents.

The helper also gets Brsh's rules when it connects. The helper reads the rules of your file too. You can read the guide for agents here: mcp/skill/SKILL.md.

See what the helper does ​

  • You see the helper's cursor on the canvas while it works.
  • You see what it reads and what it changes.
  • Each edit is one undo step.
  • The agent activity list in the top bar shows each change (see What agents can do). It lists the calls that changed layers on the page you look at. A line under the list counts the calls on other pages or in other files.

Notes ​

  • Many helpers can connect at the same time.
  • If the MCP button says the server is not running, the helper cannot connect.