$npx -y skills add 24601/surreal-skills --skill surrealmcpSurrealDB MCP for AI agents: built-in server (SurrealDB 3.1+ surreal mcp) and standalone surrealmcp (surrealdb/surrealmcp v0.4.0). Part of the surreal-skills collection.
| 1 | # SurrealDB MCP for AI Agents |
| 2 | |
| 3 | Two MCP surfaces exist as of SurrealDB 3.1: |
| 4 | |
| 5 | | Surface | When to use | |
| 6 | |---|---| |
| 7 | | **Built-in** (`surreal mcp`, HTTP `/mcp`) | Local IDE hosts; simplest setup with the main `surreal` binary | |
| 8 | | **Standalone** (`surrealmcp start`) | Extended tool catalog, cloud helpers, multi-endpoint switching | |
| 9 | |
| 10 | ## Built-in MCP (SurrealDB 3.1+) |
| 11 | |
| 12 | ```bash |
| 13 | # stdio — typical MCP host config |
| 14 | surreal mcp --endpoint ws://127.0.0.1:8000/rpc --ns test --db test \ |
| 15 | --user root --pass root |
| 16 | ``` |
| 17 | |
| 18 | **Security:** stdio MCP grants owner-level tool access with no login step. Do not |
| 19 | expose to untrusted hosts. HTTP `/mcp` requires normal SurrealDB authentication. |
| 20 | |
| 21 | See [rules/surrealmcp.md](../../rules/surrealmcp.md) for env vars and tool hints. |
| 22 | |
| 23 | ## Standalone surrealmcp (v0.4.0) |
| 24 | |
| 25 | Not published to crates.io or npm. Install from source or Docker: |
| 26 | |
| 27 | ```bash |
| 28 | git clone https://github.com/surrealdb/surrealmcp |
| 29 | cd surrealmcp && cargo install --path . |
| 30 | |
| 31 | # Or Docker |
| 32 | docker run --rm -i --pull always surrealdb/surrealmcp:latest start \ |
| 33 | --endpoint ws://localhost:8000/rpc --ns test --db test |
| 34 | ``` |
| 35 | |
| 36 | The `start` subcommand is mandatory. Full tool catalog and host wiring: |
| 37 | [rules/surrealmcp.md](../../rules/surrealmcp.md). |