Home / API & CLI

Give your coding agent the growth stack.

mim connects Claude Code, Codex, or any shell to what Mimetic knows about your site: audit findings, redacted session-replay narratives of real visits, and read-only queries across your connected GA4, Search Console, Google Ads, PostHog, Mixpanel, Klaviyo, and A/B testing tools. Your agent reads the evidence, finds the fix, and Mimetic opens the PR for you to review and merge.

mim CLI REST API MCP server x402 agentic

Growth context from the tools you already use

The mim CLI

One command for real growth context.

Two commands. Setup signs you in, picks your project, and connects your agent.

# install the mim command (Node 20+)
npm install -g @mimeticinc/mim-cli

# sign in and connect your agent
mim setup

Setup registers the server with whichever agents it finds: Claude Code, Codex, Cursor, Windsurf, Claude Desktop. It writes each config file, backs up what was there, and leaves any other MCP servers you have alone. Add one later with mim mcp install cursor, or re-run mim mcp install all.

Install globally, not with npx. Your agent runs mim as the MCP server, so it has to stay on your PATH. Setup prints every step and names the fix for any that fail, including the exact export PATH= line if your shell cannot find mim afterwards. Run it again whenever you like: it reuses your login rather than replacing it.

Signing in stores an expiring token in ~/.mim/config.json, with restrictive file permissions where the system supports them. It is not encrypted and not in your keychain. mim auth logout revokes it before deleting it. Prefer environment or secret-manager storage? Set MIM_API_TOKEN instead. Privacy details.

There is more behind mim --help: posthog query (read-only HogQL), klaviyo query (campaign and flow performance, an abandoned-cart flow check, a dead-link check over recent campaign emails), properties to repoint a project at the right GA4 property, and ads setup.

MCP

The whole stack, in one MCP server.

This is the part most agents are missing: real data. Your agent gets project-scoped, read-only tools for your audit findings, redacted narratives of real visits, and queries against whatever you have connected: GA4, Search Console, Google Ads (GAQL), PostHog (HogQL), Mixpanel, Klaviyo, and A/B results from Intelligems, VWO, Optimizely or GrowthBook. Raw replay payloads are never returned.

# already connected by mim setup. just ask, in plain English:
> Review the last 20 recordings. Find the bugs and UX friction, and propose fixes.
> Which landing pages lost the most sessions this month, and why?

The first prompt hits a purpose-built review tool: it returns a code-review brief with per-session evidence, repeated friction patterns, and audit context, so the agent proposes changes it can defend. To ship a fix, your agent runs mim fixes start in your shell and Mimetic opens the pull request with a preview link for you to review and merge. And if a site has no analytics at all, the agent can run the hosted setup itself: a GA4 property, the tag as a PR or as a snippet the agent applies in the repo, Search Console verification, and sitemap submission.

REST API

Or call it directly.

The CLI is a thin client over HTTPS, so everything it does is available to your scripts, CI, and backends. Authenticate with the bearer token mim auth login issues, project-scoped, no scraping, no headless browser to run yourself. Core resources are plain JSON under /api/mim; analytics and provider queries go through the MCP endpoint as JSON-RPC over HTTP.

# list your projects
curl https://trymimetic.com/api/mim/projects \
  -H "Authorization: Bearer mim_xxx"

# start an audit and poll for the report
curl -X POST https://trymimetic.com/api/mim/audits \
  -H "Authorization: Bearer mim_xxx" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://yourstore.com","mode":"slim"}'
POST/api/mim/auditsstart an audit
GET/api/mim/audits/:id/statuspoll status + report url
GET/api/mim/projectsyour sites
GET/api/mim/projects/:project/contextgrowth-context pack
GET/api/mim/projects/:project/findingsprioritized findings
GET/api/mim/projects/:project/fixesfixable findings + PR state
GET/api/mim/projects/:project/recordingssession-replay insights
POST/api/mim/mcpMCP over HTTP: GA4, GSC, GAQL, HogQL, Klaviyo, experiments

Managed tokens are scoped to projects available to the authenticated account, expire, and can be revoked with mim auth logout. Session-replay recordings require the replay add-on on an active plan.

x402 / Agentic

Building an AI agent?

Mimetic exposes a pay-per-call audit over the x402 protocol, your agent pays in USDC on Base and gets a full report, no account or API key. It's even discoverable in the x402 bazaar.

The x402 agentic API →

Start in your terminal.

Authenticate once. Audits, findings, analytics queries, and recordings are a command away.

npm install -g @mimeticinc/mim-cli
mim setup