# MCP in Claude

Add the SurrealDB MCP Server to Claude Code, Claude Desktop, or the Claude app.

Claude can reach your SurrealDB Cloud account through the [SurrealDB MCP Server](/docs/build/ai-agents/mcp.md). Setup takes a minute, and you sign in with your Surreal ID in the browser, so there are no credentials to paste.

## Claude Code

Add the server:

```bash
claude mcp add --transport http surrealdb https://mcp.surrealdb.com
```

Run `/mcp` inside Claude Code, choose **surrealdb**, and authenticate. A browser window opens for you to sign in and approve the connection.

Check it worked:

```bash
claude mcp list
```

**surrealdb** should be listed as connected. Ask Claude which SurrealDB organisations it can see, and it should answer with yours.

To connect it for one project rather than everywhere, add `--scope project`. The entry is written to `.mcp.json` in the repository, which you can commit for your team. Everyone still signs in as themselves.

## Claude Desktop and the Claude app

Open **Settings → Connectors → Add custom connector** and fill in:

| Field | Value |
| --- | --- |
| Name | `SurrealDB` |
| URL | `https://mcp.surrealdb.com` |

Claude opens a browser window for you to sign in. Once it closes, start a new conversation and open the tools menu in the composer. The SurrealDB tools appear there.

## Using a personal access token instead

If you would rather not sign in through the browser, or you are running Claude somewhere without one, create a token in the [account portal](https://account.surrealdb.com/tokens) and pass it as a header:

```bash
claude mcp add --transport http surrealdb https://mcp.surrealdb.com \
  --header "Authorization: Bearer <your-token>"
```

Tick only the permissions the work needs. [Signing in](/docs/build/ai-agents/mcp.md#signing-in) lists what each one allows.

## Try it

> Show me the SurrealDB instances in my organisation, and tell me which of them are paused.

Claude lists your organisations, picks the one you meant, and reports each instance with its state. [Example usages](/docs/build/ai-agents/mcp/examples.md) has more to try, including deploying an instance and querying its data.

## Removing it

```bash
claude mcp remove surrealdb
```

In Claude Desktop and the Claude app, open **Settings → Connectors** and remove the SurrealDB connector.

## Troubleshooting

| What you see | What to do |
| --- | --- |
| `claude mcp list` shows the server as failed | Run `/mcp` and authenticate. Until you sign in, only the sign-in tool works |
| The browser window never opens | Sign in from `/mcp` again, and check nothing is blocking pop-ups |
| Claude cannot see the tools in Claude Desktop | Quit and reopen the app completely, then start a new conversation |
| A tool reports a missing permission | You are using a personal access token created without it. Create a new token with that box ticked |
