Connect VS Code

VS Code reads MCP servers from .vscode/mcp.json (per workspace) or your user profile, and supports headers and prompted inputs, so the key never has to sit in a file. VS Code's commands and menus change between releases; the file and JSON below are what stay the same.

Before you start

Create an API key in Fitaio (Settings, then Developer), with read and write scope if the agent should log entries.

Connect

Create .vscode/mcp.json:

{
  "inputs": [
    { "type": "promptString", "id": "fitaio-key", "description": "Fitaio API key", "password": true }
  ],
  "servers": {
    "fitaio": {
      "type": "http",
      "url": "https://fitaio.app/mcp",
      "headers": { "Authorization": "Bearer ${input:fitaio-key}" }
    }
  }
}

VS Code asks for the key the first time the server starts and stores it securely.

Check it worked

Open the Chat view in Agent mode and pick the tools icon: fitaio should list its tools. Ask:

Use Fitaio to fetch my body weight trend for the last 30 days and summarise it.

The agent calls get_body_metrics. Every tool is in the tool reference.

Troubleshooting

  • Server shows an error in the MCP view. Run MCP: List Servers from the command palette, pick fitaio and choose Show Output for the reason. A 401 means the key is wrong or revoked.
  • You entered the wrong key. VS Code stores what you type for fitaio-key after the first prompt, and offers no command to view, change or clear it. MCP: Reset Trust clears the trust prompt, not the stored input. Rename the input's id in .vscode/mcp.json (and its ${input:...} reference) to something new; VS Code treats it as unseen and prompts again. MCP: List Servers shows and manages the server itself.
  • Writes refused with insufficient_scope. Create a key with read and write scope.