Skip to main content

AI Agent Integration

lim is designed from the ground up for AI agents. While it has a CLI and web interface for humans, the primary consumers of lim’s API are AI agents that autonomously handle bookkeeping.

The Vision

Today, a human bookkeeper:
  1. Downloads bank statements
  2. Looks at each transaction
  3. Decides the correct account classification
  4. Types the journal entry into accounting software
  5. Repeats 200-500 times per month
With lim, an AI agent:
  1. Receives bank transactions automatically
  2. Classifies each transaction using the judgment engine
  3. Creates journal entries via MCP tools or REST API
  4. Learns from corrections to improve over time
  5. Handles 95%+ of transactions without human input
The goal: bookkeeping that runs itself. Humans review exceptions and make strategic decisions. The AI handles everything else.

Three Integration Paths

How Agents Interact with lim

Reading Financial Data

Agents need context to make decisions. lim provides read access to:
DataMCP ResourceREST Endpoint
Trial balancelim://company/{id}/trial-balanceGET /v1/companies/:id/reports/trial-balance
Chart of accountslim://company/{id}/accountsGET /v1/companies/:id/accounts
Journal entrieslim://company/{id}/journal-entriesGET /v1/companies/:id/journal-entries
Bank transactionslim://company/{id}/bank-transactionsGET /v1/companies/:id/bank-transactions
Active alertslim://company/{id}/alertsGET /v1/companies/:id/alert-rules/evaluate
Cash runwaylim://company/{id}/cash-runwayGET /v1/companies/:id/dashboard
Scenario difflim://company/{id}/scenario/{sid}/diffGET /v1/companies/:id/scenarios/:sid/diff

Creating Entries

Agents create journal entries through:
ActionMCP ToolREST Endpoint
Create journal entrycreate_journal_entryPOST /v1/companies/:id/journal-entries
Match bank transactionmatch_bank_transactionPOST /v1/companies/:id/nl-journal
Generate scenariogenerate_scenarioPOST /v1/companies/:id/scenarios/:sid/generate
Apply scenarioapply_scenarioPOST /v1/companies/:id/scenarios/:sid/apply

The Agent Workflow

A typical AI agent session looks like this:
Agent: Read trial balance to understand current state
       → MCP Resource: trial-balance

Agent: Read unmatched bank transactions
       → MCP Resource: bank-transactions

Agent: For each unmatched transaction:
       → MCP Tool: match_bank_transaction
       → If high confidence: auto-post
       → If low confidence: flag for human review

Agent: Check alerts
       → MCP Resource: alerts
       → If cash runway < 3 months: notify CFO

Agent: Generate scenario
       → "What if we delay hiring for 2 months?"
       → MCP Tool: generate_scenario
       → MCP Resource: scenario/{id}/diff

Security Model

AI agents authenticate the same way as human users:
  • OAuth tokens via WorkOS for interactive agents (Claude Code)
  • API keys for automated agents (cron jobs, webhooks)
All actions are audit-logged with:
  • created_by_type: "agent" or "user"
  • The specific agent/user ID
  • Timestamp and source event
AI agents can create journal entries but cannot close fiscal periods, delete companies, or modify authentication settings. These actions require human authorization.

Getting Started

The fastest way to start is with the MCP server:
npx @lim-labs/lim mcp add
This registers lim as an MCP server in your Claude Code configuration. From there, Claude can read your financial data and create journal entries through natural conversation. See the MCP Server guide for detailed setup instructions.