Skip to main content
Glama
ComputeLedger MCP Server

ComputeLedger MCP Server

ComputeLedger

CI npm version PyPI version License: Apache-2.0 Node

Sign, hash-chain, and independently verify compute usage, portable across any provider.

ComputeLedger demo: computeledger keys generate --local, computeledger record --local, and computeledger ledger verify --local running against the real CLI

ComputeLedger records a compute job's usage (GPU-hours, hardware, duration, workload type) as a cryptographically signed receipt and appends it to a tamper-evident local ledger. Anyone can verify a receipt's authenticity and the ledger's integrity without trusting the issuer, and without buying into any single cloud, chain, or vendor's stack.

Install

npm install -g computeledger-cli
pip install computeledger-cli

Both packages install the same computeledger command. Receipts are interoperable either way: a receipt signed by the npm binary verifies correctly with the PyPI binary, and vice versa.

Related MCP server: audit-ledger-mcp

Quickstart

$ computeledger keys generate --local
Generated Ed25519 keypair.
Public key: COxK/lkoWxWB42QKXjvcHnmBPozH4Oo2JHoOKDjsoU8=
Private key: ./.computeledger/keys/ed25519.pem (mode 600)

$ computeledger record --local --provider aws --hardware nvidia-h100 \
    --duration-seconds 3600 --gpu-hours 1 --workload-type training
Recorded usage receipt 39952199-0897-48b8-92c5-e351f773c83d.

$ computeledger ledger verify --local
Ledger valid: 1 entries, unbroken hash chain.

Or wrap a real job directly, no manual record call needed:

computeledger run --local --provider on-prem --hardware nvidia-a100 -- python train.py

run executes the wrapped command as a real subprocess (never through a shell), measures wall-clock duration, samples GPU utilization via nvidia-smi when one is present, and signs + appends the resulting receipt automatically. On a machine with no NVIDIA GPU, it still produces a duration-only receipt.

ComputeLedger run --wrap demo: computeledger run --local --provider on-prem --hardware nvidia-a100 -- sleep 1 wraps a real job, measures duration, and signs the receipt automatically

Give the receipt to anyone, on any machine, with no ComputeLedger account and no network call:

computeledger verify receipt.json

Why this exists

Multi-cloud and multi-provider GPU usage has no portable, verifiable record. A cost dashboard tells you what a provider says you used; it does not let a third party independently confirm that record wasn't altered after the fact, and it only works with the providers it integrates with. ComputeLedger is a lightweight, provider-agnostic attestation format: any process that can run a CLI command or call an MCP tool can produce a receipt, and any process, in any language, can verify one.

This is deliberately narrow. It does not compete with GPU marketplaces, cost dashboards, or confidential-computing platforms, all of which do real, different jobs. See the comparison below for exactly where the line is.

Features

  • Ed25519 signatures via Node's and Python's built-in/standard crypto libraries. No bespoke cryptography, no external crypto dependency on the TypeScript side.

  • Hash-chained ledger. Every receipt embeds the previous receipt's hash. Deleting, reordering, or editing a historical entry breaks the chain in a way ledger verify detects, even if the tampered entry's own signature still looks locally valid.

  • Cross-language interoperability by construction. A receipt signed by the npm package's computeledger binary verifies correctly against the PyPI package's computeledger binary. Both implementations serialize the receipt payload through the same deterministic canonical-JSON algorithm before hashing.

  • Provider-agnostic. No account, no API key, no dependency on any specific cloud or chain. Works identically on a laptop, an on-prem cluster, or any cloud VM.

  • Agent-native. Every subcommand supports --json for structured output, and computeledger mcp starts a Model Context Protocol server exposing record_usage, verify_receipt, list_ledger, and verify_ledger as callable tools.

  • No shell-injection surface. computeledger run -- <command> executes the wrapped command via an argument array, never a shell string, so metacharacters in the wrapped command are inert.

CLI reference

computeledger keys generate [--local]
computeledger keys show [--local] [--json]
computeledger run [--local] [--provider <name>] [--hardware <type>] [--workload-type training|inference|unknown] [--no-record-command] [--json] -- <command...>
computeledger record --provider <name> --hardware <type> --duration-seconds <n> [--gpu-hours <n>] [--flops <n>] [--workload-type <type>] [--local] [--json]
computeledger verify <receipt.json> [--json]
computeledger ledger list [--local] [--json]
computeledger ledger show <id> [--local] [--json]
computeledger ledger verify [--local] [--json]
computeledger export --format json|csv [--out <file>] [--local]
computeledger mcp

