Ledger MCP Server

Ledger MCP Server

Enables querying personal finance reports (merchant spending, largest expenses) and performing currency conversion via a local SQLite database.

Category
Visit Server

README

Ledger

A small personal finance ledger for importing Revolut CSV exports into SQLite, running spending reports, and exposing ledger/currency utilities over MCP.

What It Does

  • Imports Revolut CSV rows into a normalized ledger_entries table.
  • Stores ledger data in a local SQLite database.
  • Generates JSON reports for merchant spending and largest expenses.
  • Provides an MCP stdio server with ledger report tools and currency conversion.
  • Uses TypeScript, Vitest, oxlint, and oxfmt for development checks.

Requirements

  • Node.js >=22.18
  • npm

Setup

npm install

Initialize the default local database at data/ledger.sqlite:

npm run db:init

You can pass a custom database path directly to the underlying CLI:

node src/cli/init-db.ts path/to/ledger.sqlite

Import Revolut Data

Inspect a Revolut CSV export before importing:

npm run inspect:revolut -- path/to/revolut.csv

Import rows into the default database:

npm run import:revolut -- path/to/revolut.csv

Import into a custom database:

npm run import:revolut -- path/to/revolut.csv path/to/ledger.sqlite

Imports are idempotent per source file and source row. Duplicate rows are skipped using the database uniqueness constraint.

Reports

Find monthly spending for a merchant:

npm run report:monthly-merchant -- "Merchant Name"

Find the month with the most posted card payments for a merchant:

npm run report:busiest-merchant-month -- "Merchant Name"

Find the largest expense, optionally filtered:

npm run report:largest-expense -- --merchant "Merchant Name"
npm run report:largest-expense -- --date-from 2026-01-01 --date-to 2026-01-31
npm run report:largest-expense -- --time-from 12:00 --time-to 14:00

All report commands print JSON.

MCP Server

Start the stdio MCP server:

npm run mcp:server

By default, the server reads from data/ledger.sqlite. Set LEDGER_DB_PATH to point at another database:

LEDGER_DB_PATH=path/to/ledger.sqlite npm run mcp:server

Available MCP tools:

  • find_busiest_merchant_month
  • find_largest_expense
  • find_total_merchant_spending
  • convert_currency

Smoke-test the MCP clients:

npm run mcp:smoke

Development

Run the full check suite:

npm run check

Run individual checks:

npm run typecheck
npm test
npm run lint
npm run format:check

Format and lint-fix locally:

npm run format
npm run lint:fix

Project Layout

src/agent/          Local agent/MCP chat helpers
src/cli/            Command-line entry points
src/domain/         Core ledger, money, date, time, and currency types
src/exchange-rates/ NBP exchange-rate integration
src/importers/      Source-specific importers, currently Revolut
src/mcp/            MCP server and smoke clients
src/presentation/   Formatting helpers
src/reports/        Report queries and calculations
src/storage/        SQLite setup and persistence helpers
src/tools/          MCP tool implementations

Notes

  • Currency support is currently limited to PLN, CHF, and EUR.
  • Currency conversion uses the latest NBP table A average exchange rates.
  • The SQLite database is local; keep personal export files and database files out of version control.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured