Skip to content
Product Metrics MCP

Product Metrics in Cursor

Add the Product Metrics MCP server, skills and productmetrics CLI to Cursor, then set up tracking and analyse Google Ads from a chat.

Cursor’s agent works with Product Metrics in three ways:

  • MCP server (https://www.productmetrics.io/mcp): reads your stores, products and Google Ads account, and runs setup through the API.
  • Skills: give the agent the exact steps for tasks such as setting up tracking.
  • productmetrics CLI: the agent runs it in the terminal with JSON output.

You sign in in your browser. There is no API key.

Install

1. Add the MCP server

Add the server to ~/.cursor/mcp.json (every project) or .cursor/mcp.json (one project):

~/.cursor/mcp.json
{
  "mcpServers": {
    "product-metrics": {
      "url": "https://www.productmetrics.io/mcp"
    }
  }
}

productmetrics mcp-config --client cursor prints this snippet.

2. Install the skills

From the project you open in Cursor:

npx skills add https://www.productmetrics.io/docs \
  --skill '*' \
  --agent cursor \
  -y

This installs set-up-tracking, connect-google-ads, check-tracking, bid-on-profit and analyse-google-ads. Add --global to install them for every project. Needs Node.js 22.20 or later. See Install skills.

3. Install the productmetrics CLI (optional)

Install it from npm (Node.js 22 or later), then check it:

npm install -g @productmetrics/cli
productmetrics --version

To run it once without installing, use npx @productmetrics/cli in place of productmetrics. Cursor’s agent runs productmetrics like any other command.

Authenticate

MCP server. Cursor asks you to sign in to Product Metrics the first time it connects. Open Cursor’s MCP settings and click the sign-in prompt next to product-metrics.

Your browser opens the Product Metrics consent page: sign in (or choose Continue with Google to create an account), check what Cursor Can read and Can change, and click Connect Cursor.

productmetrics CLI. Run this in your own terminal:

# opens the browser and waits up to 5 minutes
productmetrics login
# which API, signed in or not, scopes, expiry
productmetrics status

So that productmetrics never prompts or opens a browser when the agent runs it, set PM_AGENT=1:

echo 'export PM_AGENT=1' >> ~/.zshrc
source ~/.zshrc
echo 'export PM_AGENT=1' >> ~/.bashrc
source ~/.bashrc
[System.Environment]::SetEnvironmentVariable("PM_AGENT", "1", "User")

Restart Cursor after running this.

How it works

  • Analysis tools read live. list_properties picks the store, then tools such as explain_google_ads_change, get_google_ads_report and get_poas_report read your Google Ads account and your store’s margins and stock. They never change Google Ads or your store.
  • Setup runs through Code Mode. search finds an API operation; execute runs code that calls it: setup status, connecting stores and Google Ads, creating conversion actions. Operations that delete something run only after you confirm.
  • Browser steps come back as a link. Google consent, a store install or checkout needs you in a browser. The agent gives you the link, waits, then reads the setup status again. With the CLI, productmetrics exits 4 and puts the URL in next_action.url.
  • Skills load on demand. The agent reads a skill when your request matches its description.
  • The CLI speaks JSON. The agent runs productmetrics help agents first, then passes --json to every command and reads exactly one JSON document from stdout.
  • Secrets stay out of the chat. Fields such as a store setup token never reach the assistant through MCP. productmetrics hides them unless you pass --show-secrets.

Skills and tools

Skills

SkillWhat it does
set-up-trackingServer-side conversion tracking end to end: workspace, store, Google Ads, conversion actions
connect-google-adsConnect a Google Ads account and its Merchant Center, or fix a connection
check-trackingCheck the store, the conversion actions, Enhanced Conversions and the latest purchase
bid-on-profitSet up and check POAS or ROAS bidding in Google Ads and Meta
analyse-google-adsExplain changes, wasted spend and POAS, read-only

MCP tools

ToolDescription
list_propertiesThe stores (properties) you can open; call first
get_store_overviewThe store’s own sales, orders and profit next to the ads
explain_google_ads_changeWhy a Google Ads metric changed, in one call
get_google_ads_reportLive Google Ads performance at any level
get_poas_reportProfit on ad spend per product, campaign or account, with stock
get_google_ads_changesWho changed what in the account, last 30 days
list_products_to_investigateProducts that need attention first
propose_changeFile a proposal that a person approves in Priorities
search / executeThe whole Product Metrics API in Code Mode

All 24 analysis tools and their arguments: MCP tools.

What you can ask

> Where is my Product Metrics setup, and what is the next step?
→ execute (GET /setup/status), or productmetrics setup get-status --json

> Connect my WooCommerce store to Product Metrics.
→ execute (POST /companies/:companyId/stores), or productmetrics stores connect
  --company-id <company_id> --provider woocommerce --store-url
  https://shop.example --json
  then tells you to paste the setup token into the Product Metrics
    plugin in your store admin

> Create the Product Metrics conversion actions in Google Ads.
→ execute (POST /properties/:propertyId/google-ads/conversion-actions),
  or productmetrics google-ads create-conversion-actions --property-id <property_id>
    --company-id <company_id> --json

> Which campaigns have the lowest POAS over the last 30 days?
→ list_properties, then get_poas_report (level: campaign, sort_by: poas,
  order: asc)

> Why did my Google Ads conversion value drop since Monday?
→ list_properties, then explain_google_ads_change

Configuration

Pin one store

For a project that should only see one store, add the property to the URL. The analysis tools then read that store without asking; search and execute still work on your whole account.

.cursor/mcp.json
{
  "mcpServers": {
    "product-metrics": {
      "url": "https://www.productmetrics.io/mcp?selectedAccountPropertyId=<propertyId>"
    }
  }
}

Environment variables (productmetrics)

# never prompt, never open a browser, no colours
PM_AGENT=1
# an access token, for CI instead of productmetrics login
PM_TOKEN=...
# another API origin (default https://prod-backend.productmetrics.io)
PM_API_URL=...

The CLI stores its sign-in in ${XDG_CONFIG_HOME:-~/.config}/product-metrics/credentials.json.

Troubleshooting

ProblemFix
product-metrics doesn’t appear in Cursor’s MCP settingsCheck that mcp.json is valid JSON, then restart Cursor or run Developer: Reload Window.
“This connection expired or was removed; connect Product Metrics again.”Sign in again from Cursor’s MCP settings. If that fails, remove the entry from mcp.json and add it again.
“This connection only has MCP access, so it cannot call the Product Metrics API.”Remove the server, add it again and allow everything the consent page shows.
“The MCP server is not enabled for this account yet.”Ask Product Metrics support to turn it on for your account.
“This property needs a Product Metrics Pro subscription for the MCP server.”Upgrade that store to Pro, or ask about another store.
productmetrics exits 3Not signed in or missing a scope. Run productmetrics login in your own terminal; the hint names the scopes.
productmetrics exits 4A person must finish a step in a browser. Open next_action.url, then ask the agent to check the status again.
The agent doesn’t use a skillRun npx skills list and check it is installed for cursor, then reload the window.

Where next