# Zed

Installing SurrealDB Agent Memory as an MCP server in the Zed editor.

Zed calls MCP servers **context servers**. Installing SurrealDB Agent Memory gives Zed's assistant persistent memory across sessions, so it can recall previous decisions and project context without you repeating them.

For integration rules your agent should follow (auth, scope, endpoints, common mistakes), see **[Agent guide (AGENTS.md)](/docs/agent-memory/reference/agents.md)**. Zed reads a project `AGENTS.md` automatically.

## Quick install

Install with [`install-mcp`](https://github.com/supermemoryai/install-mcp) - the `/mcp` URL is the first argument, auth goes through `--header`, and `--oauth no` skips the OAuth prompt (SurrealDB Agent Memory uses a static Bearer key):

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

Or configure it by hand, as below.

## Configure

Open Zed settings (`cmd`/`ctrl` `,`), which edits `~/.config/zed/settings.json`, and add SurrealDB Agent Memory under `context_servers`. Recent Zed versions connect to a remote server directly from a `url`:

```json
{
  "context_servers": {
    "spectron": {
      "url": "https://<your-context-host>/mcp",
      "headers": {
        "Authorization": "Bearer <your-api-key>",
        "X-Spectron-Context": "acme-prod"
      }
    }
  }
}
```

On **SurrealDB Cloud**, use your context host from SurrealDB Studio **API keys** (not a generic shared domain). **Self-hosted:** replace the URL with your SurrealDB Agent Memory server's base URL + `/mcp`.

> [!NOTE]
> Zed runs stdio context servers as child processes. If your Zed version does not yet accept a remote `url`, bridge the HTTP endpoint through `mcp-remote` instead:
> ```json
> {
>   "context_servers": {
>     "spectron": {
>       "command": {
>         "path": "npx",
>         "args": ["-y", "mcp-remote", "https://<your-context-host>/mcp", "--header", "Authorization: Bearer <your-api-key>"]
>       }
>     }
>   }
> }
> ```

## Verify the installation

1. Open the Agent panel (the assistant icon in the status bar)
2. Open the settings view and confirm **spectron** appears under context servers with a running indicator
3. Ask "What MCP tools do you have available?" Zed should report the SurrealDB Agent Memory tools

If the server does not start, check that `settings.json` is valid JSON and that the URL and API key are correct.

## Usage examples

**Store a project decision:**

> "Remember that we render Markdown with a custom pipeline and never pull in a heavyweight parser."

Zed calls `memory_store` with a suitable `scope`.

**Recall context before a task:**

> "How do we handle Markdown rendering in this project?"

Zed calls `memory_recall` before answering.

## Scope per project

Narrow reads and writes with the per-tool **`scope`** argument (slash paths, for example `["org/acme/project/editor"]`). Register paths with `spectron scopes create` before first use. For project isolation, use separate contexts or distinct scope paths.

## Removing SurrealDB Agent Memory

Delete the `"spectron"` entry from `context_servers` in `~/.config/zed/settings.json`.
