# Connect DealScore to VS Code

You connect DealScore to VS Code by adding a servers entry with type http and the URL https://cardealscore.com/api/mcp to .vscode/mcp.json with no headers, then finishing the email sign-in VS Code opens in your browser. DealScore is a remote MCP server at `https://cardealscore.com/api/mcp`. VS Code reads `.vscode/mcp.json`. The entry uses `servers`, `"type": "http"`, and that URL. Leave headers out. VS Code discovers OAuth from the URL and opens a browser for the email sign-in. After you approve access, Copilot in agent mode can call `score_deal`.

Page: https://cardealscore.com/integrations/vs-code

Get a free API key: https://cardealscore.com/login?next=%2Fkeys. Used car price API: https://cardealscore.com/used-car-price-api

## Add the server

1. In the project, create or open `.vscode/mcp.json`. The same block works in your user profile. Run `MCP: Open User Configuration` to open that file.
2. Paste the config below. Leave headers out. The URL alone is what VS Code uses to start OAuth.
3. Save the file. Trust the workspace if VS Code asks. VS Code then opens a browser for the email sign-in.
4. Open the email link DealScore sends and approve access. VS Code then calls the server with the access token.
5. In Copilot chat, use agent mode and ask it to call `score_deal` with a year, make, model, asking price, and mileage. ZIP is optional.

.vscode/mcp.json:

```json
{
  "servers": {
    "dealscore": {
      "type": "http",
      "url": "https://cardealscore.com/api/mcp"
    }
  }
}
```

No headers. VS Code discovers OAuth and opens a browser for the email sign-in. Full setup: /integrations/vs-code.

You can also run `MCP: Add Server` from the Command Palette. For a new server, that command prefers `.mcp.json` at the project root. That file uses `mcpServers` instead of `servers`. It still offers `.vscode/mcp.json`. Both files are read. Keep headers off the OAuth entry.

## Quick answers

### What goes in .vscode/mcp.json for DealScore?

A dealscore entry under servers with type http, url set to https://cardealscore.com/api/mcp, and no headers. The same block works in your user profile through MCP: Open User Configuration.

### Which part of VS Code calls DealScore?

Copilot in agent mode. After the sign-in, ask it to call score_deal with a year, make, model, asking price, and mileage.

### Can VS Code use a DealScore API key instead?

Yes, when the browser sign-in is unavailable. Send the key from /keys in an x-api-key header. To keep it out of a file you commit, use an input variable and VS Code prompts for the key.

### Which tools does VS Code get, and what do they cost?

score_deal, explain_grade, and health. Free includes 5 scored calls a month. Only results with coverage: scored count, and explain_grade and health are never metered.

## API key, when the browser sign-in is unavailable

VS Code's OAuth path above is the one to use. A client that cannot open a browser can send `x-api-key` instead. Create the key on https://cardealscore.com/keys. `Authorization: Bearer YOUR_KEY` works in that header slot too. A header on this block skips the browser sign-in.

MCP config with an API key:

```json
{
  "servers": {
    "dealscore": {
      "type": "http",
      "url": "https://cardealscore.com/api/mcp",
      "headers": { "x-api-key": "YOUR_KEY" }
    }
  }
}
```

To keep the key out of a file you commit, put `${input:dealscore-key}` in the header value. VS Code prompts for it the first time the server starts.

## If score_deal is missing

- The OAuth config is `type` `http`, a `url`, and no `headers`. A header on that block skips the browser sign-in.
- Finish the email sign-in. An unfinished consent leaves `score_deal` unauthorized.
- Trust the workspace if VS Code asks. An untrusted server does not start.
- `coverage: cannot_score` with a null grade means comps were too thin. The connection worked.
- `score_quota_exceeded` means the monthly cap is spent. The connection worked. Plans: https://cardealscore.com/pricing

## What the agent can call

`score_deal` grades a deal. Send `asking_price` and `mileage`, plus a VIN or year, make, and model. `trim` and `zip` are optional. `explain_grade` maps a `delta_pct` to a grade without fetching comps. `health` reports coverage and limits. Free includes 5 scored calls a month and Builder is $19/mo (founding price) for 1,000 scored calls a month. Only `coverage: scored` counts, and `explain_grade` and `health` are never metered. Plans: https://cardealscore.com/pricing. Argument details: https://cardealscore.com/docs/api. Test arguments in the browser first: https://cardealscore.com/try.

## Other clients

[Cursor](https://cardealscore.com/integrations/cursor), [Claude Code](https://cardealscore.com/integrations/claude-code), [Claude Desktop](https://cardealscore.com/integrations/claude-desktop), [Codex](https://cardealscore.com/integrations/codex), [ChatGPT](https://cardealscore.com/integrations/chatgpt), [n8n](https://cardealscore.com/integrations/n8n). The REST call and a recorded response are on https://cardealscore.com/used-car-price-api. Every client is also listed on https://cardealscore.com/agents.
