Claude Code

Your analytics, inside Claude Code

Add ownlytics to Claude Code once and ask about traffic, sales and buyer journeys from any project. One command sets it up; the read-only key never leaves your machine and your dashboard.

All sales are final · License terms · Rather not self-host? Hosted from $9/mo

Claude Codeownlytics · 14 tools connected
MCP
Terminal

Works withClaude CodeCursorCodexCopilotWindsurf

Short answer

Run claude mcp add --transport http --scope user ownlytics https://ownlytics.xyz/api/mcp --header "Authorization: Bearer dbk_YOUR_KEY": it creates a read-only ownlytics key and adds ownlytics to Claude Code for all your projects. By hand, it's claude mcp add --transport http --scope user ownlytics https://YOUR-OWNLYTICS-URL/mcp --header "Authorization: Bearer dbk_…". Then run /mcp in Claude Code to check it's connected, and ask.

The one-command setup

claude mcp add --transport http --scope user ownlytics https://ownlytics.xyz/api/mcp --header "Authorization: Bearer dbk_YOUR_KEY"

Here's what it does, in order:

  1. Updates your ownlytics if it's too old for agents.
  2. Creates a read-only key named after your computer (or reuses the one it made before, if it still works).
  3. Checks the connection by listing the tools.
  4. If Claude Code is installed, asks before adding ownlytics for all your projects, replacing an older ownlytics entry if there is one.
  5. Prints the config for Cursor, VS Code, Codex and Windsurf too, and a few questions to try.

Add --client claude to see only the Claude Code part, or --yes to skip the question.

By hand

This is the exact command the API runs. Get a key from your dashboard under Settings → API keys & AI agents (that's also the way on ownlytics Hosted):

claude mcp add --transport http --scope user ownlytics https://YOUR-OWNLYTICS-URL/mcp \
  --header "Authorization: Bearer dbk_YOUR_KEY"

Then open Claude Code and run /mcp: ownlytics should show as connected.

Which scope to pick

ScopeWhere it appliesUse it when
userEvery project on your computer, private to youYou want your numbers everywhere. The API uses this.
local (Claude Code's default)Only the project you ran it in, private to youYou only want analytics in your product's repo.
projectSaved in .mcp.json in the repo, shared with your teamRarely: the file would hold your key, so keep it out of git.

10 prompts that work

  1. "List my sites with today's visitors and revenue."
  2. "Which referrer made me the most money this month?"
  3. "Compare this week with last week. What changed, and why?"
  4. "Show my last 10 sales and where each buyer came from."
  5. "Walk me through the journey of my latest customer."
  6. "Which landing page converts best for visitors from Google?"
  7. "How much did ChatGPT and Perplexity send this month, and did any of it buy?"
  8. "Which campaign brought customers who renewed?"
  9. "When do my buyers pay? Suggest a time to post tomorrow."
  10. "Which pages do buyers read longer than everyone else?"

Name the site by its domain when you have more than one, and add a period ("last 30 days", "since October 1") when it matters. Every tool understands today, 7d, 30d, month to date, last month, 12 months and custom dates.

Use it while you build

Claude Code already sits in your product's repo, so analytics questions fit into the work: check which pages convert before rewriting the pricing page, or ask after a launch which post sent the buyers. Prefer plain commands? The same numbers are in the terminal: npx ownlytics@latest sources --by revenue, with --json for scripts.

If it doesn't connect

  • 401 "Missing API key" or "Unknown API key": the header is missing or the key belongs to another ownlytics. Check that the value is Bearer dbk_…, with the space.
  • 401 "This API key was revoked": create a new key under Settings → API keys, or run claude mcp add --transport http --scope user ownlytics https://ownlytics.xyz/api/mcp --header "Authorization: Bearer dbk_YOUR_KEY" again.
  • Can't reach the server: the URL must be your ownlytics address plus /mcp, over https.
  • "already exists": remove the old entry with claude mcp remove ownlytics --scope user, then add it again. The API does this for you.

Keys are read-only, stored only as a hash, and hide customer names and emails unless you create one that includes them.

Questions

Do I need a paid Claude plan?

You need Claude Code, which runs on the Claude plans and API accounts that include it. ownlytics adds nothing on top: the MCP server is part of your own ownlytics.

Can Claude Code change anything in ownlytics?

No. All 14 tools are read-only, and the key can only read analytics.

Where is the key stored?

In Claude Code's own config on your computer (~/.claude.json for the user and local scopes). ownlytics keeps only a hash of it.

How do I remove it?

Run claude mcp remove ownlytics --scope user, then revoke the key under Settings → API keys or with npx ownlytics@latest api-key revoke dbk_….

Find out which of your posts pay the bills.

One script, one payment connection, and you'll know by tomorrow.

All sales are final · License terms · Rather not self-host? Hosted from $9/mo