SurrealDB

v1.0.0Databasesstable

The official MCP server for SurrealDB

databasemcpmcp-servermodel-context-protocolsurreal
Share:
95
Stars
0
Downloads
0
Weekly
0/5

What is SurrealDB?

SurrealDB is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to official mcp server for surrealdb

The official MCP server for SurrealDB

This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • The official MCP server for SurrealDB

Use Cases

Multi-model database queries and operations
Real-time data management
SurrealDB document and relational access
surrealdb

Maintainer

LicenseNOASSERTION
Languagerust
Versionv1.0.0
UpdatedMay 20, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx surrealmcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use SurrealDB

SurrealMCP is the official Model Context Protocol server for SurrealDB, enabling AI assistants, coding IDEs, and data platforms to interact directly with SurrealDB databases and SurrealDB Cloud through natural language. It supports multiple transport modes including stdio, HTTP, and Unix socket connections, and provides bearer token authentication for SurrealDB Cloud along with built-in rate limiting, health checks, structured logging, and OpenTelemetry tracing. Developers using SurrealDB for document, relational, or graph data can connect tools like Cursor, Claude Desktop, GitHub Copilot, and n8n to their databases without writing custom integration code.

Prerequisites

  • A running SurrealDB instance (local) or a SurrealDB Cloud account
  • Rust toolchain with cargo (for building from source), or Docker
  • An MCP-compatible client such as Claude Desktop, Cursor, VS Code with Copilot, or Zed
  • SurrealDB connection credentials: URL, namespace, database name, username, and password
1

Install SurrealMCP via Docker (recommended)

Pull and run the official SurrealMCP Docker image. This is the simplest installation method and always runs the latest version.

docker run --rm -i --pull always surrealdb/surrealmcp:latest start
2

Or build from source with Cargo

If you prefer a native binary, clone the repository and build with Cargo. The binary will be installed to your Cargo bin directory.

cargo install --path .
3

Configure connection to SurrealDB

Set environment variables for your SurrealDB connection. These can be passed directly to Docker with -e flags or set in your shell for native installations.

export SURREALDB_URL=ws://localhost:8000/rpc
export SURREALDB_NS=myapp
export SURREALDB_DB=production
export SURREALDB_USER=admin
export SURREALDB_PASS=password123
4

Configure your MCP client

Add SurrealMCP to your client configuration. The Docker-based approach requires no local binary installation — just Docker.

5

Verify the connection

Open your MCP client and confirm that SurrealDB tools are visible. Try a simple query to verify the database connection is working.

SurrealDB Examples

Client configuration (Docker)

Claude Desktop configuration using the SurrealMCP Docker image with environment variables for database connection.

{
  "mcpServers": {
    "SurrealDB": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "--pull", "always",
        "-e", "SURREALDB_URL=ws://localhost:8000/rpc",
        "-e", "SURREALDB_NS=myapp",
        "-e", "SURREALDB_DB=production",
        "-e", "SURREALDB_USER=admin",
        "-e", "SURREALDB_PASS=password123",
        "surrealdb/surrealmcp:latest",
        "start"
      ],
      "disabled": false,
      "autoApprove": []
    }
  }
}

Prompts to try

Sample prompts for interacting with SurrealDB through the MCP server once connected.

- "List all records in the users table in the myapp namespace"
- "Create a new product record with name 'Widget', price 29.99, and category 'hardware'"
- "Run a SurrealQL query to find all orders placed in the last 7 days"
- "Show me the schema for the orders table"
- "Delete all records from the sessions table where created_at is older than 30 days"

Troubleshooting SurrealDB

Docker container starts but cannot connect to a local SurrealDB instance

When SurrealDB runs on the host machine, the container cannot reach localhost. Use host.docker.internal instead: SURREALDB_URL=ws://host.docker.internal:8000/rpc. On Linux you may need --add-host=host.docker.internal:host-gateway in the Docker args.

Authentication fails with 'Access denied' or credential errors

Verify SURREALDB_USER, SURREALDB_PASS, SURREALDB_NS, and SURREALDB_DB are all set correctly. SurrealDB Cloud uses bearer tokens — set SURREALDB_TOKEN instead of username/password for cloud connections.

The surrealmcp binary is not found after cargo install

Ensure ~/.cargo/bin is in your PATH. Run source ~/.cargo/env or add export PATH="$HOME/.cargo/bin:$PATH" to your shell profile, then restart your terminal.

Frequently Asked Questions about SurrealDB

What is SurrealDB?

SurrealDB is a Model Context Protocol (MCP) server that official mcp server for surrealdb It connects AI assistants to external tools and data sources through a standardized interface.

How do I install SurrealDB?

Follow the installation instructions on the SurrealDB GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with SurrealDB?

SurrealDB works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is SurrealDB free to use?

Yes, SurrealDB is open source and available under the NOASSERTION license. You can use it freely in both personal and commercial projects.

Browse More Databases MCP Servers

Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "surrealmcp": { "command": "npx", "args": ["-y", "surrealmcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use SurrealDB?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides