Docs · Install · Cursor

Install AdRails in CursorOne mcp.json entry · adrails.dev

Direct answer. Cursor runs AdRails as a local stdio server. Add an adrails entry to ~/.cursor/mcp.json (every project) or .cursor/mcp.json (one project) whose command is python3 and whose args are -m adsops --config /absolute/path/config.json, then make sure the server's toggle is on under Customize. There is no URL and no AdRails account.

Last tested with AdRails 0.2.2 · Python 3 · config format checked against Cursor MCP docs, cursor.com/docs/context/mcp on 2026-11-03 · Apache-2.0 · local stdio
What you need first

Before you register the server

  • Cursor installed and working, and Python 3 with pipx or uvx.
  • Your own Google Ads API access: a Cloud project with the Google Ads API enabled, a developer token, and a service account added to the account. AdRails has no hosted proxy.
  • A git repository for the desired-state and policy files; git diff is the change review.
Steps

Four steps to a first validated plan

  1. Install the package and write the config

    AdRails is the adsops Python package. Install it, run the offline self test, then write a config.json and a per-campaign policy file exactly as in the Claude Code install guide, steps 1 to 3; those steps do not depend on the client.

    shell
    pipx install git+https://github.com/antonioac1/adrails
    python3 -m adsops --selftest      # offline, nothing is called
  2. Add the server to mcp.json

    Cursor reads ~/.cursor/mcp.json for all projects and .cursor/mcp.json in a project root for one. Cursor's docs list type and command as the fields a stdio server needs, with args and env optional. Use an absolute path for --config.

    ~/.cursor/mcp.json · .cursor/mcp.json
    {
      "mcpServers": {
        "adrails": {
          "type": "stdio",
          "command": "python3",
          "args": ["-m", "adsops", "--config", "/absolute/path/config.json"]
        }
      }
    }
  3. Turn the server on

    Open Customize in Cursor's sidebar, find adrails and check its toggle. Cursor does not load or show a disabled server in chat. command must be on your PATH or a full path; if Cursor cannot find python3, put the interpreter's full path there instead.

  4. Check it, then ask for a plan

    If the server does not appear, open the Output panel (Cmd+Shift+U) and choose MCP Logs to see initialisation errors. When it is up, ask the agent to call adsops_campaigns, then adsops_status, then adsops_plan and to commit nothing. You get a diff against the live account and a single-use plan ID.

The server speaks JSON-RPC 2.0 over stdio and sends diagnostics to stderr. Leave commit_policy.allow_commit at its default of false on a live account until you have read a few plans. Running beside Google's read-only server is covered in AdRails alongside Google's Ads MCP.

Troubleshooting

When it does not take

The server is listed but shows no tools

Run python3 -m adsops --config /absolute/path/config.json in a terminal. A config error names the field. Then check MCP Logs.

python3 not found

Cursor needs command on its PATH. Use the full interpreter path, for example the one inside your pipx environment.

Refusals such as plan_id required or outside guard range are the rails working; see what the guardrails do and don't prevent.

FAQ

Cursor questions

Where does Cursor look for AdRails?

In ~/.cursor/mcp.json for every project, or .cursor/mcp.json in the project root. Grok also reads .cursor/mcp.json, so the same entry serves both clients.

Can Cursor add AdRails by URL?

No. AdRails is not hosted, so there is no URL. Cursor starts it as a local process using command and args.

Do I put Google credentials in mcp.json?

No. They live in the AdRails config.json (a service-account file, a static token or a secret-manager lookup). If you ever need an env block, Cursor supports ${env:NAME} interpolation, so a secret does not have to be written into the file.