Flag

Meaning

--local

Use ./.computeledger in the current directory instead of ~/.computeledger

--json

Structured JSON on stdout instead of human-readable text

--no-record-command

Omit the wrapped command string from the receipt (run only)

ComputeLedger CLI walkthrough: keys generate --local, record --local, ledger list --local --json, and export --format csv --local running end to end against the real CLI

MCP Server

ComputeLedger ships a Model Context Protocol server so an AI agent (Claude, Cursor, or any MCP-compatible client) can record and verify compute usage receipts directly, without a human invoking the CLI by hand. The Python package exposes the server as a subcommand rather than a separate console script, so computeledger mcp is the real invocation, not computeledger-mcp.

pip install computeledger-cli

Add it to your MCP client's config (for Claude Desktop, claude_desktop_config.json):

{
  "mcpServers": {
    "computeledger": {
      "command": "uvx",
      "args": ["--from", "computeledger-cli", "computeledger", "mcp"]
    }
  }
}

The server exposes four tools, matching the CLI one-for-one:

  • record_usage(provider, hardware, durationSeconds, gpuHours?, estimatedFlops?, workloadType?, local?): signs a usage entry with the local Ed25519 key, appends it to the hash-chained ledger, and returns the signed receipt.

  • verify_receipt(receipt): independently verifies a receipt's signature and hash integrity.

  • list_ledger(local?): lists every receipt recorded in the local ledger.

  • verify_ledger(local?): verifies every entry's signature plus the unbroken hash chain across the whole ledger.

Example call:

record_usage(provider="lambda-labs", hardware="nvidia-h100", durationSeconds=3600, gpuHours=1, workloadType="training")

Transport is stdio, so there is nothing to host: the MCP client spawns the server as a local subprocess. Source: python/src/computeledger/mcp/server.py.

The npm package exposes the same four tools through the native TypeScript server (src/mcp/server.ts), invoked the same way with npx computeledger-cli mcp. Both implementations are cross-verified interoperable, and every tool returns the same structured JSON shape the CLI's --json mode produces.

Library API

import { createReceipt, verifyReceipt, Ledger, verifyChain, loadKeyPair, resolvePaths } from "computeledger-cli";
from computeledger import create_receipt, verify_receipt, Ledger, verify_chain, load_key_pair

Comparison

ComputeLedger occupies a narrow, specific gap: a portable, cryptographically verifiable usage receipt that doesn't require adopting any single provider's chain or platform. It is not trying to replace the tools below, each of which does a real, different job.

ComputeLedger

SkyPilot

OpenCost

AICert

What it is

Signed, portable usage receipts

Multi-cloud job orchestration + cost

Kubernetes/cloud cost monitoring

Training-provenance attestation

Cryptographic verification

Yes (Ed25519, offline)

No

No

Yes (TPM-based)

Provider lock-in

None

Orchestrates specific clouds

Kubernetes/cloud-native

None

Tamper-evident history

Yes (hash-chained ledger)

No

No

No (single artifact, no chain)

GitHub stars

New

10,441

6,659 (CNCF)

20

Project activity

Active

Active

Active

No commits since June 2024

Agent-native (MCP/--json)

Yes

Partial (API/SDK)

No

No

SkyPilot and OpenCost solve real, adjacent problems (running jobs across clouds, and visualizing what they cost) at far larger scale and maturity than this project. Neither produces a signed, independently verifiable usage record. AICert attempted training-compute provenance as a standalone OSS tool using TPM-bound attestation and has had no commits since June 2024; ComputeLedger's scope is deliberately narrower (a usage receipt, not a full training-provenance framework) and ships both an npm and a PyPI package from day one specifically so the receipt format isn't locked to one language's ecosystem.

What is ComputeLedger, and why does it exist

ComputeLedger is an open-source CLI, library, and MCP server for producing and verifying cryptographically signed records of compute usage. It exists because compute usage claims (GPU-hours consumed, hardware used, workload duration) currently have no portable, offline-verifiable proof format: a billing dashboard is only as trustworthy as the provider issuing it, and it only covers that one provider. ComputeLedger's receipts are self-contained, signed JSON objects that any party, on any machine, in either of two independently maintained language implementations, can verify without a network call or a trusted third party.

FAQ

Does ComputeLedger require an account or API key? No. Everything runs locally. Keys are generated and stored on your own machine (~/.computeledger or ./.computeledger with --local).

