Surrealdb MCP Server

A Model Context Protocol (MCP) server that provides a standardized interface for AI assistants to interact with a SurrealDB database.

Remote serverstreamable-httpTypeScript

What is the Surrealdb MCP server?

Surrealdb mcp server connects Surrealdb to AI assistants that speak the Model Context Protocol. A Model Context Protocol (MCP) server that provides a standardized interface for AI assistants to interact with a SurrealDB database.

What Surrealdb does

A Model Context Protocol (MCP) server that provides a standardized interface for AI assistants to interact with a SurrealDB database. This server enables AI systems to query and manipulate data within a configured SurrealDB instance.

Tools it exposes

Once connected, the assistant can call these 13 tools directly:

  • query — Execute a raw SurrealQL query
  • select — Select records from a table (all or by specific ID)
  • create — Create a single new record in a table
  • update — Update a specific record, replacing its content
  • delete — Delete a specific record by ID
  • merge — Merge data into a specific record (partial update)
  • patch — Apply JSON Patch operations to a specific record
  • upsert — Create a record if it doesn't exist, or update it if it does
  • insert — Insert multiple records into a table
  • insertRelation — Create a graph relation (edge) between two records
  • Testing — The Testing tool exposed by this server
  • Contributing — Contributions are welcome! Please see CONTRIBUTING.md for guidelines
  • Installation — For more details, visit the n8n-nodes-mcp GitHub repository

Installing the surrealdb mcp server

The server is distributed via npm as approach, so most clients can run it without a manual build step. Add it to your MCP client's configuration and restart the client to pick it up — the copy-paste configs for Claude Desktop, Claude Code and Cursor are on this page.

Configuration

Before the server will start you need to supply 5 environment variables: SURREALDB_URL, SURREALDB_NS, SURREALDB_DB, SURREALDB_USER, SURREALDB_PASS. Keep credentials in your client's env block or a secrets manager rather than committing them.

Where it fits

Developer-tool servers are usually the first ones people connect, because they turn "help me with this code" into an assistant that can actually read the repo and act on it. Surrealdb sits in that group, and the shape of its toolset — query, select, create among others — tells you what it is really for. Worth comparing against the other developer tools servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.

Practical notes

  • This is a hosted server — you point your client at an endpoint rather than running a local process, so there is nothing to keep updated on your machine.
  • It will not start until its required credentials are present, so set those before wondering why the tools never appear.
  • With 13 tools exposed, expect a noticeable bump in prompt size — disable it in projects that never use Surrealdb.
  • Maintained by nsxdavid, written in TypeScript.
  • MCP clients ask for confirmation before each tool call by default. Keep that on while you learn what the surrealdb mcp server actually does with your data.
  • Every entry in this directory is reviewed by hand before it goes live, and details are checked against the project's own documentation.

Available tools

ToolWhat it does
queryExecute a raw SurrealQL query.
selectSelect records from a table (all or by specific ID).
createCreate a single new record in a table.
updateUpdate a specific record, replacing its content.
deleteDelete a specific record by ID.
mergeMerge data into a specific record (partial update).
patchApply JSON Patch operations to a specific record.
upsertCreate a record if it doesn't exist, or update it if it does.
insertInsert multiple records into a table.
insertRelationCreate a graph relation (edge) between two records.
TestingThe Testing tool exposed by this server.
ContributingContributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
InstallationFor more details, visit the [n8n-nodes-mcp GitHub repository](https://github.com/nerding-io/n8n-nodes-mcp).

How to install the Surrealdb MCP server

{
  "mcpServers": {
    "surrealdb": {
      "command": "node",
      "args": ["/path/to/your/surrealdb-mcp-server/build/index.js"],
      "env": {
        "SURREALDB_URL": "ws://localhost:8000",
        "SURREALDB_NS": "your_namespace",
        "SURREALDB_DB": "your_database",
        "SURREALDB_USER": "your_db_user",
        "SURREALDB_PASS": "your_db_password"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
SURREALDB_URLEndpoint or connection string the server talks to.Yes
SURREALDB_NSConfiguration value read at startup.Optional
SURREALDB_DBConfiguration value read at startup.Optional
SURREALDB_USERConfiguration value read at startup.Optional
SURREALDB_PASSConfiguration value read at startup.Optional

Example prompts to try

  • Use Surrealdb to query.
  • Use Surrealdb to select.
  • Use Surrealdb to create.

Frequently asked questions

It connects Surrealdb to MCP-compatible AI assistants such as Claude and Cursor, exposing 13 tools (query, select, create, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Surrealdb directly.