SurrealDB integration
SurrealDB is a multi-model database (documents, graphs, relations, vectors) queried with SurrealQL. instance_url is your server's address with its scheme and port, for example https://db.example.com:8000 or a SurrealDB Cloud instance endpoint (Studio, Connect, HTTP cURL); private and local network addresses are refused. An agent can run any SurrealQL statement the credential's user may run (reads and writes, schema, user and access definitions included, with values bound to $parameters), ISO GQL and GraphQL queries, and list, read, create, replace, merge and delete the records of a table. Every call names its namespace and database. Not exposed: import and export (whole-database SurrealQL dump files made for backup and migration; an import that fails is left partly applied), sign-in, sign-up and session-cookie routes, replacing every record of a table at once, SurrealML model files, user-defined custom endpoints (DEFINE API) and the health and readiness probes (empty answers). Authentication is HTTP Basic with a SurrealDB system user's name and password: a root user needs nothing more, a user defined on a namespace or database also passes Surreal-Auth-NS (and Surreal-Auth-DB) on each call.
Say what should happen.
The workflow builds itself.
What you can do with SurrealDB
Each of these is one operation on one endpoint, available both as a workflow step and as a tool an AI agent can call on its own. Nothing bundles several operations into one action, so what a run did stays readable afterwards.
Each badge shows the default agent permission of an endpoint (allowed: an agent calls it without asking; ask first: you are asked before an agent calls it, when the agent or chat asks permission for sensitive actions; never: no agent may call it), which every user can change endpoint by endpoint in their credential settings.
Most endpoints run on the free plan. A few, mainly the ones that publish on your behalf, need a paid plan.
Record, 9 operations
create_recordCreate recordPOSTAgents: ask firstCreates a record with a generated id in the table from data and returns it, id included, in result. Writes to the database.create_record_with_idCreate record with idPOSTAgents: ask firstCreates the record table:id from data and returns it in result. Writes to the database; use create_record to let SurrealDB generate the id.delete_all_recordsDelete all recordsDELETEAgents: ask firstPermanently deletes EVERY record of the table and returns the records removed (DELETE FROM table RETURN BEFORE). Cannot be undone; to delete one record use delete_record.delete_recordDelete recordDELETEAgents: ask firstPermanently deletes the record table:id and returns it as it was before the deletion (DELETE ... RETURN BEFORE). Cannot be undone.get_recordGet recordGETAgents: ask firstReturns one record, table:id, in result (SELECT * FROM the record).list_recordsList recordsGETAgents: ask firstReturns the records of a table in result, at most 100 unless limit is set. Page with limit and start; fields restricts the fields returned. Use run_query for filters and sorting.replace_recordReplace recordPUTAgents: ask firstReplaces the data of the record table:id with data, the full record content (UPDATE ... CONTENT). Returns the updated record. Updates nothing when the record does not exist. Overwrites stored data.update_all_recordsUpdate all recordsPATCHAgents: ask firstMerges data into EVERY record of the table (UPDATE table MERGE data): the given fields are set on all of them. Returns the updated records. Changes all rows; to change one record use update_record.update_recordUpdate recordPATCHAgents: ask firstMerges data into the record table:id (UPDATE ... MERGE): only the fields given change. Returns the updated record. Updates nothing when the record does not exist.
Gql query, 1 operation
run_gql_queryRun gql queryPOSTAgents: ask firstRuns one ISO GQL query (MATCH ... RETURN reads, or INSERT, SET, REMOVE, DELETE mutations) on the namespace and database's tables and RELATE edges. Not GraphQL. Needs SurrealDB 3.2 or later. Can change data.
Graphql query, 1 operation
run_graphql_queryRun graphql queryPOSTAgents: ask firstRuns a GraphQL query on the namespace and database and returns its data. The database must first be set up for GraphQL with a DEFINE CONFIG GRAPHQL statement (for example DEFINE CONFIG GRAPHQL AUTO through run_query).
Query, 1 operation
run_queryRun queryPOSTAgents: ask firstRuns SurrealQL statements with every right of the connection's user: it can read or change anything that user can, system definitions included (INFO lists users and access methods, DEFINE and REMOVE change them). One entry per statement.
Server version, 1 operation
get_versionGet versionGETAgents: ask firstReturns the SurrealDB server version as text, for example surrealdb-4.0.0. A quick check that the connection reaches the server.
Use SurrealDB from Claude Code, Cursor or Codex
Connect SurrealDB in LiveContext, create an API key in Settings, then add the LiveContext MCP server to your client. Its SurrealDB operations become tools the client can call, next to every other integration you connected.
claude mcp add --transport http livecontext https://livecontext.ai/mcp --header "X-API-Key: YOUR_API_KEY"[mcp_servers.livecontext]
url = "https://livecontext.ai/mcp"
[mcp_servers.livecontext.http_headers]
"X-API-Key" = "YOUR_API_KEY"{
"mcpServers": {
"livecontext": {
"type": "http",
"url": "https://livecontext.ai/mcp",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}How to connect SurrealDB
- Create your workspace
Sign up free. Nothing to install.
- Connect SurrealDB once
Add your SurrealDB connection in Settings. Every tool from this integration reuses it, and secrets are encrypted at rest and visible only to you.
- Describe the job in chat
The workflow builds itself in front of you and picks the endpoints it needs. Drag the steps yourself on the canvas whenever you would rather be explicit.
SurrealDB integration FAQ
What can you do with the SurrealDB integration?
LiveContext exposes 13 operations on SurrealDB, covering record, gql query, graphql query and query.
