> ## Documentation Index
> Fetch the complete documentation index at: https://f82cc46-productmetrics.manicule.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://f82cc46-productmetrics.manicule.dev/docs/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://f82cc46-productmetrics.manicule.dev/docs/api/mcp.
> Every agent surface: https://f82cc46-productmetrics.manicule.dev/docs/.well-known/llms-manifest.json

# Product Metrics in Claude and Claude Code (/docs/integrations/claude-code)

<!-- agent-signals: reading_time_min: 4 · est_tokens: 1486 · updated: 2026-11-16 -->
Related: [Product Metrics in ChatGPT and Codex](/docs/integrations/chatgpt.md), [Product Metrics in Claude Desktop and Cowork](/docs/integrations/claude-desktop.md), [Product Metrics in Cursor](/docs/integrations/cursor.md)

> Add the Product Metrics MCP server to Claude as a custom connector or to Claude Code with one command, sign in through your browser, and set up tracking or analyse Google Ads.

Give Claude or Claude Code your stores, products and Google Ads account, and let it run Product Metrics setup for you. Set up the app you use; you don't need both.

| Setting         | Value                                                                     |
| --------------- | ------------------------------------------------------------------------- |
| **Server name** | `product-metrics` (Claude Code), `Product Metrics` (Claude connector)     |
| **Server URL**  | `https://www.productmetrics.io/mcp`                                       |
| **Sign-in**     | Browser sign-in to Product Metrics (OAuth), then **Connect**. No API key. |

`https://www.productmetrics.io/mcp` is a client setting, not a page to open in a browser.

## Optional: Add to Claude

1. Open [**Add custom connector**](https://claude.ai/new?modal=add-custom-connector#customize/connectors) in Claude.
2. Name it `Product Metrics`, paste the server URL and click **Add**. Leave the OAuth fields empty.
3. Click **Connect**, sign in to Product Metrics and click **Connect Claude**.

The connector also works in Claude Desktop, Cowork and the Code tab: see [Claude Desktop & Cowork](/docs/integrations/claude-desktop).

## Set up Claude Code

### 1. Add Product Metrics

Run this in your terminal:

```bash
claude mcp add --transport http product-metrics https://www.productmetrics.io/mcp
```

Add `--scope user` to use it in every project, or `--scope project` to share it with your team through `.mcp.json`. `productmetrics mcp-config --client claude` prints the same command.



**Prefer to edit .mcp.json?** `claude mcp add --scope project` writes `.mcp.json` in the repository root. You can also create it by hand:

```json
{
  "mcpServers": {
    "product-metrics": {
      "type": "http",
      "url": "https://www.productmetrics.io/mcp"
    }
  }
}
```

### 2. Sign in and verify

Enter `/mcp` in Claude Code, choose **product-metrics** and pick **Authenticate**. Your browser opens the Product Metrics consent page: click **Connect Claude Code**.

Check that only one `product-metrics` server is active, then try:

```text
Which Product Metrics stores can I open, and what is left to set up?
```

### 3. Optional: skills and the CLI

Skills teach Claude the exact steps for tasks such as setting up tracking. Type a skill's name to run it, for example `/set-up-tracking`; Claude also loads one when your request matches it.

```bash
npx skills add https://www.productmetrics.io/docs --skill '*' --agent claude-code -y
```

The `productmetrics` CLI gives Claude the same API as commands with JSON output. Install it with `npm install -g @productmetrics/cli` and run `productmetrics login` in your own terminal, not through Claude. Details: [For agents](/docs/mcp/for-agents).

## What you can ask

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

> Connect my Shopify store to Product Metrics.
→ execute (POST /companies/:companyId/stores), or productmetrics stores connect
  --company-id <company_id> --provider shopify --json
  then gives you the link to approve the install in Shopify Admin

> Create the Product Metrics conversion actions in Google Ads.
→ execute (POST /properties/:propertyId/google-ads/conversion-actions)

> Which products lose money after ads this month?
→ list_properties, then get_poas_report (level: product,
  only_unprofitable: true)

> Why did my Google Ads ROAS drop last week?
→ list_properties, then explain_google_ads_change
```

Analysis tools only read: they never change Google Ads or your store. Operations that delete something run only after you confirm, and steps that need you in a browser come back as a link. Every tool: [MCP tools](/docs/mcp/tools).

For a project that should only see one store, add the property to the URL: `https://www.productmetrics.io/mcp?selectedAccountPropertyId=<propertyId>`.

## Troubleshooting

| Problem                                                                           | Fix                                                                                       |
| --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| A `product-metrics` server already exists                                         | Run `claude mcp remove product-metrics`, add it once, then start a new session.           |
| **product-metrics** shows as failed or needs authentication in `/mcp`             | Pick **Authenticate** again and finish the sign-in in the browser.                        |
| "This connection expired or was removed; connect Product Metrics again."          | Run `/mcp` and authenticate again. In Claude, click **Connect** on the connector.         |
| "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.                                    |
| Claude doesn't use a skill                                                        | Run `npx skills list`, check it is installed for `claude-code`, then restart Claude Code. |

## More

* [Get started](/docs/mcp/overview) with Product Metrics MCP in other clients.
* [For agents](/docs/mcp/for-agents): skills, the CLI and a starter prompt.
* [MCP tools](/docs/mcp/tools): what each tool does, with its arguments.
