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

# VS Code / GitHub Copilot

> Register TrustGate as an HTTP MCP server in VS Code (GitHub Copilot).

Copy the URL from the MCP consumer **Connect** tab:

```text theme={null}
https://<mcp-host>/<consumer-slug>/mcp
```

Use **OAuth2** when Copilot can complete the browser login. API-key consumers send
`X-AG-API-Key` (`ag_…`, not TrustGuard `tgk_…`).

## Workspace `mcp.json`

Create `.vscode/mcp.json` (or the user MCP config your VS Code version uses):

```json theme={null}
{
  "servers": {
    "TrustGate": {
      "type": "http",
      "url": "https://<mcp-host>/<consumer-slug>/mcp"
    }
  }
}
```

API key:

```json theme={null}
{
  "servers": {
    "TrustGate": {
      "type": "http",
      "url": "https://<mcp-host>/<consumer-slug>/mcp",
      "headers": {
        "X-AG-API-Key": "ag_…"
      }
    }
  }
}
```

Private (Hybrid): add `"X-AG-Gateway-Slug": "<gateway-slug>"` in `headers`.

Reload the window. In Copilot Chat, enable the TrustGate MCP server if it is listed but
disabled. First OAuth connect may open a browser.

Exact keys (`servers` vs `mcpServers`) depend on VS Code / Copilot version; if the file is
ignored, paste the **JSON** tab from consumer **Connect** into the MCP config UI.

## Verify

In Copilot Chat, list tools or invoke one bound on the consumer.

## Related

* [MCP overview](/trustgate/mcp/overview)
* [VS Code MCP](https://code.visualstudio.com/docs/copilot/customization/mcp-servers)
