# Use Comma with Visual Studio — an MCP server for Copilot agent mode

Canonical: https://commareports.com/mcp/visual-studio
Published: 2026-09-16

> Add Comma to Visual Studio 2022 or 2026 Copilot agent mode with a .mcp.json servers entry and a requestInit Authorization header. Publish HTML reports from the IDE.

# Use Comma with Visual Studio

Visual Studio 17.14 and later run Copilot in agent mode with MCP tools. .NET teams produce plenty of reports worth reviewing — test results, coverage, benchmark runs — and Comma gives the agent somewhere to publish them as a page instead of a TRX file nobody opens.

## Add Comma to Visual Studio

Visual Studio reads, in order: `%USERPROFILE%\.mcp.json`, `<solution>\.vs\mcp.json`, `<solution>\.mcp.json`, `<solution>\.vscode\mcp.json`, `<solution>\.cursor\mcp.json`. Or in Copilot Chat (Agent mode) → **Tools** → **+** → **Add custom MCP server**.

```json
{
  "servers": {
    "comma": {
      "url": "https://commareports.com/api/mcp",
      "requestInit": {
        "headers": {
          "Authorization": "Bearer comma_sk_…"
        }
      }
    }
  }
}
```

Replace `comma_sk_…` with a token from **Settings → API tokens → New token** on Comma (or export it as `COMMA_API_TOKEN` where the snippet reads an env var). The default scopes — `reports:write`, `comments:read`, `comments:write` — cover publishing and review.

## Visual Studio gotchas

- **Top-level key is `servers`**, not `mcpServers`.
- **Headers go in `requestInit.headers`.** If your Visual Studio build doesn't pick the header up, use the `mcp-remote` bridge below — same endpoint, header passed on the command line.
- **Use `%USERPROFILE%\.mcp.json` for the token.** Solution-level files get committed.

### Fallback: the mcp-remote bridge

If the header isn't sent, run the hosted endpoint through `mcp-remote` as a local stdio server (rename the top-level key to `servers` for Visual Studio):

```json
{
  "mcpServers": {
    "comma": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://commareports.com/api/mcp",
        "--header",
        "Authorization:${AUTH_HEADER}",
        "--transport",
        "http-only"
      ],
      "env": { "AUTH_HEADER": "Bearer comma_sk_…" }
    }
  }
}
```

## What the agent can do

| Capability                | Tools                                                                    |
| ------------------------- | ------------------------------------------------------------------------ |
| Publish a report          | `create_report`, `update_report`, `create_report_from_url`               |
| 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` |
| Ask for review, share     | `request_review`, `set_report_sharing`, `get_report_signoffs`            |
| Manage assets             | `upload_report_asset`, `list_report_assets`, `delete_report_asset`       |

Copilot agent mode picks the tool from the request — there are no Visual Studio-specific commands to learn.

## A workflow that sticks

1. Ask Copilot agent mode to write up the work as a self-contained HTML report and publish it to Comma. It calls `create_report` and returns a link.
2. Send the link. Reviewers open a rendered page and leave comments anchored to the exact line, cell or chart they mean — no account needed to read a public link.
3. Next session, ask Copilot agent mode to address the comments. It reads the threads with `list_comments`, ships a revision with `update_report` (same URL), replies, and resolves them.

Reports belong to your workspace, not to the agent. A report published from Visual Studio can be revised tomorrow from Claude Code or Cursor, and the link people bookmarked keeps working.

## Token shape

- Lives in `%USERPROFILE%\.mcp.json` — keep it out of solution-level files.
- 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.

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

## Try it

Add the entry, generate a token, restart Visual Studio, and ask for a report on something you worked on today. Then leave a comment on it and ask the agent what it sees.

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

### Related

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