Skip to main content
Glama
msuresh007

nacha-mcp

by msuresh007

nacha-mcp

Сервер MCP (Model Context Protocol) для разбора и проверки файлов NACHA/ACH.

Требования

  • Node.js 18 или новее

  • npm

Related MCP server: @validatefin/mcp

Установка

git clone https://github.com/msuresh007/nacha-mcp.git
cd nacha-mcp
npm install
npm run build

Это компилирует src/ в dist/. Повторно запускайте npm run build после получения любых обновлений.

Попробуйте

Небольшой арифметически корректный пример файла включён в examples/sample.ach. После сборки вы можете запустить любой из инструментов напрямую из командной строки без MCP-клиента, чтобы убедиться, что всё работает:

node -e "const {analyzeNachaFile}=require('./dist/analyze.js');const fs=require('fs');console.log(JSON.stringify(analyzeNachaFile(fs.readFileSync('examples/sample.ach','utf-8')),null,2))"

Вы должны увидеть "valid": true с пустым массивом issues, один batch и одну запись.

Инструменты

  • parse_nacha_file — Разбирает файл NACHA по указанному пути в полный структурированный JSON: заголовок файла, batch'и (заголовок, записи с addenda, контроль), и контроль файла.

  • summarize_nacha_file — Разбирает файл NACHA и возвращает сжатое резюме: количество batch'ей, общее количество записей, общие суммы дебета/кредита, присутствующие коды SEC и проблемы валидации.

Оба инструмента принимают один входной параметр, file_path, — абсолютный путь к файлу на диске.

Разбор включает:

  • Структурную валидацию (длина записи, порядок типов записей, сопоставление заголовка/контроля batch'а).

  • Арифметическую валидацию — хэш записей, итоги дебета/кредита и количество записей/addenda пересчитываются на основе фактических записей и сверяются с объявленными значениями Batch Control и File Control. Несоответствия сообщаются как проблемы валидации, а не молча принимаются.

  • Batch'и IAT (International ACH Transaction) и коды типов addenda 10-18.

Запуск в автономном режиме

npm start

Сервер общается через stdio по протоколу MCP; он не предназначен для интерактивного запуска сам по себе. Используйте его через MCP-клиент, как описано ниже.

Подключение к Claude Code

Из каталога проекта, после сборки:

claude mcp add nacha -- node "$(pwd)/dist/index.js"

(В Windows PowerShell: claude mcp add nacha -- node "$PWD\dist\index.js")

Подключение к GitHub Copilot (VS Code)

Создайте .vscode/mcp.json в проекте, в котором вы хотите его использовать (или добавьте в него, если он уже существует), заменив путь на абсолютный путь к вашему клону этого репозитория:

{
  "servers": {
    "nacha": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/nacha-mcp/dist/index.js"]
    }
  }
}

В качестве альтернативы запустите MCP: Add Server из палитры команд (Ctrl+Shift+P / ⇧⌘P), выберите Workspace и укажите node с теми же аргументами — VS Code сам запишет тот же .vscode/mcp.json для вас.

После сохранения откройте Copilot Chat, переключитесь в режим Agent, и инструменты parse_nacha_file / summarize_nacha_file будут доступны (VS Code запускает сервер по требованию).

Подключение к Claude Desktop или другому MCP-клиенту

Добавьте запись в конфигурацию MCP-сервера клиента (например, claude_desktop_config.json), заменив путь на абсолютный путь к вашему клону этого репозитория:

{
  "mcpServers": {
    "nacha": {
      "command": "node",
      "args": ["/absolute/path/to/nacha-mcp/dist/index.js"]
    }
  }
}

Перезапустите клиент после добавления конфигурации.

Структура проекта

  • src/constants.ts — коды SEC, коды транзакций, справочники стран/валют ISO.

  • src/format.ts — разбор полей денег/даты/времени.

  • src/parser.ts — структурная валидация и разбор записей (файл/batch/запись/addenda).

  • src/validate.ts — арифметическая валидация (хэши, итоги, количества).

  • src/analyze.ts — объединяет разбор и арифметическую валидацию.

  • src/summarize.ts — сжатое резюме.

  • src/index.ts — MCP-сервер и регистрация инструментов.

Модульные тесты намеренно не включены — предполагается, что это останется небольшим и легко проверяемым сервером.

Лицензия

MIT — см. LICENSE.

Available Tools

2 tools
parse_nacha_fileParse NACHA/ACH fileA