Can a receipt be forged? Not without the private key used to sign it. verify recomputes the payload hash and checks the Ed25519 signature against the embedded public key; the public key itself is part of the signed payload, so substituting a different key changes the hash and invalidates the receipt.

What happens if there's no GPU? computeledger run degrades gracefully: it records wall-clock duration and whatever --hardware/--provider you specify, and simply omits GPU utilization samples if nvidia-smi isn't found.

Does this compete with SkyPilot or OpenCost? No, see the comparison table above. Those tools solve orchestration and cost visibility; ComputeLedger solves independent verifiability of a usage claim. The two are complementary: run SkyPilot or OpenCost for orchestration and cost, and drop ComputeLedger in wherever you need a signed record.

Is the receipt format a blockchain? It's a local, hash-chained, append-only log, similar in spirit to a Merkle log or a git commit chain. There's no token, no consensus mechanism, and no network involved.

Does ComputeLedger work on Windows? The npm and PyPI packages install and run on any platform Node.js 18+ or Python 3.10+ supports, including Windows. One caveat: private key files are written with POSIX permission bits (mode 600), which restrict access on Linux and macOS; Windows does not enforce the same POSIX permission model, so the file is written but the access restriction has no equivalent effect there. CI currently runs on Linux only, so Windows and macOS are not continuously tested upstream.

Can I use ComputeLedger for commercial projects? Yes. Both the TypeScript and Python packages are licensed Apache-2.0, which permits commercial use, modification, and redistribution, including in closed-source products, as long as the license and copyright notice are preserved.

What if I need multi-cloud orchestration or a cost dashboard instead? ComputeLedger doesn't do either. It only produces and verifies signed usage receipts. Pair it with SkyPilot for orchestration or OpenCost for cost visibility if you need those.

Contributing

Issues and pull requests are welcome. Run npm test (TypeScript) or pytest (python/) before opening a PR: both language implementations ship a full test suite, and any change touching the receipt or canonical-JSON format must keep both sides interoperable (see CONTRIBUTING.md).

License

Apache-2.0

Available Tools

4 tools
list_ledgerList ledger entriesA

Lists every signed usage receipt recorded in the local ComputeLedger ledger, in insertion order. Call this to inspect or export local compute-usage history, e.g. before running verify_ledger, or to summarize usage across providers. Nothing must exist beforehand; a missing or empty ledger returns an empty list, not an error.

Side effects: read-only, reads the local ledger file but never writes to it, makes no network calls, and is fully idempotent and safe to call repeatedly.

Parameters: local (optional bool, default false) - true reads ./.computeledger/ledger.jsonl in the current directory instead of ~/.computeledger/ledger.jsonl in the home directory. Equivalent CLI: computeledger ledger list --json (add --local to match local=true).

Returns a JSON array of full signed receipt objects, each with the same shape record_usage returns (version, id, timestamp, provider, hardware, usage, command, prevHash, publicKey, hash, signature). Feed any single entry into verify_receipt, or call verify_ledger to check the whole chain at once.

Inputs: local.

record_usageRecord compute usageA

Records one unit of compute usage (provider, hardware, duration, and optional GPU-hours/FLOPs/workload type) as a signed, hash-chained receipt in the local ComputeLedger ledger, and returns that receipt as portable, independently verifiable proof of the usage claim. Call this after a workload finishes (or with measured/estimated values) when you need durable evidence of compute consumed, e.g. reconciling a provider's bill or building a cross-provider audit trail. Do not call it for read-only lookups (use list_ledger) or to check a receipt you already have (use verify_receipt). Requires a local Ed25519 keypair generated beforehand via computeledger keys generate; the call fails if none exists.

Side effects: mutating and NOT idempotent, each call appends a new entry (fresh UUID and timestamp) to the local ledger file (~/.computeledger by default, or ./.computeledger when local=true) and reads the private key from disk. No network calls are made. On failure (missing keypair, invalid duration, etc.) it returns is_error=true with a JSON {"error": ""} body instead of raising.

Parameters: provider (str, e.g. 'aws', 'lambda-labs', 'on-prem'), hardware (str, e.g. 'nvidia-h100', 'nvidia-a100', 'cpu'), durationSeconds (float >= 0), gpuHours and estimatedFlops (optional float >= 0), workloadType (optional enum: training | inference | unknown), local (optional bool). Equivalent CLI: computeledger record --provider aws --hardware nvidia-h100 --duration-seconds 3600 --gpu-hours 1 --workload-type training --json.

