Skip to Content
Open Booksby LumeoDocs

MCP for AI agents

Run the Open Books MCP server with npx to verify bank statements and tax files with an AI agent, then inspect the proof in one batched call.

Model Context Protocol (MCP) lets an AI client call tools supplied by another program. The Open Books MCP server, published as the npm package @lumeo_hq/openbooks, lets a compatible client check a financial file and read the proof behind the decision. Choose the setup path that matches what you want to do.

GoalStart here
Verify that your client can connectUse the connection test below.
Process files from a folder you controlRun the server over stdio with --root, so the client starts it as a subprocess.
Send uploads to a private shared serviceRun Streamable HTTP with a bearer token, bound to localhost.

Requirements

  • Node.js 20 or newer, for npx.
  • Python 3.11 or newer on the same machine. The verification engine is Python, and the npm packages provision it. Python is a current prerequisite of the engine; you do not install the server with pip.

Test your client's connection

  1. Add the setup server shown below to your client.
  2. Copy the generated prompt and paste it into the agent. The agent calls confirm_connection with the setup code.
  3. Watch for confirmation on this page. If the code expires after ten minutes, generate a fresh code.

The setup endpoint confirms connectivity. Install the full server to process financial files.

Choose an agent

Connect Claude

In Claude Code, register the server with this command. In Claude's connector settings, you can add the same URL as a custom connector.

claude mcp add --transport http openbooks-setup https://books.openlumeo.com/api/agent/mcp

1. Start the server

The server runs on demand, so there is nothing to install globally:

npx -y -p @lumeo_hq/openbooks openbooks-mcp

On first use, ask the agent to run the doctor operation. It reports whether the Python engine is available. If it is not, run the engine setup once and then check again:

npx -y @lumeo_hq/openbooks install-engine --scan

2. Connect an MCP client

Add the server with your client's command. Claude Code:

claude mcp add openbooks -- npx -y -p @lumeo_hq/openbooks openbooks-mcp

Codex:

codex mcp add openbooks -- npx -y -p @lumeo_hq/openbooks openbooks-mcp

Claude Desktop, Cursor, Cline and Gemini CLI use an mcpServers entry:

{
  "mcpServers": {
    "openbooks": {
      "command": "npx",
      "args": ["-y", "-p", "@lumeo_hq/openbooks", "openbooks-mcp"]
    }
  }
}

To let the agent read files from one folder, add --root and an absolute path to your input folder. Create a dedicated folder and put a synthetic file there for your first run.

{
  "mcpServers": {
    "openbooks": {
      "command": "npx",
      "args": ["-y", "-p", "@lumeo_hq/openbooks", "openbooks-mcp", "--root", "/absolute/path/financial-inbox"]
    }
  }
}

Restart the MCP client and check that it lists search and execute. Start with the synthetic sample; without --root the server works with the sample and inline uploads only. The MCP client may send tool responses to its model provider, so check your client's data settings before exposing financial records.

3. Discover and run operations

search returns operation names and descriptions for a keyword. For example, send {"query":"sample","details":true} to get the operation and its argument schema. Then pass named steps to execute. A step that reads records points to an earlier processing step by its ID.

OperationWhat it returns
doctorEngine status, with the install command if the engine is missing.
formatsInstalled layouts, supported extensions, engine contract and file limits.
process_sampleRelease or refusal summary for a synthetic bank CSV.
process_uploadA decision for up to 1 MiB of standard base64 file bytes.
process_fileA decision for a path relative to the --root folder. Available only with --root.
recordsA page of one collection from an earlier processing step.
documentThe full release or refusal document from an earlier processing step, subject to the response limit.

Process and inspect a statement in one call

Send these arguments to execute. It processes two versions of the sample and reads the batch balance and verification assertions in the same call.

{
  "steps": [
    { "id": "missing", "operation": "process_sample" },
    { "id": "statement", "operation": "process_sample", "arguments": { "opening": "1000.00" } },
    { "id": "balance", "operation": "records", "arguments": { "from_step": "statement", "collection": "batches" } },
    { "id": "checks", "operation": "records", "arguments": { "from_step": "statement", "collection": "assertions" } }
  ]
}

The first step is refused with a PARSE_ERROR because the opening balance is missing. The second releases the sample, and the balance record shows the closing amount. Use records with offset and limit to retrieve only the items you need. For evidence, use prefix to match a record ID such as txn-00001..

Process a local export

{
  "steps": [
    {
      "id": "bank",
      "operation": "process_file",
      "arguments": { "path": "january.csv", "currency": "INR", "opening": "1000.00", "date_order": "dmy" }
    },
    {
      "id": "rows",
      "operation": "records",
      "arguments": { "from_step": "bank", "collection": "transactions", "limit": 5 }
    }
  ]
}

One batch accepts up to eight uniquely named steps. Documents referenced by from_step are held for the current batch. Results keep the engine's exact decimal strings. A document refusal appears inside its result. An operation error such as INVALID_PATH or RESPONSE_LIMIT appears on the affected step.

Resources and prompts

The server also exposes three resources: openbooks://schema/released (the released document schema), openbooks://guide/refusals (refusal codes and fixes) and openbooks://samples/statement.csv (the synthetic sample). It provides three prompts: verify_document, explain_refusal and try_sample.

Troubleshoot a connection or tool call

SymptomCheck
The client cannot start the serverRun npx -y -p @lumeo_hq/openbooks openbooks-mcp in a terminal and confirm Node.js 20 or newer with node --version.
doctor reports the engine is missingRun npx -y @lumeo_hq/openbooks install-engine --scan and confirm Python 3.11 or newer is installed.
The client lists tools but process_file is missingStart the server with --root pointing to an existing folder.
INVALID_PATHPass a path relative to the --root folder, such as january.csv.
RESPONSE_LIMITUse records with a smaller limit instead of document.
BUSYTwo runs are already active. Retry when one finishes.
The document returns PARSE_ERRORRead the document's message and follow the refusal guide.

Limits

  • Local files read through --root can be up to 2 GiB. Text files (CSV, OFX, QFX, STA, MT940, TXT, XML) are limited to 64 MB.
  • Inline uploads through process_upload are limited to 1 MiB after base64 decoding. Use --root for larger files.
  • Each execute response is capped at 48 KiB. Page through long results with records.
  • One batch runs at most 8 steps. The server runs at most two operations at a time; a call made while both are busy returns BUSY.

See supported formats and limits for accepted extensions.

Private HTTP transport

Use Streamable HTTP for a service on one machine. Set OPENBOOKS_MCP_TOKEN to a random value of at least 32 ASCII characters, then start the server:

OPENBOOKS_MCP_TOKEN="<at least 32 ASCII characters>" npx -y -p @lumeo_hq/openbooks openbooks-mcp --http --port 8791

The server listens on localhost only. Clients send the token in an Authorization: Bearer header. To reach it from another machine, use a private SSH tunnel or an authenticated TLS gateway that you manage:

ssh -N -L 8791:127.0.0.1:8791 developer@your-vps

Keep the token in your client's secret store and never commit it to a repository.

View this page as Markdown