Local, over stdio
Registers the @backenly/mcp-server package with Codex, on Node.js 20 or later. Run it in a terminal, then relaunch Codex.
codex mcp add backenly -- npx -y @backenly/mcp-server --project <id> --key <scoped-key>Codex builds and runs a Backenly project over MCP: tables, row-level security, auth, storage and functions. One command connects it, and anything destructive waits for you.
Registers the @backenly/mcp-server package with Codex, on Node.js 20 or later. Run it in a terminal, then relaunch Codex.
codex mcp add backenly -- npx -y @backenly/mcp-server --project <id> --key <scoped-key>Nothing to install. codex mcp add has no flag for a header, so the key goes in ~/.codex/config.toml under http_headers, and Codex infers HTTP from the url. Relaunch Codex after saving; if the server is not picked up, add [beta] rmcp = true.
[mcp_servers.backenly]
url = "https://backenly.com/api/mcp"
http_headers = { "x-api-key" = "<scoped-key>" }Your project’s Connect page, under Agents, prints both with the project id and key filled in. To keep the key out of the command, run npx @backenly/mcp-server init once: it saves the key to ~/.backenly/mcp.json, readable only by you, and the command becomes codex mcp add backenly -- npx -y @backenly/mcp-server.
The server sends them when the connection opens: read the backend’s state before changing anything, say which project it is connected to, and never put the mcp_live_ key in app code.
fetch_docs returns Backenly’s agent guide in full, at most 40,000 characters, or one topic of it, such as fetch_docs { topic: "database" }.
backenly.com/skill.md is the guide Backenly writes for agents: which tool does what, the order that works, the error codes to branch on, and which key an app needs. Point the agent at it, or keep a copy in the repository.
Codex reads its MCP servers when a session starts. Until the Backenly tools appear, the agent can run every one of them from the terminal, with the same key and the same approval rules.
npx -y @backenly/cli@latest link --project <id> --key <scoped-key>
npx -y @backenly/cli@latest call read_backend_state
npx -y @backenly/cli@latest chat "add a likes counter to posts"link keeps the key in .backenly/config.json and, if the repository has a .gitignore, adds .backenly/ to it.
Backenly’s endpoint reads the key from the x-api-key header, and codex mcp add has no flag for a header. So the remote form is a [mcp_servers.backenly] table in ~/.codex/config.toml with the key under http_headers. The local command needs no file edit.
Yes. Choose read-only when you create the key on the Connect page. A read-only key sees 16 tools instead of 23, and a write called anyway is refused with READ_ONLY_KEY before it runs. The agent cannot upgrade its own key.
No. The MCP server operates a Backenly project, hosted on Backenly Cloud or on your own Backenly install, with a PostgreSQL schema that Backenly manages. You can still reach that database directly with a connection string from the Connect page, and export it with pg_dump.
Anything destructive or irreversible. apply_migration refuses DROP statements. Dropping or emptying a table, deleting files or functions, deploying, rolling back and revoking keys are parked on the project’s Autonomy page until a person approves them. The agent can request and poll with check_approval; it cannot approve.
Yes, from the project’s History: restore that one change, or everything back to a point. History covers the schema, auth, storage, functions, webhooks, environment variables, keys, integrations, allowed origins and allowed database addresses, and each restore is checked before it runs. Data your app wrote since is never rewound, and a restore that would affect it waits for your approval. The agent can ask for a restore, but only you can approve one.
Yes. Add --endpoint with your instance’s address to the local command, or use your instance’s /api/mcp as the url in config.toml. Keys and projects come from your own dashboard.
One free project, no credit card. Connect it in one command.