# Installing the MCP server

Connect SurrealDB Agent Memory to Claude, Cursor, Windsurf, VS Code, and other MCP clients.

SurrealDB Agent Memory serves MCP (Streamable HTTP) at **`/mcp`** on the same host and port as the REST API. Point any MCP client at that endpoint:

- **SurrealDB Cloud** - your context host from SurrealDB Studio **API keys** with `/mcp` appended, for example `https://abc123.spectron.cloud/mcp`.
- **Self-hosted** - your server's base URL plus `/mcp`, for example `http://localhost:9090/mcp`.

Authentication uses **`Authorization: Bearer`**, the same as REST. Each key is bound to one Context, so `context_id` is optional on every tool call. The tools map to the unified substrate: `remember`, `recall`, `context`, `reflect`, `forget`, `upload`, `inspect`.

## Quick install

[`install-mcp`](https://github.com/supermemoryai/install-mcp) writes the correct config for most clients. Pass the `/mcp` URL as the first argument, your key with `--header`, and `--oauth no` to skip the OAuth prompt (SurrealDB Agent Memory uses a static Bearer key, not OAuth):

```bash
npx install-mcp https://<your-context-host>/mcp \
  --client cursor \
  --header "Authorization: Bearer <your-api-key>" \
  --oauth no
```

Use this for `cursor`, `vscode`, `windsurf`, `zed`, and `opencode`. **Claude** (Code, Cowork, Desktop) and **Codex** have a dedicated SurrealDB plugin - see the [Claude](/docs/agent-memory/integrations/mcp-server/coding-assistants/claude-desktop-and-code.md) and [Codex](/docs/agent-memory/integrations/mcp-server/coding-assistants/codex.md) guides. JetBrains and Antigravity use the manual configuration below.

## Manual configuration

Any MCP client can be configured by hand:

```json
{
  "mcpServers": {
    "spectron": {
      "url": "https://<your-context-host>/mcp",
      "headers": {
        "Authorization": "Bearer <your-api-key>"
      }
    }
  }
}
```

Some clients use a different key or shape - `serverUrl` in Windsurf and Antigravity, a `servers` object with a `type` field in VS Code. The per-client guides show each one.

## Per-client guides

- [Claude Desktop and Claude Code](/docs/agent-memory/integrations/mcp-server/coding-assistants/claude-desktop-and-code.md)
- [Cursor](/docs/agent-memory/integrations/mcp-server/coding-assistants/cursor.md)
- [VS Code](/docs/agent-memory/integrations/mcp-server/coding-assistants/vscode.md)
- [Windsurf](/docs/agent-memory/integrations/mcp-server/coding-assistants/windsurf.md)

## MCP vs SDK

| Situation | Use |
| --- | --- |
| Coding assistant with native MCP | `install-mcp` or manual `/mcp` config |
| Application code (Python/TS) | `surrealdb` / `@surrealdb/spectron` |
| Agent framework with harness adapter | `spectron-crew-ai`, `@surrealdb/spectron-vercel-ai`, … |
| Custom infrastructure | [REST API](/docs/agent-memory/reference/rest-api.md) |

Tool schemas: [MCP tools reference](/docs/agent-memory/reference/mcp-tools.md).