Returns the full signed receipt as JSON: version, id, timestamp (ISO-8601 UTC), provider, hardware, usage {durationSeconds, gpuHours, estimatedFlops, gpuUtilizationSamples, workloadType}, command, prevHash, publicKey, hash, and signature. Pass this object straight into verify_receipt to independently confirm it.

Inputs: hardware (required), provider (required), durationSeconds (required), local, +3 more.

verify_ledgerVerify the full ledger chainA

Verifies every entry's signature AND the unbroken hash-chain linkage across the entire local ledger in one call, catching forged receipts as well as deleted, reordered, or spliced-in entries that a single-receipt check (verify_receipt) cannot detect on its own. Call this for a full integrity audit of the local ledger before trusting exported totals, or periodically as a tamper-detection check. Requires an existing ledger (see list_ledger); an empty ledger verifies as valid with entryCount 0.

Side effects: read-only, reads the local ledger file, no writes, no network calls, fully idempotent. Verification stops at the first invalid entry rather than continuing past it, since the hash chain is meaningless from that point forward.

Parameters: local (optional bool, default false) - same meaning as in list_ledger and record_usage. Equivalent CLI: computeledger ledger verify --json (add --local to match local=true).

Returns {"valid": bool, "entryCount": , "firstInvalidIndex": <int|null>, "firstInvalidReason": "<invalid_signature|hash_mismatch|unsupported_version|malformed_receipt|chain_broken|null>"}. is_error is set to true whenever valid is false, so a broken chain is visible both in the payload and the MCP error flag.

Inputs: local.

verify_receiptVerify a compute usage receiptA

Independently checks whether a single signed ComputeLedger receipt is authentic and untampered, without needing to trust whoever issued it. Call this whenever you're handed a receipt (from record_usage, computeledger record, or a third party) and need to confirm it's cryptographically valid before trusting the usage numbers inside it. No prerequisites: it needs nothing on local disk beyond the receipt object itself, and does not require the signer's private key.

Side effects: read-only, no ledger writes, no file access beyond the in-memory argument, no network calls. Fully idempotent, the same receipt always verifies the same way. It never raises on an invalid receipt, instead it returns a normal result with is_error=true, so check the 'valid' field rather than relying on an exception.

Parameters: receipt (dict) - the full signed receipt object as produced by record_usage or computeledger record (must include version, hash, signature, and the other receipt fields). Equivalent CLI: computeledger verify receipt.json --json.

Returns {"valid": true} on success, or {"valid": false, "reason": "<invalid_signature|hash_mismatch|unsupported_version|malformed_receipt>"} on failure, so callers can distinguish exactly why a receipt failed.

Inputs: receipt (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.9/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: record_usage creates a new receipt, verify_receipt checks a single receipt, list_ledger lists all receipts, and verify_ledger audits the entire chain. Descriptions explicitly cross-reference when to use which, leaving no ambiguity.

    Naming Consistency5/5

    All four tool names follow the same verb_noun pattern: record_usage, verify_receipt, list_ledger, verify_ledger. The verbs (record, verify, list, verify) and nouns (usage, receipt, ledger) are consistently used and intuitive.

    Tool Count5/5

    Four tools is ideal for a focused compute-ledger server: one for creating records, one for verifying individual receipts, one for listing history, and one for full-chain audit. There is no bloat or redundancy; each tool earns its place.

    Completeness5/5

    The tool set covers the entire lifecycle of compute-usage receipts: recording, single-receipt verification, listing, and whole-ledger integrity verification. The only missing piece (key generation) is handled externally via CLI, which is outside the server's scope, so the MCP surface is complete.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Tamper-evident audit logging for AI decisions. Three tools (record_decision, verify_decision, list_decisions) write to a regulator-grade ledger built on AWS S3 Object Lock with 7-year retention. Designed for EU AI Act Article 12 and FCA SS1/23 evidence requirements. Try zero-config: npx audit-ledger-mcp boots in sandbox mode against a public hosted tenant.
      3
      59 npm
      1
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Records privacy-preserving receipts for AI-assisted tasks and enables optional onchain reward claiming via AIPOU tokens. Integrates with MCP-compatible clients like Claude and Cursor.
      11
      4
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Provides tools to issue, verify, and export cryptographically signed receipts for AI agent actions, enabling tamper-proof audit trails for compliance with regulations like the EU AI Act.
      4
      58 npm
      1
      MIT