Skip to content

Connect Cursor to Backenly

Cursor’s agent reaches Backenly through one block in mcp.json. It then builds and runs a Backenly project: tables, auth, storage and functions, with anything destructive held for you.

One block in mcp.json. In your user config.

  • Remote

    Nothing to install. Cursor infers the transport from the url, so the block needs no type field.

    ~/.cursor/mcp.json
    {
      "mcpServers": {
        "backenly": {
          "url": "https://backenly.com/api/mcp",
          "headers": { "x-api-key": "<scoped-key>" }
        }
      }
    }
  • Local, over stdio

    Runs the @backenly/mcp-server package through npx, on Node.js 20 or later. On a self-hosted Backenly, the args end with --endpoint and your instance’s address.

    ~/.cursor/mcp.json
    {
      "mcpServers": {
        "backenly": {
          "command": "npx",
          "args": [
            "-y", "@backenly/mcp-server",
            "--project", "<id>",
            "--key", "<scoped-key>"
          ]
        }
      }
    }

Save the file, then reload the Cursor window. Your project’s Connect page, under Agents, prints both blocks with the project id and key filled in.

Where the key lives. Out of the repository.

  • ~/.cursor/mcp.json

    Where the block goes. Your user config sits outside every repository, so the key is never committed beside the app.

  • .cursor/mcp.json in the project

    Committed with the repository, next to the code the agent writes. An agent building a frontend once shipped its own MCP key in the bundle. The runtime API now refuses one with MCP_KEY_IN_APP; a key kept out of the repository never gets that far.

  • No key in either file

    Run npx @backenly/mcp-server init once. It checks the key and saves it to ~/.backenly/mcp.json, readable only by you. The local block then carries no key, so it can sit in a file you commit.

    ~/.cursor/mcp.json
    {
      "mcpServers": {
        "backenly": {
          "command": "npx",
          "args": ["-y", "@backenly/mcp-server"]
        }
      }
    }

Teach the agent Backenly. Even before the tools load.

A rule in .cursor/rules

One command writes .cursor/rules/backenly.mdc, marked alwaysApply: true. Its body is backenly.com/skill.md, the guide Backenly writes for agents: which tool to use for what, the error codes to branch on, and which key an app needs.

bash
npx -y @backenly/cli@latest install-skill --agent cursor

Before the tools load

Cursor reads mcp.json 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.

bash
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.

Questions about Cursor

Anything else, ask the people who built it.

Not in Cursor, which infers the transport from the url. Cline takes the same block but needs "type": "streamableHttp" in its remote entry; without it, Cline falls back to SSE and the endpoint answers 405.

Try it from Cursor

One free project, no credit card. The Connect page prints your mcp.json block.