Labsco
MCP SERVER

SurrealDB MCP Server

by nsxdavid

Query and manipulate a SurrealDB database from an AI client, with typed tools for each operation.

NoSQL, Graph & Key-Value Stores
Summary
Typed tools over raw SurrealQL, including the graph edges SurrealDB is built for.

You get both routes: raw query for anything, and typed select/create/update/delete when you want the operation to be explicit rather than a string. insertRelation is the SurrealDB-specific one worth noting — it creates a graph edge between records, which is the feature that separates SurrealDB from a plain document store. Access is whatever the configured database user has.

What it is

A server that gives an assistant a standardized interface to a configured SurrealDB instance — raw queries plus typed CRUD and graph operations.

What you get
  • query runs a raw SurrealQL query; select reads records from a table, all or by ID
  • create, update, delete and merge cover the record lifecycle, with merge doing a partial update
  • patch applies JSON Patch operations; upsert creates or updates in one call
  • insert adds multiple records at once
  • insertRelation creates a graph edge between two records
Requirements

A running SurrealDB instance and five environment variables — SURREALDB_URL, SURREALDB_NS, SURREALDB_DB, SURREALDB_USER and SURREALDB_PASS. Node.js >=18.0.0. Run it with npx and the surrealdb-mcp-server package, which downloads and runs it on demand with no manual install.

Setup effort

One command plus a key — npm install -g surrealdb-mcp-server, then supply credentials