Metrics

Get MCP server usage by pull request

Changed on

Returns one JSON row per merged, reviewed pull request that used MCP, with MCP servers and tools nested under servers. Join to GET /v1/metrics/reviews on pr_url. Counts are best-effort usage telemetry. Access is controlled by an organization-scoped feature flag. Pagination is in write order rather than by merge date, so a pull request written after your cursor already passed its merge date (a backfill) still appears on a later page instead of being silently skipped. Each page request consumes one token when admitted by the request rate limiter. Reviews, review comments, and MCP share the Metrics quota for the configured quota owner. With verified owner scope, coordinate calls across API keys for the same organization, workspace, or Git-provider instance; changing an organization selector does not add quota.

get/v1/metrics/mcp

Request

  • Base URL
    https://api.coderabbit.ai
  • Auth
    API key in header x-coderabbitai-api-key

Query parameters

org_idstring

Workspace API keys only; scopes the request to one provider organization.

start_datestring date required
end_datestring date required
organization_idsstring

Comma-separated provider organization IDs. Self-hosted only; maximum 10.

repository_idsstring

Comma-separated provider repository IDs; maximum 10.

user_idsstring

Comma-separated provider PR-author IDs; maximum 10.

limitinteger
cursorstring

Opaque next_cursor from the previous response.

Headers

x-coderabbitai-api-keystring required

Response

MCP server usage for merged pull requests

next_cursorstring nullable required

Changes

    • info

      added the media type application/json for the response with the status

    • info

      added the media type application/json for the response with the status

    • info

      added the non-success response with the status