> ## Documentation Index
> Fetch the complete documentation index at: https://docs.niadra.com/llms.txt
> Use this file to discover all available pages before exploring further.

# VS Code

> Your space's MCP server in VS Code, with the key and the subject token prompted once and kept as secrets.

VS Code connects to MCP servers over HTTP in `.vscode/mcp.json`, with `inputs` that prompt for a value once and keep it as a secret. Use a key of the **sandbox** space (`nia_sk_test_...`), never a `live` one.

## What the connection needs

| Header                 | Value                                                       | Where it comes from                                                                          |
| ---------------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `Authorization`        | `Bearer` and the source key                                 | The Console, under **Agents and keys**, in the sandbox space                                 |
| `Niadra-Subject-Token` | A signed token that binds the connection to a test customer | [`POST /v1/subject-tokens`](/en/api/subject-tokens), with the same key; valid for 15 minutes |

## Connect

In `.vscode/mcp.json`:

```json theme={null}
{
  "inputs": [
    { "type": "promptString", "id": "niadra-api-key", "description": "Niadra source key of the sandbox space", "password": true },
    { "type": "promptString", "id": "niadra-subject-token", "description": "Subject token from POST /v1/subject-tokens (15 minutes)", "password": true }
  ],
  "servers": {
    "niadra": {
      "type": "http",
      "url": "https://acme-sandbox.us-east-2.api.niadra.com/mcp",
      "headers": {
        "Authorization": "Bearer ${input:niadra-api-key}",
        "Niadra-Subject-Token": "${input:niadra-subject-token}"
      }
    }
  }
}
```

The first time, VS Code prompts for both values and keeps them. The tools join the Chat's agent mode; with agent memory on in the space, `search_agent_memory` (and `remember`, with the `agent_memory:write` scope) show up next to the seven customer tools. `${env:NIADRA_API_KEY}` works too, for those who prefer environment variables.

## Limits

* The token lasts 15 minutes: once it expires, the customer tools answer `unauthenticated`. Mint another and use **MCP: Reset Cached Tools** or restart the server to enter the new one. The two agent memory tools work without a token.
* The customer is always the token's. The server answers `POST` only.
* Every tool call leaves a receipt in the space.

## Next steps

<CardGroup cols={2}>
  <Card title="MCP with any LLM" href="/en/guides/mcp">
    the tools, the token and what each one requires.
  </Card>

  <Card title="Coding assistants" href="/en/integrations/coding-assistants">
    the skill that teaches the assistant to connect a repository to Niadra.
  </Card>
</CardGroup>
