Get the FREE Ultimate OpenClaw Setup Guide →

surrealdb

MCP server from nsxdavid/surrealdb-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio nsxdavid-surrealdb-mcp-server npx -y surrealdb-mcp-server \
  --env SURREALDB_DB="your_database" \
  --env SURREALDB_NS="your_namespace" \
  --env SURREALDB_URL="ws://localhost:8000" \
  --env SURREALDB_PASS="your_db_password" \
  --env SURREALDB_USER="your_db_user"

How to use

This MCP server provides a standardized interface for AI assistants to interact with a SurrealDB instance. It exposes a set of SurrealDB operations as tools that can be invoked by MCP hosts like Cline, Claude, Copilot, Roo Code, Windsurf, Cursor, or n8n. The core capabilities include querying and manipulating data in SurrealDB through operations such as query, select, create, update, delete, merge, patch, upsert, insert, and insertRelation. To use the server, configure your MCP host to point at the SurrealDB MCP server with the appropriate SurrealDB connection details (URL, namespace, database, user, and password). Once configured, the host can expose these tools to users or automated agents, enabling seamless data access and edits against SurrealDB in a constrained, tool-based manner.

How to install

Prerequisites:

  • Node.js v18 or newer installed on your machine
  • npm (comes with Node.js)
  • Access to SurrealDB (host URL, namespace, database, user, password)

Installation steps:

  1. Install the MCP server package globally (recommended for quick setup):
npm install -g surrealdb-mcp-server
  1. Run the MCP server (example using npx per the readme configuration):
npx -y surrealdb-mcp-server
  1. If you prefer running via a host-specific integration, you can configure the MCP host (e.g., Claude, Copilot, Cline) to invoke the server using the following example env/config snippet:
  • SurrealDB URL: ws://localhost:8000
  • Namespace: your_namespace
  • Database: your_database
  • User: your_db_user
  • Password: your_db_password
  1. Verify installation by listing available MCP servers in your host (the server name is surrealdb).

Note: The README demonstrates multiple host-specific installation instructions. The essential setup is to ensure the MCP server is reachable at your SurrealDB URL and that the environment variables are set with the correct credentials.

Additional notes

Tips and common issues:

  • Ensure SurrealDB is running and accessible at the URL configured in SURREALDB_URL.
  • Keep SURREALDB_NS, SURREALDB_DB, SURREALDB_USER, and SURREALDB_PASS in sync with your SurrealDB instance permissions.
  • Some hosts (like Claude) may automatically download and run the package if using npx; ensure network access to npm registry.
  • When using npx, the server will be downloaded on demand; for production, consider a persistent local setup to avoid network dependencies.
  • If you encounter authentication errors, double-check that the user has the required privileges for the namespace and database.
  • The available tools map to standard SurrealDB operations and expect input schemas as defined by the MCP host; refer to the host’s tool listing for exact input formats.

Related MCP Servers

Sponsor this space

Reach thousands of developers