SurrealDB
The official MCP server for SurrealDB
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
Maintainer
Works with
Installation
Manual Installation
npx surrealmcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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 startOr 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 .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=password123Configure your MCP client
Add SurrealMCP to your client configuration. The Docker-based approach requires no local binary installation — just Docker.
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.
SurrealDB Alternatives — Similar Databases Servers
Looking for alternatives to SurrealDB? Here are other popular databases servers you can use with Claude, Cursor, and VS Code.
Excelize
★ 20.6kGo language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
MCP Toolbox for Databases
★ 15.3kOpen source MCP server specializing in easy, fast, and secure tools for Databases.
DBHub
★ 2.8kA universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.
Tabularis
★ 2.1kA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
Postgres AI Guide
★ 1.7kMCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Anyquery
★ 1.7k🏎️ 🏠 ☁️ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.
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.
Set Up SurrealDB in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.