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.
Before you register the server
- Cursor installed and working, and Python 3 with
pipxoruvx. - 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 diffis the change review.
Four steps to a first validated plan
- Install the package and write the config
AdRails is the
adsopsPython package. Install it, run the offline self test, then write aconfig.jsonand 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.shellpipx install git+https://github.com/antonioac1/adrails python3 -m adsops --selftest # offline, nothing is called - Add the server to mcp.json
Cursor reads
~/.cursor/mcp.jsonfor all projects and.cursor/mcp.jsonin a project root for one. Cursor's docs listtypeandcommandas the fields a stdio server needs, withargsandenvoptional. 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"] } } } - Turn the server on
Open Customize in Cursor's sidebar, find
adrailsand check its toggle. Cursor does not load or show a disabled server in chat.commandmust be on your PATH or a full path; if Cursor cannot findpython3, put the interpreter's full path there instead. - 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, thenadsops_status, thenadsops_planand 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.
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.
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.