MCP server

Lease accounting as MCP tools

The Model Context Protocol (MCP) is an open standard that lets an AI agent call external tools. The Ledgerage MCP server exposes the deterministic lease engine as four tools any MCP-compatible client — Claude Desktop, Claude Code, and others — can call.

stdio transport4 toolsThin wrapper over the REST API

The four tools

Every tool takes the same lease input (the same fields as the REST API — see the API reference). They differ only in what they return.

compute_lease1 unit

The full computation — present value, right-of-use asset, lease liability, the entire amortization schedule, disclosures and journal entries. Deterministic and audit-grade; every number traces to the standard.

lease_schedule1 unit

The period-by-period amortization schedule: interest, principal, lease-liability balance, ROU amortization and ROU asset balance. Reconciles to zero.

journal_entries1 unit

Double-entry journal entries — the commencement entry plus one balanced entry per period (interest + amortization for finance leases, straight-line cost for operating leases).

classify_lease0 units — free

Evaluate the five ASC 842 finance-lease criteria and return operating vs finance with reasoning and citations. IFRS 16 / GASB 87 return the single lessee model.

1. Get an API key

The MCP server authenticates to Ledgerage with an API key. Create one from your account settings — a sk_test_… key for development or a sk_live_… key for production — and keep it secret. The server reads it from the LEDGERAGE_API_KEY environment variable.

2. Run the server

The server speaks the MCP stdio transport, so you normally let your MCP client launch it. To run it directly for a quick check:

Run on stdio
LEDGERAGE_API_KEY=sk_live_... npx tsx mcp/server.ts

It reads two environment variables:

  • LEDGERAGE_API_KEY — required, your sk_live_… or sk_test_… key.
  • LEDGERAGE_BASE_URL — optional, defaults to https://ledgerage.com.

3. Configure your MCP client

Add Ledgerage to your client's MCP configuration. The entry below (Claude Desktop / Claude Code style) registers a server named ledgerage that launches the stdio server with your key in the environment:

mcpServers config (JSON)
{
  "mcpServers": {
    "ledgerage": {
      "command": "npx",
      "args": ["-y", "tsx", "mcp/server.ts"],
      "env": {
        "LEDGERAGE_API_KEY": "sk_live_...",
        "LEDGERAGE_BASE_URL": "https://ledgerage.com"
      }
    }
  }
}

Claude Code users can add it from the command line instead:

Claude Code CLI
claude mcp add ledgerage \
  --env LEDGERAGE_API_KEY=sk_live_... \
  --env LEDGERAGE_BASE_URL=https://ledgerage.com \
  -- npx -y tsx mcp/server.ts

The args path (mcp/server.ts) is resolved from your working directory — point it at wherever the Ledgerage mcp/server.ts lives, or use an absolute path. After saving, restart the client; the four tools appear automatically.

4. Call a tool

Once connected, just ask. The agent picks the right tool and fills in the lease fields; the response is the same structured JSON the REST API returns, citations included.

Example
# In your MCP client, ask the agent to call a tool:
"Classify this lease and give me the ASC 842 journal entries:
 60 months, $5,000/month in advance, 7% discount rate."

# The agent calls classify_lease then journal_entries with:
{
  "standard": "ASC_842",
  "commencementDate": "2026-01-01",
  "termMonths": 60,
  "paymentAmount": 5000,
  "paymentFrequency": "monthly",
  "paymentTiming": "advance",
  "discountRateAnnual": 0.07
}

A thin wrapper, by design

The MCP server has no special-cased behaviour: each tool is a thin wrapper that POSTs to the corresponding /api/v1 endpoint. Everything — the deterministic engine, quotas, idempotency and structured errors — lives behind the REST API. So the tools bill against the same monthly computation quota as direct API calls (classify_lease is free), and anything documented for the API holds for the tools too.

Need help wiring it up? Email hello@ledgerage.com.