Claude Code & Cursor — carbon via MCP

Public URLs use /mcp and /v1/session (rewritten to /api/mcp and /api/v1/session on this site). Use your existing isv_live_sk_ / isv_test_sk_ key. Estimates use the same token × coefficient model as production /v1/track (illustrative; not a watt-meter).

Overview
New to this flow? Read the short product page first — then come back here for exact URLs and IDE snippets.
1. What you get
After each tool call, we record prompt/completion tokens, attribute CO₂e, roll up per session and per developer per day. Streaming “equivalent” is an order-of-magnitude comparison (see methodology).
2. Endpoints
Public URLs (rewrites strip /api where configured).

GET https://carbon-llm.com/mcp/manifest — tool manifest (no auth)

POST https://carbon-llm.com/api/mcp Authorization: Bearer isv_…

GET https://carbon-llm.com/api/v1/session/<developer_id>/today — today's aggregates (URL-encode emails)

3. Request body (POST /mcp)
{
  "tool": "track_carbon",
  "input": {
    "prompt_tokens": 1200,
    "completion_tokens": 400,
    "model": "claude-3-5-sonnet-20241022",
    "session_id": "2026-03-30-my-repo",
    "developer_id": "you@company.com"
  }
}

session_id and developer_id default if omitted (see API behaviour).

4. Claude Code config (example)
Point MCP at your deployed host; use the same Bearer key as the REST API.
// ~/.claude/config.json (example — field names depend on Claude Code version)
{
  "mcpServers": {
    "carbon-llm": {
      "url": "https://carbon-llm.com/mcp",
      "headers": {
        "Authorization": "Bearer isv_live_sk_…"
      }
    }
  }
}
5. Cursor & other clients (example)
File location and JSON shape depend on your editor version — confirm against Cursor's current MCP docs. The connector label (e.g. carbon-llm) is local-only; the service is carbon-llm.
// .cursor/mcp.json (illustrative — verify path with Cursor docs)
{
  "mcpServers": {
    "carbon-llm": {
      "url": "https://carbon-llm.com/mcp",
      "headers": {
        "Authorization": "Bearer isv_test_sk_…"
      }
    }
  }
}
6. Verify your deployment
Use the same origin you set in NEXT_PUBLIC_APP_URL (production host).

Manifest (no auth): open https://carbon-llm.com/mcp/manifest in a browser or curl -sS https://carbon-llm.com/mcp/manifest.

POST with Bearer: see README for a minimal curl to https://carbon-llm.com/api/mcp.

Public path /mcp rewrites to /api/mcp — both refer to the same handler.

7. Troubleshooting

401 / invalid key: use a key from Dashboard → API keys; test and live keys both work for MCP — prefix isv_test_sk_ or isv_live_sk_.

Wrong host: MCP URL must match your deployed carbon-llm origin (no typo, https in production).

No events: confirm the IDE is calling the tool after responses; check dashboard usage when in doubt.