Parses a NACHA (ACH) fixed-width file into structured JSON: file header, batches (header, entries with addenda, control), and file control. Validates record structure and cross-checks entry hashes, debit/credit totals, and record counts, reporting any mismatches as issues.

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the NACHA/ACH file on disk.

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden. It discloses validation behavior well: cross-checking record counts, hashes, and debit/credit totals, and reporting mismatches as 'issues'. It could add a bit more about error behavior for unreadable or malformed files, but the existing detail is substantial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tight sentences, each carrying essential information: the first defines the output structure, the second the validation behavior. It is front-loaded with the core action and resource. No filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given one parameter, no annotations, and no output schema, the description is remarkably complete: it lists the CSV JSON composition, the validation checks, and the reporting of issues. An agent can confidently call the tool knowing what input to provide and what to do with the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There is only one parameter and its schema description is 100% complete ('Absolute path to the NACHA/ACH file on disk'). The tool description does not add anything about the parameter beyond the schema, but with full schema coverage the baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Parses') and resource ('NACHA/ACH fixed-width file') and names the output structure explicitly (file header, batches, control). It also distinguishes itself from sibling summarize_nacha_file by emphasizing structured JSON extraction plus validation rather than summarization.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description conveys the natural use case—get structured JSON from a NACHA file—but it does not explicitly contrast with summarize_nacha_file or state when the agent should choose parsing over summarizing. Usage context is implied clearly by the verb and output, but there is no explicit when/when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

summarize_nacha_fileSummarize NACHA/ACH fileA

Parses a NACHA (ACH) file and returns a condensed summary: batch count, total entries, total debit/credit amounts, SEC codes present, and validation issues, without dumping every field of every record.

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the NACHA/ACH file on disk.

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full safety burden. It clearly states it parses and returns a summary, implying a read-only operation, and notes that it reports validation issues. However, it does not explicitly state side-effect-free behavior or potential error conditions on malformed files.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, tightly packed sentence that front-loads the verb and resource, then enumerates specific output elements. No wasted words, and the critical exclusion is stated compactly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter tool with no output schema, the description adequately specifies its return content with field-level detail. It falls just short of being fully complete by not describing the result structure or behavior on invalid files, though those gaps are minor.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the single file_path parameter is well-documented in the schema. The description does not add meaning beyond the schema, which is fine at the baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('Parses... and returns') and explicitly lists the summary contents: batch count, total entries, total debit/credit amounts, SEC codes, and validation issues. The phrase 'without dumping every field of every record' clearly differentiates it from the sibling parse_nacha_file.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly frames when to use this tool: when a condensed summary is desired rather than full record-level detail. The contrast 'without dumping every field' effectively communicates the when-not and implicitly routes to the sibling for detailed extraction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 2 tool updatesv0.1.0
    • First observedparse_nacha_file
    • First observedsummarize_nacha_file

TDQS

A4.2/5.0

Scored across 2 tools

Disambiguation4/5

The two tools have clearly different outputs—one returns the full parsed structure and one returns a condensed summary—so an agent can pick based on response size. There is mild overlap because both parse the file, but the naming and descriptions sufficiently differentiate their purposes.

Naming Consistency5/5

Both tool names follow the same verb_noun_file pattern: parse_nacha_file and summarize_nacha_file. The naming is predictable, consistent, and accurately reflects the intent of each tool.

Tool Count4/5

With only two tools, the server is intentionally narrow, but both tools serve a clear and distinct purpose for NACHA file handling. The count is slightly thin but not inappropriate given the focused read-only scope.

Completeness4/5

For a server focused on reading and validating NACHA files, the surface covers the essential workflows: full detailed parsing and condensed summarization. It could benefit from additional capabilities like file creation or export, but those seem outside its apparent scope.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Let AI agents read, validate and acknowledge EDI documents. Parses raw X12 and EDIFACT interchanges into structured JSON, validates envelope integrity, produces plain-language summaries, and generates 997 Functional Acknowledgments.
    4
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to parse, validate, summarize, and convert X12 EDI documents (such as 850 purchase orders and 810 invoices) into structured JSON through callable MCP tools.
    -
  • F
    license
    B
    quality
    A
    maintenance
    Enables local inspection of synthetic ACH files by parsing fixed-width records, validating structure and control totals, explaining findings, masking sensitive fields, repairing derived controls, and generating deterministic test files. All work happens on-device with no bank or network transmission.
    10
    -