MCP for AI tools

Add Motif to Claude Code, Grok, Codex, or OpenCode with a read-only API key. You do not install an app. The key can list sites and read analytics. It cannot write.

A sealed envelope being read by a lamp, with a lock on the write side.

What this is

Motif MCP is Streamable HTTP at https://api.motiftrace.com/mcp. Your AI tool sends a Bearer API key. That is not your Clerk login. The key can list sites and read the channel snapshot, Search Console evidence, journeys, and setup readiness.

1. Create a key

Sign in at https://app.motiftrace.com. Open Connect AI. Type a name for the key and click Create key. Copy the secret. Motif shows it only one time. It starts with mtk_live_ or mtk_test_. If the key leaks, revoke it on the same page.

2. Add Motif to your AI tool

Use this URL and header. Replace the key with your key. Connect AI shows every client with your key filled in. It also has a Copy prompt button that copies these steps for your agent.

claude mcp add --transport http motif https://api.motiftrace.com/mcp \
  --header "Authorization: Bearer mtk_live_YOUR_KEY"
[mcp_servers.motif]
url = "https://api.motiftrace.com/mcp"
http_headers = { Authorization = "Bearer ${MOTIF_API_KEY}" }
  • Claude Code: the command above.
  • Cursor and VS Code: click the one-click install button on Connect AI, or put the URL and Authorization header in mcp.json.
  • Codex: put mcp_servers.motif with the URL and http_headers in ~/.codex/config.toml.
  • Grok CLI: use the same URL and Authorization header.
  • OpenCode: set type remote or http, url https://api.motiftrace.com/mcp, and the Authorization header.
  • Claude.ai and ChatGPT: their custom connectors need OAuth. Motif does not have OAuth yet.

What it can read

  • list_websites: sites on the account, plus Stripe and Search Console status.
  • analytics_snapshot: one website's window, series (day or week), prior period, and channel recommendation. Coverage sits once under quality, not on every channel.
  • search_console_evidence: Search Console action, gates, and landing-page rows for one website.
  • journeys: paginated observed journeys. You can filter by first-touch source/medium and lifecycle, as on the dashboard.
  • website_readiness: one website's setup score from 0 to 100, with SEO, AI search, and measurement checks. Each failed check gives one fix.
  • answer_checks: for each buyer question, if ChatGPT and Perplexity name or cite the website. It shows this week and the 8 weeks before. On the Free plan, locked is true and checks is empty.
  • A website_id from another account returns not found.
  • Unauthenticated requests return 401. Keys are read-only.

What it cannot do

  • Write anything. There is no tool to connect Stripe or Search Console, create or revoke keys, or refresh insights.
  • Rank channels. The snapshot returns the same recommendation the dashboard uses.

Give this to a coding agent

On Account, click Copy prompt. Or paste this prompt:

Connect this agent to Motif MCP, then use Motif to answer questions about the user's traffic and revenue.

Done means:
- This agent has the motif MCP server in its configuration.
- list_websites returns the user's websites.
- You reported back in the format at the end.

What Motif is
Motif is analytics that turns SEO and AI traffic into revenue decisions. A small browser tracker records visits and first touch. Stripe Connect is the only revenue source. Motif joins each payment to the first channel that brought that customer. Direct / unknown stays visible and cannot win. Search Console data is optional query aggregates, never a person.

Tracker SDK, only if the site does not have the tracker yet
The tracker is one deferred script. Do not add a Motif backend, npm package, or environment variable for it.

<script defer src="https://collect.motiftrace.com/m.js" data-website-id="WEBSITE_ID" data-domain="example.com"></script>

Put that tag in the first HTML document that a visitor opens. If signup is on the app origin, put the tag there with the same website id. Use one Motif website. After login, call window.motif?.identify(user.id) with a stable app id. Use the same id on every page, because a different id starts a new visitor. Never use an email. After signup succeeds, call window.motif?.track("signup_completed"). Immediately before a server-created Checkout Session or a Stripe Pricing Table, call window.motif?.track("checkout_started"). Keep Stripe's {CHECKOUT_SESSION_ID} placeholder on success_url. If the user already has a website in Motif, do not invent an id. Ask the user to copy the filled install prompt from Websites.

Create a read-only API key
1. Sign in at https://app.motiftrace.com
2. Open Connect AI.
3. Type a name for the key. Click Create key.
4. Copy the secret. Motif shows it only one time. It starts with mtk_live_ or mtk_test_.
Ask the user for the key that they created on Connect AI. Do not invent a key.

Install Motif MCP
Motif MCP is Streamable HTTP. You do not run a binary. Auth is a Bearer API key, not a Clerk login. The key is read-only.

URL: https://api.motiftrace.com/mcp
Header: Authorization: Bearer mtk_live_YOUR_KEY

Claude Code (Run in a terminal.):
claude mcp add --transport http motif https://api.motiftrace.com/mcp \
  --header "Authorization: Bearer mtk_live_YOUR_KEY"

Cursor (~/.cursor/mcp.json, or install in one click.):
{
  "mcpServers": {
    "motif": {
      "url": "https://api.motiftrace.com/mcp",
      "headers": {
        "Authorization": "Bearer mtk_live_YOUR_KEY"
      }
    }
  }
}

VS Code (.vscode/mcp.json, or install in one click.):
{
  "servers": {
    "motif": {
      "type": "http",
      "url": "https://api.motiftrace.com/mcp",
      "headers": {
        "Authorization": "Bearer mtk_live_YOUR_KEY"
      }
    }
  }
}

Codex (~/.codex/config.toml):
[mcp_servers.motif]
url = "https://api.motiftrace.com/mcp"
http_headers = { Authorization = "Bearer mtk_live_YOUR_KEY" }

Grok API (xAI Responses API remote MCP tool. Grok CLI takes the same URL and header.):
curl https://api.x.ai/v1/responses \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"grok-4.7","input":[{"role":"user","content":"Which channel should I invest in? Use Motif."}],"tools":[{"type":"mcp","server_url":"https://api.motiftrace.com/mcp","server_label":"motif","headers":{"Authorization":"Bearer mtk_live_YOUR_KEY"}}]}'

OpenCode (opencode.json):
{
  "mcp": {
    "motif": {
      "type": "remote",
      "url": "https://api.motiftrace.com/mcp",
      "headers": {
        "Authorization": "Bearer mtk_live_YOUR_KEY"
      }
    }
  }
}

How to use Motif after you connect
Call list_websites first. Then call analytics_snapshot with one website_id.
Optional: search_console_evidence, journeys, website_readiness, answer_checks.
Use Motif's recommendation. Do not rank channels yourself.
A website_id from a different account returns not found. Unauthenticated requests return 401.

You cannot write. No tool connects Stripe or Search Console, creates or revokes keys, or refreshes insights.

Rules
- Never show the full API key to the user. Never commit the key to a repo.
- Put the key only in the config file or command for this agent.
- If you do not know which agent you are running in, ask before you write config.

Verify and report
1. If this agent needs it, restart or reload MCP servers.
2. Call list_websites. Show the domains that it returns.
3. If the call fails, find the cause. 401 means the key is wrong or revoked. A connection error means the URL or transport is wrong. Tell the user which cause it is and what to do.
Report: where you wrote the config, the list_websites result, and the steps that the user must still do by hand.

Docs: https://docs.motiftrace.com/concepts/mcp