# VS Code

VS Code can read your fivebar stats over MCP, and answer questions about them.

Ask it about your sites in your own words, such as why traffic jumped on Tuesday, and it answers from your figures, following fivebar’s rules about what they mean. Working in your site’s code, it can also [add fivebar to it](https://fiveb.ar/docs/coding-assistants.md) and check it’s working. Connecting is adding fivebar’s address, signing in and choosing Allow, with no key to copy.

## Add fivebar

To add fivebar from a link, open [Add fivebar to VS Code](vscode:mcp/install?%7B%22name%22%3A%22fivebar%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Ffiveb.ar%2Fapi%2Fmcp%22%7D), or for VS Code Insiders, [Add fivebar to VS Code Insiders](vscode-insiders:mcp/install?%7B%22name%22%3A%22fivebar%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Ffiveb.ar%2Fapi%2Fmcp%22%7D). Or add it yourself:

1. Open the Command Palette, and run **MCP: Add Server**.
2. Choose **HTTP**, give it the address `https://fiveb.ar/api/mcp`, and the name fivebar.
3. Choose **Global** to have it in every workspace, or **Workspace** for this one.

Or add it by hand, to `.vscode/mcp.json` in a workspace, or to the file **MCP: Open User Configuration** opens:

```
{
  "servers": {
    "fivebar": {
      "type": "http",
      "url": "https://fiveb.ar/api/mcp"
    }
  }
}
```

## Sign in

The first time fivebar starts, VS Code asks whether you trust it, then says fivebar wants to authenticate. Choose **Allow**.

fivebar opens in your browser. Sign in if you need to, check that the page names VS Code, and choose Allow. VS Code can then [read the stats](https://fiveb.ar/docs/mcp.md#what-an-app-can-read) of every site on your Sites page, and changes nothing of yours unless you also tick the box to let it [change settings](https://fiveb.ar/docs/mcp.md#changing-settings).

## Try it

fivebar’s tools are in Copilot Chat in agent mode, under **Configure Tools**. To ask one of its [ready-made questions](https://fiveb.ar/docs/mcp.md#ready-made-questions), type it in the chat, such as `/mcp.fivebar.weekly_report`.

Ask VS Code about your sites in your own words, such as:

- Which pages did best last week, and where did their visitors come from?
- How does this month compare with last month so far?
- How many people are on my site right now?

## Removing it

Delete fivebar from the `mcp.json` it’s in. VS Code’s Accounts menu signs it out.

To stop VS Code reading your stats from fivebar’s side, disconnect it in [Settings](https://fiveb.ar/settings).

More in [VS Code’s own documentation](https://code.visualstudio.com/docs/agent-customization/mcp-servers).
