PluginBench
MCP Server
Active
MIT

io.github.smigolsmigol/llmkit MCP Server

io.github.smigolsmigol/llmkit

AI cost tracking and budget admission for Claude, Cursor, and Cline—measure spend before requests exceed limits.

What is the io.github.smigolsmigol/llmkit MCP server?

LLMKit is an open-source AI gateway and SDK suite for cost attribution, budget admission, and request evidence. It reserves estimated spend before dispatching requests to AI providers and rejects requests that would exceed active budgets. The MCP server exposes 11 tools for tracking spend, managing budgets, and inspecting Claude Code and Cline sessions locally without requiring an LLMKit account.

LLMKit helps you measure and control AI agent costs across Claude, Cursor, and Cline. It provides local cost tracking via Python SDK or CLI wrapper, and a gateway mode for shared budgets and provider routing. The MCP server integrates spend tracking, budget enforcement, and session inspection directly into your AI development environment.

How to install io.github.smigolsmigol/llmkit

Copy-paste configuration for popular MCP clients.

transport: stdio
Config generated by PluginBench — verify against the source before use.
Environment / auth
  • LLMKIT_API_KEY
    secret

    LLMKit API key. Optional: local tools work without it.

  • LLMKIT_PROXY_URL

    LLMKit proxy URL (defaults to hosted service)

~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "llmkit": {
      "command": "npx",
      "args": [
        "-y",
        "@f3d1/llmkit-mcp-server"
      ],
      "env": {
        "LLMKIT_API_KEY": "<YOUR_LLMKIT_API_KEY>",
        "LLMKIT_PROXY_URL": "<YOUR_LLMKIT_PROXY_URL>"
      }
    }
  }
}

Tools & capabilities

Tools this server exposes to the agent.

  • Spend tracking — Inspect cumulative and per-request costs for Claude Code sessions and Cline tasks
  • Budget management — Set and enforce spending limits; reject requests before they exceed budget
  • Session inspection — Query Claude Code and Cline session data and cost attribution
  • Gateway tools — Access spend, budgets, API keys, sessions, and service health when LLMKIT_API_KEY is configured
  • Pricing comparison — Query pricing data for supported models via public API endpoint

Use cases

  • Track cumulative AI agent costs across Claude Code, Cursor, and Cline without external services
  • Set per-session or per-project budgets and automatically reject requests that would exceed limits
  • Inspect detailed cost breakdowns and provider usage metadata for billing and optimization
  • Compare pricing across Claude and OpenAI models before making requests
  • Monitor spending trends and session activity in real time

io.github.smigolsmigol/llmkit MCP server FAQ

What is LLMKit?

LLMKit is an open-source AI gateway and cost-tracking suite. It reserves estimated spend before dispatching requests, rejects requests over budget before they reach the provider, and settles actual usage when responses complete. The MCP server provides 11 tools for local cost tracking and budget enforcement.

Is LLMKit free?

Yes. The local tracking surfaces (Python SDK, CLI, and MCP server) are free and open-source under the MIT license. They do not require an LLMKit account or API key. Gateway mode with shared budgets and analytics requires an LLMKit API key (account creation is temporarily unavailable).

How do I install the MCP server in Cursor or Claude?

Add the MCP server to your client config: {"mcpServers": {"llmkit": {"command": "npx", "args": ["-y", "@f3d1/llmkit-mcp-server"]}}}. The server will then expose spend, budget, and session tools.

Do I need authentication to use the MCP server?

No. Five local tools (Claude Code and Cline inspection) work without any key. Six additional gateway tools require LLMKIT_API_KEY environment variable if you have an existing LLMKit account.

What models and providers does LLMKit support?

LLMKit includes a bundled pricing catalog for Anthropic Claude and OpenAI models. The catalog is a reference snapshot, not a live quote. Pricing data is available via the public comparison API endpoint.

How does budget enforcement work?

LLMKit atomically reserves the estimated cost of each request before dispatch. If the reservation would exceed the active budget, the request is rejected before reaching the provider. Actual usage is settled when the response completes.

README (reference)

Source of truth, from the repository.

