# Use Comma with VS Code — publish HTML reports from Copilot agent mode

Canonical: https://commareports.com/mcp/vscode

> Add the Comma MCP server to VS Code in one command. GitHub Copilot's agent mode can publish HTML reports, search the workspace, and read and reply to anchored comments under a scoped token.

# Use Comma with VS Code

VS Code speaks the Model Context Protocol through GitHub Copilot's agent
mode. Attach Comma's hosted MCP server and the agent picks up the full set
of report and comment tools — same scoped token shape as the REST API,
nothing to run locally.

## Add Comma in one command

```bash
code --add-mcp '{"name":"comma","type":"http","url":"https://commareports.com/api/mcp","headers":{"Authorization":"Bearer <your comma_sk_… token>"}}'
```

Mint the token at **Settings → API tokens → New token** on Comma. Scope it
to what the agent should be able to do — typically `reports:write` and
`comments:write`.

MCP support surfaces through Copilot agent mode in recent VS Code
releases; if the command isn't recognized, update VS Code first. Exact
menu locations vary a little between versions.

## Or: a workspace file, without committing the token

For a per-project setup you can share with the team, add
`.vscode/mcp.json` to the workspace. The `inputs` block makes VS Code
prompt each user for their own token instead of reading it from the file —
so the config is committable and the secret isn't:

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "comma-token",
      "description": "Comma API token (comma_sk_…)",
      "password": true
    }
  ],
  "servers": {
    "comma": {
      "type": "http",
      "url": "https://commareports.com/api/mcp",
      "headers": {
        "Authorization": "Bearer ${input:comma-token}"
      }
    }
  }
}
```

VS Code asks for the token the first time the server starts and stores it
outside the repo. Each teammate uses their own scoped token — separate
blast radii, separate revocation.

## What the agent can do

| Capability                | Tools                                                                     |
| ------------------------- | ------------------------------------------------------------------------- |
| Publish a report          | `create_report`, `update_report`                                          |
| Find existing reports     | `list_reports`, `search_reports`, `get_report`, `read_report`             |
| Leave / reply to comments | `add_comment`, `reply_to_comment`, `set_comment_status`, `list_comments`  |
| Request review            | `request_review`                                                          |
| Manage assets             | `upload_report_asset`, `list_report_assets`, `delete_report_asset`        |

The agent picks the right tool from its reasoning — there are no
VS-Code-specific commands to memorize.

## Common workflows

### Publish at the end of a task

Ask Copilot to "write up this refactor as an HTML summary and publish it
to Comma." The agent generates the HTML, calls `create_report`, and hands
back the share link — your team opens a document, not a diff.

### Respond to review feedback

Teammates leave anchored comments on the published report. Next session,
ask the agent to "check the comments on the refactor summary and address
them" — it reads the threads with `list_comments`, ships a new revision
with `update_report` (same URL), replies, and resolves the threads.

### Keep one URL across agents

Reports belong to your workspace, not to the agent that wrote them. A
report published from VS Code can be updated by Claude Code or Cursor
tomorrow — the link your stakeholders bookmarked keeps working.

## Token shape

- Scoped — you choose which actions it can take when you create it.
- Revocable in one click from **Settings → API tokens**. Revocation
  applies immediately to the REST API, the MCP server, and any routines
  the token created.
- Rate-limited per token (60 requests/minute by default).

Details in [API tokens →](/docs/api-tokens), and patterns in
[Scoped tokens for AI agents →](/agents/scoped-tokens-for-ai-agents).

## Try it

Run the `--add-mcp` one-liner, generate a token, and ask the agent to
publish anything you have lying around as HTML. From the web UI, leave an
anchored comment and ask the agent what it sees on its next turn.

**[Generate a token →](https://commareports.com/settings/tokens)**

### Related

- [Comma MCP server overview](/mcp)
- [Use Comma with Cursor](/mcp/cursor)
- [Use Comma with Claude Code](/mcp/claude-code)
- [Where should my AI agent post its work?](/agents/where-should-my-agent-post)
