New — MCP server for agent runtimes

Give agents a wallet.Stop burning tokens.

credits.dev now exposes a Model Context Protocol server. Any MCP-capable agent — Claude Desktop, Cursor, your own runtime — can natively reserve, spend, and report on credits without writing HTTP plumbing.

Why MCP

Native tool calls

Agents call reserve_credits the same way they call any other tool — no SDK install, no REST plumbing.

Reserve, then confirm

The reservation pattern protects against runaway spend: hold credits before the LLM call, settle at the real cost after.

Stdio or hosted

Run locally with npx, or hit the hosted endpoint at mcp.credits.dev from any platform.

Tools (11)

get_balance

Available, reserved, and total credit balance.

get_account

Profile (id, externalId, name, email, balance).

reserve_credits

Hold N credits before paid work; returns reservationId.

confirm_reservation

Settle a reservation at the actual amount used.

cancel_reservation

Release a reservation without spending.

deduct_credits

One-shot debit when the cost is known up front.

record_usage

Attribute token usage to a model for analytics.

list_transactions

Recent debits and credits, newest first.

list_reservations

Open or all reservations for an account.

calculate_cost

Estimate credit cost for a model + token counts.

list_models

Catalog of supported models with pricing.

Write tools accept idempotencyKey. Errors arrive as structured codes (insufficient_credits, etc.) so agents can react without parsing strings.

Install

{
  "mcpServers": {
    "credits-dev": {
      "command": "npx",
      "args": ["-y", "@credits-dev/mcp-server"],
      "env": { "CREDITS_API_KEY": "sk_live_..." }
    }
  }
}

Get an API key at app.credits.dev/dashboard/api-keys.

Typical flow

// Inside an agent runtime that has the credits.dev MCP server installed
// the agent can call these tools natively — no SDK install required.

// 1. Estimate cost
calculate_cost({ modelId: "gpt-4o", inputTokens: 4000, outputTokens: 800 })
//   → { estimatedCostUsd: 0.0220, ... }

// 2. Reserve before the LLM call
reserve_credits({ externalId: "agent_writer_42", amount: 25 })
//   → { reservationId: "rsv_abc", status: "pending" }

// 3. Do the paid work, then confirm with the actual amount
confirm_reservation({ reservationId: "rsv_abc", actualAmount: 22 })
//   → { transactionId: "txn_xyz", balance: 9978 }

// 4. Attribute usage to a model for the analytics tab
record_usage({
  externalId: "agent_writer_42",
  transactionId: "txn_xyz",
  modelId: "gpt-4o",
  inputTokens: 4000,
  outputTokens: 800,
})

Early Access

The MCP server is free during beta. Sign up, grab an API key, drop the JSON snippet into your agent runtime, and your agent will list credits-dev in its tool catalog within seconds.

Free during beta
stdio + hosted endpoints
Streamable HTTP transport
Typed error codes