Lekha API

v0.1.0
io.github.backstab319/lekha-mcp Checked 1 day ago Published 6 days ago

Parse Indian bank statement PDFs into balance-checked transactions (Kotak, SBI, Indian Bank, more).

An MCP server for Lekha API. It lets Claude, Cursor, VS Code, Gemini CLI, Codex and other MCP clients turn Indian bank statement PDFs on your computer into transactions: dates, debits, credits and balances, checked against the running balance. One credit is one PDF page, charged only when parsing succeeds. Supported: Kotak Mahindra Bank, Indian Bank, State Bank of India, and other banks through a generic reader that answers only when every balance adds up. 1. Sign in at lekhaapi.com (new accounts get 50 free pages) and copy an API key from the dashboard. 2.

Summary extracted from the README.

lekha-mcp

An MCP server for Lekha API. It lets Claude, Cursor, VS Code, Gemini CLI, Codex and other MCP clients turn Indian bank statement PDFs on your computer into transactions: dates, debits, credits and balances, checked against the running balance.

Ask things like:

  • "Convert ~/Downloads/kotak-april.pdf to a CSV in the same folder."
  • "Parse these three SBI statements (password ABCD0101) and total the UPI debits per month."
  • "How many Lekha credits do I have left?"

Tools

Tool What it does
parse_statement(pdf_path, password?, save_to?) Reads the PDF from disk, sends it to Lekha API and returns the statement. save_to writes .csv (transactions) or .json (everything). Statements over 100 transactions are saved beside the PDF as <name>.lekha.json and the reply has a summary.
get_credits() Credits left on your account. Free.

One credit is one PDF page, charged only when parsing succeeds. Supported: Kotak Mahindra Bank, Indian Bank, State Bank of India, and other banks through a generic reader that answers only when every balance adds up.

Setup

  1. Sign in at lekhaapi.com (new accounts get 50 free pages) and copy an API key from the dashboard.
  2. Install uv if you don't have it (uvx comes with it).
  3. Add the server to your client, replacing your-key:

Claude Code

claude mcp add lekha --env LEKHA_KEY=your-key -- uvx lekha-mcp

Claude Desktop (claude_desktop_config.json), Cursor (~/.cursor/mcp.json), Gemini CLI (~/.gemini/settings.json), Windsurf:

{
  "mcpServers": {
    "lekha": {
      "command": "uvx",
      "args": ["lekha-mcp"],
      "env": { "LEKHA_KEY": "your-key" }
    }
  }
}

VS Code (.vscode/mcp.json):

{
  "servers": {
    "lekha": {
      "type": "stdio",
      "command": "uvx",
      "args": ["lekha-mcp"],
      "env": { "LEKHA_KEY": "your-key" }
    }
  }
}

Codex CLI (~/.codex/config.toml):

[mcp_servers.lekha]
command = "uvx"
args = ["lekha-mcp"]
env = { LEKHA_KEY = "your-key" }

The key sits in that config file, so don't commit it. LEKHA_BASE_URL overrides the API address (default https://lekhaapi.com).

Privacy

The PDF is read on your computer and sent only to Lekha API, which processes it in memory and stores nothing. The parsed result goes back to your AI client, so it becomes part of that conversation and is handled under your AI provider's terms. PDF passwords you give the assistant are sent once to open the file and never stored.

Docs: lekhaapi.com/api-docs · Support: support@lekhaapi.com