Skip to content

Agent setup

Codex

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.

codex mcp add surrealdb --url https://mcp.surrealdb.com

Codex also reads MCP servers from ~/.codex/config.toml, or .codex/config.toml in a trusted project:

[mcp_servers.surrealdb]
url = "https://mcp.surrealdb.com"

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"
npx skills add surrealdb/agent-skills
codex mcp list

surrealdb should appear in the list. Ask Codex what SurrealDB tools it has available.

Create a task table in my dev instance with a title and a done flag, insert two rows, then show me the ones that are not done.

Was this page helpful?