# VS Code

> Connect MMW to VS Code (agent mode) over direct HTTP with an mcp.json file.

On this page you will connect MMW to VS Code over direct HTTP without storing your key in plain text in the repository, and verify the connection.

## What you get

- The `remember`, `search`, `forget`, `validate_memory` and `gateway_call` tools in VS Code chat in agent mode.
- Memory shared with Claude Code, Cursor, Codex and claude.ai when the key belongs to the same account and project.
- Nothing to install: the connection goes straight over HTTPS.

## Prerequisites

- An MMW API key (starts with `mmw_`); see the [Quickstart](/start/quickstart/).
- VS Code with MCP server support and chat in agent mode.

The `mcp.json` format in VS Code has changed between versions. Below is the variant current at the time of writing: a top-level `servers` key, and `type`, `url` and `headers` fields on the server. If your version uses different names, check the VS Code MCP documentation; the server URL and header stay the same.

## Setup

1. Create `.vscode/mcp.json` in the project root. To use MMW in every project, use your user-level MCP configuration instead (the "MCP: Open User Configuration" command in versions that have it).

2. Add the server. Rather than writing the key into the file, have VS Code prompt for it:

   ```json title=".vscode/mcp.json"
   {
     "inputs": [
       {
         "type": "promptString",
         "id": "mmw-key",
         "description": "MMW API key",
         "password": true
       }
     ],
     "servers": {
       "mmw": {
         "type": "http",
         "url": "https://mcp.mmwhub.tech/mcp",
         "headers": { "Authorization": "Bearer ${input:mmw-key}" }
       }
     }
   }
   ```

   VS Code asks for the key the first time the server starts and keeps it in its secure storage.

3. Start the server: a Start link appears above the `mmw` block in the editor, or run "MCP: List Servers" and start `mmw` from there.

## Verify

1. Open VS Code chat and switch it to agent mode.

2. Click the tools picker: the list should include the `mmw` server with `remember`, `search`, `forget`, `validate_memory` and `gateway_call`.

3. Ask:

   ```text
   Remember in MMW: staging is deployed with the systemd unit app-staging. Fact key: deploy-staging.
   ```

   VS Code may ask you to confirm the `remember` call; once confirmed, the record is saved with the `unverified` status.

4. In a new chat ask:

   ```text
   How do we deploy staging? Check MMW.
   ```

   Expected answer: the agent calls `search` and replies that staging is deployed with `app-staging`.

## Common problems

Check the URL (`https://mcp.mmwhub.tech/mcp`, ending in `/mcp`) and that the header reads `Bearer`, a space, then the key. If you mistyped the key, clear the stored input value in VS Code and start the server again.

If the key was written into `.vscode/mcp.json` in plain text and the file was committed, revoke the key in your account and issue a new one. Use `inputs` as in the example above.

MCP tools are available only in agent mode. In plain ask mode the chat does not call them.

## What's next
