Skip to main content
Glama

Achlens

PyPI Python License CI

Achlens is a local-first Python MCP server and CLI for inspecting synthetic ACH files. It parses fixed-width records, validates structure and control totals, explains findings, masks sensitive fields, repairs derived controls, and generates deterministic test files. It never transmits ACH files or makes bank/network calls.

Use synthetic data only. This project is not a bank gateway, compliance advisor, or transmission system.

Quick Start

uv sync
uv run achlens --help
uv run achlens validate tests/fixtures/golden/sample_valid.ach
uv run achlens generate --sec PPD --entries 5 --seed 7 > synthetic.ach

In Windows PowerShell, use an explicit ASCII encoding because PowerShell's default > redirection can write UTF-16 output that is not valid ACH text:

uvx achlens generate --sec PPD --entries 5 --seed 7 |
	Set-Content -Encoding ascii synthetic.ach

Run the MCP server over stdio:

uv run achlens serve

Related MCP server: @validatefin/mcp

MCP Client Setup

Install the published package with uvx; it starts the server locally over stdio and does not transmit ACH files.

VS Code and Copilot

Create .vscode/mcp.json in your workspace:

{
  "servers": {
    "achlens": {
      "type": "stdio",
      "command": "uvx",
      "args": ["achlens"]
    }
  }
}

Claude Desktop

Add the following entry to the mcpServers object in Claude Desktop's MCP configuration:

{
  "achlens": {
    "command": "uvx",
    "args": ["achlens"]
  }
}

By default, MCP tools accept ACH content directly but cannot read local paths. To allow read-only access to a specific directory, set ACHLENS_ALLOWED_ROOTS in the server environment to that directory. Use synthetic ACH data only.

The MCP server exposes validation, summaries, parsed-record paging, control explanations, routing checks, code lookup, synthetic generation, and control repair. See docs/tools.md for the current tool surface.

Sensitive fields are masked by default. Configure ACHLENS_ALLOWED_ROOTS to enable MCP path inputs; otherwise provide file content directly. See SECURITY.md for the data and write boundaries.

Development

This project uses uv.

uv sync
uv run achlens --help
PYTHONPATH=. uv run pytest -q
uv run ruff check .
uv run ruff format --check .
uv run mypy --strict src

Without uv

The CLI and test suite also work with plain pip:

pip install -e . pytest
achlens --help
achlens validate tests/fixtures/golden/sample_valid.ach
achlens generate --sec PPD --entries 5 --seed 7
PYTHONPATH=. pytest

Set PYTHONPATH=. from the repository root when running tests so fixture and script imports resolve. In Windows PowerShell, use $env:PYTHONPATH = "."; pytest.

Never add real payment data, account numbers, or ACH files to this repository.

Available Tools

10 tools
check_routing_numberB

Check an ABA routing number's mathematical check digit.

Inputs: routing_number (required). Returns: object

diff_ach_files_toolB

Compare two ACH contents and return masked field-level differences.

Inputs: left_content, right_content, reveal_sensitive. Returns: object

explain_control_totalsC

Explain stated versus recomputed batch and file control totals.

Inputs: path, content, batch_number. Returns: object

generate_test_ach_fileA

Generate a balanced synthetic ACH file for testing, never transmission.

Inputs: seed, batches, sec_code, inject_errors, +6 more. Returns: object

lookup_ach_codeC

Look up a return, NOC, transaction, SEC, or service-class code.

Inputs: code (required), kind (required). Returns: object

parse_ach_fileC

Parse named ACH fields in a bounded page of records.

Inputs: path, limit, offset, content, +2 more. Returns: object

repair_control_records_toolC

Repair derived controls, returning content only in content mode.

Inputs: path, content, restore_trailing_spaces. Returns: object

server_statusA

Return the local achlens server status.

Inputs: no named parameters. Returns: object

summarize_ach_fileC

Summarize ACH structure, totals, SEC codes, returns, and NOCs.

Inputs: path, content, reveal_sensitive. Returns: object

validate_ach_fileC

Validate an ACH file and return structured findings and aggregate counts.

Inputs: path, content, rule_ids, min_severity, +1 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 10 tools

    Disambiguation4/5

    Each tool targets a distinct action or resource (validate, summarize, parse, explain, repair, diff, generate, lookup, check, status). Slight overlap exists between validate_ach_file, summarize_ach_file, and explain_control_totals regarding control totals, but their outputs and purposes are clearly differentiated by description.

    Naming Consistency4/5

    Most names follow a consistent verb_noun snake_case pattern (e.g., validate_ach_file, parse_ach_file, check_routing_number). Two tools break this with a '_tool' suffix (repair_control_records_tool, diff_ach_files_tool), and server_status uses a noun_noun form, but overall the set is predictable.

    Tool Count5/5

    10 tools is well within the ideal range for this domain. Each tool addresses a specific need—validation, parsing, summarization, code lookup, generation, repair, diff, and status—without redundancy or bloat.

    Completeness4/5

    The surface covers core ACH file operations: validation, parsing, summarization, control total explanation, code lookup, routing checks, test file generation, control repair, and diffing. Minor gaps exist for broader file editing or production file creation, but these may be outside the intended scope.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      A local-first MCP server for financial wire message forensics, providing read-only tools to parse, validate, and detect SR2026 address compliance in ISO 8583, SWIFT MT, and ISO 20022 messages.
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      Parses NACHA/ACH files into structured JSON and summaries, performing structural and arithmetic validation with IAT support, enabling automated file inspection and validation through MCP clients.
      2
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to explain, scrub and check ISO 20022 payment messages and SSI files entirely on the local machine, including CBPR+ readiness hints, lifecycle triage, IBAN/BIC validation and payment-vs-SSI checks against the user's own licensed reference data. Runs as a local stdio MCP server with no network calls, telemetry or bundled vendor data.
      MIT