Codex is OpenAI's coding agent, available as a terminal CLI and a desktop app. Connecting the SurrealDB MCP server lets it work against your Cloud instances while it edits code.
Add the MCP server
codex mcp add surrealdb --url https://mcp.surrealdb.comCodex also reads MCP servers from ~/.codex/config.toml, or .codex/config.toml in a trusted project:
[mcp_servers.surrealdb]
url = "https://mcp.surrealdb.com"Sign in
Start a Codex session and approve the SurrealDB connection when it prompts you. For an unattended run, create a personal access token and point Codex at it through an environment variable rather than writing the value into the file:
[mcp_servers.surrealdb]
url = "https://mcp.surrealdb.com"
bearer_token_env_var = "SURREALDB_TOKEN"Install the Agent Skills
npx skills add surrealdb/agent-skillsCheck it worked
codex mcp listsurrealdb should appear in the list. Ask Codex what SurrealDB tools it has available.
Try it
Create a
tasktable in my dev instance with a title and a done flag, insert two rows, then show me the ones that are not done.
Next steps
SurrealDB MCP Server — every tool the server publishes
Agent Skills — what each skill covers