<p align="center"> <img src=".github/logo-wordmark-animated.svg" width="280" alt="LLMKit" /> </p> <h3 align="center">Measure what your AI agents cost. Stop requests before they exceed a budget.</h3> <p align="center"> <a href="https://github.com/smigolsmigol/llmkit/actions/workflows/ci.yml"><img src="https://github.com/smigolsmigol/llmkit/actions/workflows/ci.yml/badge.svg" alt="CI" /></a> <a href="https://pypi.org/project/llmkit-sdk/"><img src="https://img.shields.io/pypi/v/llmkit-sdk?label=python" alt="PyPI" /></a> <a href="https://www.npmjs.com/package/@f3d1/llmkit-mcp-server"><img src="https://img.shields.io/npm/v/@f3d1/llmkit-mcp-server?label=mcp" alt="npm" /></a> <a href="https://scorecard.dev/viewer/?uri=github.com/smigolsmigol/llmkit"><img src="https://api.scorecard.dev/projects/github.com/smigolsmigol/llmkit/badge" alt="OpenSSF Scorecard" /></a> <a href="https://www.bestpractices.dev/projects/12288"><img src="https://www.bestpractices.dev/projects/12288/badge" alt="OpenSSF Best Practices" /></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT license" /></a> </p> <p align="center"> <a href="https://llmkit.sh">Website</a> | <a href="https://llmkit.sh/docs">Docs</a> | <a href="https://api.llmkit.sh/v1/pricing/compare?mode=text-token&models=anthropic%2Fclaude-sonnet-4-6%2Copenai%2Fgpt-4o&input=1000&output=1000&cacheRead=0&cacheWrite=0">Pricing API</a> | <a href="ARCHITECTURE.md">Architecture</a> | <a href="SECURITY.md">Security</a> | <a href="SECURITY-ASSURANCE.md">Assurance case</a> </p>

LLMKit is an open-source AI gateway and SDK suite for cost attribution, budget admission, and request evidence. The gateway reserves estimated spend before provider dispatch. It rejects requests that cannot fit the active budget, then settles admitted reservations to actual usage when the response completes.

The repository also ships local tracking surfaces that do not require an LLMKit account or proxy.

Choose a surface

SurfaceUse it whenPackage
Python transportYou want local cost estimates around existing SDK callsllmkit-sdk
CLI wrapperYour OpenAI or Anthropic client honors its standard base-URL environment variable@f3d1/llmkit-cli
TypeScript SDKYou have an existing key and want sessions, streaming, and gateway access from TypeScript@f3d1/llmkit-sdk
MCP serverYou want spend, budget, and local coding-session tools inside an MCP client@f3d1/llmkit-mcp-server
AI SDK providerYou use Vercel AI SDK 6@f3d1/llmkit-ai-sdk-provider
Gateway and dashboardYou need shared budgets, provider routing, receipts, and analyticspackages/proxy, packages/dashboard

Quick start

Local Python tracking

pip install llmkit-sdk
from llmkit import tracked
from openai import OpenAI

costs = []
client = OpenAI(http_client=tracked(on_cost=costs.append))

client.chat.completions.create(
    model="gpt-4.1",
    messages=[{"role": "user", "content": "Summarize this incident."}],
)

print(f"${sum(item.total_cost or 0 for item in costs):.6f}")

The transport reads provider usage metadata and estimates cost from the bundled pricing catalog. It does not send tracking data to LLMKit.

Zero-code CLI tracking

npx @f3d1/llmkit-cli -- python my_agent.py

Use -v for per-request output or --json for machine-readable results.

Gateway mode (existing key)

Gateway examples require an existing LLMKit API key. Account creation and key management are temporarily unavailable while the authenticated service is restored. If you do not already have a key, use one of the local tracking paths above.

from openai import OpenAI

client = OpenAI(
    base_url="https://api.llmkit.sh/v1",
    api_key="llmk_your_key_here",
)

response = client.chat.completions.create(
    model="gpt-4.1",
    messages=[{"role": "user", "content": "Draft a release note."}],
)

The budget path

<p align="center"> <img src=".github/budget-path.svg" width="100%" alt="LLMKit authenticates each request, reserves its estimated cost, rejects requests over budget before provider dispatch, and settles admitted requests to actual usage." /> </p>

The control path is built around three boundaries:

  • Atomic admission: a Durable Object owns reservation state for each budget scope. Concurrent requests cannot spend the same remaining balance.
  • Dispatch-aware idempotency: deterministic failures before dispatch release the key. After provider dispatch may have occurred, failures remain terminal to avoid duplicate spend.
  • Bounded responses: non-streaming bodies and individual SSE frames have explicit byte limits. LLMKit cancels upstream reads when a limit is exceeded.

