Skip to main content
Metrifox exposes an MCP (Model Context Protocol) server that lets AI assistants query your billing data directly — customers, subscriptions, invoices, plans, usage, and MRR. This means you can ask an AI assistant questions like:
  • “How many subscribers does each plan have?”
  • “Show me the MRR trend for the last 6 months”
  • “What invoices are overdue for customer Acme Corp?”
…and the assistant will fetch real data from your Metrifox account to answer.

Server endpoint

https://api.metrifox.com/mcp
The MCP server uses the JSON-RPC 2.0 protocol over HTTP, as defined by the MCP specification.

Authentication

There are two ways to authenticate with the MCP server:

Option 1: API Key

The simplest option. Use an API key from your dashboard in the x-api-key header.
  1. Go to Developers > API Keys in your Metrifox dashboard
  2. Create or copy an existing API key
  3. Pass it as a header: x-api-key: sk_live_your_key_here
API keys have read and write scopes that control what actions they can perform. Currently all MCP tools are read-only, but when write tools are added, API keys without write scope won’t be able to use them.

Option 2: OAuth (for AI chat apps)

For apps where users log in with their Metrifox credentials, the MCP server supports the full OAuth 2.0 authorization code flow with PKCE. When using OAuth, the tools and resources available are scoped to the user’s role permissions. A user who only has access to view customers won’t be able to query invoices or subscriptions. OAuth endpoints:
EndpointDescription
GET /.well-known/oauth-authorization-serverAuthorization server metadata (discovery)
GET /.well-known/oauth-protected-resourceProtected resource metadata
POST /mcp/oauth/registerDynamic client registration
GET /mcp/oauth/authorizeAuthorization page
POST /mcp/oauth/tokenToken exchange (authorization code → access token)
Most MCP clients (Claude Desktop, Cursor, etc.) handle the OAuth flow automatically when you provide the server URL. You typically just need to enter the MCP endpoint and the client takes care of the rest.

Connecting your AI assistant

Claude Desktop

Add this to your Claude Desktop config file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
  "mcpServers": {
    "metrifox": {
      "url": "https://api.metrifox.com/mcp",
      "headers": {
        "x-api-key": "sk_live_your_key_here"
      }
    }
  }
}
With OAuth, Claude Desktop will open a browser window for you to log in when the connection is first established.

Cursor

  1. Open Settings > MCP
  2. Click Add new MCP server
  3. Set the transport to Streamable HTTP
  4. Enter https://api.metrifox.com/mcp as the URL
  5. For API key auth, add the header x-api-key with your key. For OAuth, leave headers empty — Cursor will handle the login flow.

Windsurf

Add to your Windsurf MCP config:
{
  "mcpServers": {
    "metrifox": {
      "serverUrl": "https://api.metrifox.com/mcp",
      "headers": {
        "x-api-key": "sk_live_your_key_here"
      }
    }
  }
}

Other MCP clients

Any MCP-compatible client that supports Streamable HTTP transport can connect. Configure it with:
  • URL: https://api.metrifox.com/mcp
  • Auth: Either x-api-key header or OAuth (the server advertises OAuth discovery at /.well-known/oauth-authorization-server)

What you can do

Once connected, your AI assistant can:
  • Look up customers — search by name, email, or key, and get full details including subscriptions, payment methods, and credit wallets
  • Check invoices and billing — view invoices by status (paid, overdue, etc.) and pull billing history for any subscription
  • Explore usage — see what features a customer has access to, their usage breakdown, and trends over time
  • Browse products and plans — view plan summaries, detailed pricing configurations (including localized pricing), entitlements, and subscriber counts
  • Track revenue — get MRR trends over time and per-plan revenue breakdowns
  • Generate charts — create bar, line, pie, or doughnut charts from any data
  • Search docs — look up Metrifox product documentation
The full list of tools and their parameters are automatically discovered by your MCP client when it connects — no manual configuration needed.

Permissions

How permissions work depends on the authentication method:
Auth methodPermission model
API KeyControlled by the key’s scopes (read, write). All read tools are available with a read-scoped key. Write tools (coming soon) will require write scope.
OAuthScoped to the logged-in user’s role permissions. Tools are filtered — users only see and can use tools they have permission for.
For OAuth users, tools are grouped by permission subject: customers, invoices, subscriptions, and product catalog. A user needs the relevant permissions to access tools in each group. Utility tools like chart generation and documentation search are always available.