Request receipts bind the admission decision, provider attempt, settlement, and analytics handoff with stable identifiers. Database writes use an outbox, so an analytics outage does not silently erase budget evidence.

MCP server

{
  "mcpServers": {
    "llmkit": {
      "command": "npx",
      "args": ["-y", "@f3d1/llmkit-mcp-server"]
    }
  }
}

Five local tools inspect supported Claude Code sessions and Cline task data without an LLMKit key. Six gateway tools query spend, budgets, keys, sessions, and service health when LLMKIT_API_KEY contains an existing key. Together they expose 11 tools.

Pricing data

The pinned catalog is a bundled reference snapshot, not a live quote. One source file, packages/shared/pricing.json, records the snapshot date and generates the TypeScript, Python, and MCP tables. CI rejects drift between the source and generated files. The public site renders only populated provider tables and displays the source date.

The public comparison endpoint requires no account:

https://api.llmkit.sh/v1/pricing/compare?mode=text-token&models=anthropic%2Fclaude-sonnet-4-6%2Copenai%2Fgpt-4o&input=1000&output=1000&cacheRead=0&cacheWrite=0

The endpoint prices only the exact model keys supplied by the caller. It does not search for or recommend the cheapest model. Pricing is an estimate, not a provider invoice. Provider billing rules, model modality, and catalog freshness remain part of the error boundary.

Evidence and current boundary

ClaimEvidence in this repositoryBoundary
Concurrent budget admission is serializedWorker fixtures exercise competing reservations, retries, settlement, and recoveryDeterministic local Worker and database proof
Retry behavior avoids duplicate dispatchIdempotency tests cover payload mismatch, pre-dispatch release, and post-dispatch indeterminate stateProvider behavior is simulated in CI
Large provider responses are boundedSuccess, error, and unterminated SSE fixtures verify rejection and stream cancellationBound is per buffered response or SSE frame
Pricing artifacts are reproducibleOne generator and CI --check path cover all published language tablesCatalog values still require source updates
Hosted recovery can be evaluated safelyGuarded staging deploy and proof runners bind an isolated Worker, database, revision, and cleanup journalA completed hosted concurrency and outage-recovery receipt is not claimed here

See STAGING_PROOF.md for the isolated hosted proof contract. It deliberately refuses production targets and dirty worktrees.

Project policy and design

DocumentWhat it owns
GovernanceDecision authority, roles, disputes, and the current continuity gap
RoadmapIntended and excluded work through August 2027
ArchitectureComponents, request flows, identity, storage, deployment, and failure boundaries
SecuritySecurity requirements, excluded guarantees, reporting, and supported versions
Security assuranceThreat model, trust boundaries, executable evidence, residual risks, and runtime HOLDs
AccessibilityPublic-site controls, verification method, known gaps, and language scope
ContributingSetup, quality gates, review expectations, and DCO sign-off

Development

git clone https://github.com/smigolsmigol/llmkit
cd llmkit
corepack pnpm@9.15.4 install --frozen-lockfile
corepack pnpm@9.15.4 build
corepack pnpm@9.15.4 quality:pr

Run the Worker locally with development-only bindings:

corepack pnpm@9.15.4 --filter @f3d1/llmkit-proxy dev

Generic deploy commands are intentionally omitted. Staging and production use separate guarded scripts with explicit target confirmation.

Security

Provider credentials are encrypted with AES-256-GCM using a random IV and owner/provider-bound additional authenticated data. LLMKit API keys are hashed before storage. CI includes secret scanning, static analysis, dependency review, CodeQL, and package provenance checks.

Read the security policy and architecture and the machine-readable Security Insights snapshot. Please report vulnerabilities through GitHub private vulnerability reporting or email security@llmkit.sh.

License

MIT

Related MCP servers

Scan suspicious messages, URLs, and text for scams with AI. Free tier - no API key required.

0
JavaScript
MIT
View repository →

Deterministic Minecraft pixel-art engine: textures, animation sheets, and pack validation.

1
TypeScript
MIT
View repository →

Search South Korea's national R&D regulations in natural language with cited provisions.

10
Python
Apache-2.0
View repository →
SKSkillsmith logo

Publish, version, and manage agent skills across your team with security scanning and deprecation tracking.

76
TypeScript
View repository →

AI trading journal: your agent logs trades from chart screenshots and checks your own rules.

1
JavaScript
MIT
View repository →

Shared reasoning across agents. / Wspólne rozumowanie agentów.