Skip to main content
Glama
heocoi

edi-mcp

by heocoi

edi-mcp

Let AI agents read, validate and acknowledge EDI documents.

An MCP (Model Context Protocol) server that parses raw X12 and EDIFACT interchanges into structured JSON, validates envelope integrity, produces plain-language summaries, and generates 997 Functional Acknowledgments. Zero runtime dependencies beyond the MCP SDK - the tokenizer is hand-rolled and reads delimiters from the wire, the way real-world files demand.

Works with Claude (Desktop, Code, API), Cursor, and any MCP-compatible client.

Why

EDI predates JSON by decades and still moves most B2B commerce: purchase orders (850/ORDERS), invoices (810/INVOIC), ship notices (856). None of it is reachable by no-code AI connectors - there is no REST API to point Zapier at, just structured text flowing over AS2/SFTP. This server gives an AI agent eyes on that traffic:

  • "Summarize the PO that just landed in the inbox folder"

  • "Does this 810 match the PO number and line totals we sent?"

  • "Draft the 997 acknowledgment for this interchange"

Related MCP server: InvoiceXML

Tools

Tool

What it does

parse_edi

Raw X12/EDIFACT (auto-detected) → structured JSON: envelope, groups, transactions, segments

validate_edi

Envelope integrity: control number agreement (ISA/IEA, GS/GE, ST/SE, UNB/UNZ, UNH/UNT) + declared counts

summarize_edi

Plain-language business summary. Deep support: X12 850/810/856, EDIFACT ORDERS/INVOIC. Other types get a segment inventory

generate_997_ack

X12 997 Functional Acknowledgment answering an interchange, sender/receiver swapped, AK2/AK5 per transaction

Quick start

git clone https://github.com/heocoi/edi-mcp.git
cd edi-mcp
npm install && npm run build

Claude Code:

claude mcp add edi -- node /path/to/edi-mcp/dist/index.js

Claude Desktop (claude_desktop_config.json):

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

Then try: "Parse samples/850-purchase-order.edi and tell me the PO number, ship-to address and order value."

Example

Input (X12 850, abbreviated):

ISA*00*...*ZZ*ACMECORP*ZZ*WIDGETSUPPLY*260719*1030*U*00401*000000101*0*P*>~
GS*PO*ACMECORP*WIDGETSUPPLY*20260719*1030*101*X*004010~
ST*850*0001~
BEG*00*SA*PO-2026-4521**20260719~
PO1*1*48*EA*9.75**VP*WS-4417*UP*012345678905~
...

summarize_edi output:

X12 interchange 000000101 - ACMECORP → WIDGETSUPPLY, dated 2026-07-19

## 850 Purchase Order (control 0001)
- Purchase Order PO-2026-4521 dated 2026-07-19 (type SA)
- Ship-to: Acme Corp Warehouse 7
- Line 1: 48 EA @ 9.75 - VP WS-4417, UP 012345678905
- Line 2: 12 CS @ 142.00 - VP WS-9902
- Computed order value: 2172.00
- CTT declares 2 line item(s)

Design notes

  • Delimiters come from the wire, not from config. X12 delimiters are read from the ISA segment itself; EDIFACT service characters from UNA when present, standard defaults otherwise. EDIFACT release-character escaping (?+ → literal +) is honored.

  • Lenient parse, strict validate. parse_edi recovers what it can and reports anomalies as warnings; validate_edi is the strict pass. Real-world EDI is messy - a parser that throws on the first oddity is useless for triage.

  • Acknowledgment policy is explicit. decideAckStatus() in src/ack997.ts maps validation results to A/E/R. Default: clean → A, structural errors → R. Trading partner agreements differ; the policy is one small function on purpose.

Scope and roadmap

Current scope is read/triage/acknowledge - the 80% of daily EDI pain that needs no certification. Not yet included: 999 Implementation Acknowledgment, transaction-set-level schema validation (dictionaries per version), generating outbound 810/856, AS2 transport. Tracking the MCP 2026-07-28 spec revision.

Custom integrations

I build custom MCP servers for systems that no off-the-shelf connector covers: legacy ERPs, proprietary internal tools, SOAP/EDI/flat-file pipelines. If your business runs on a system your AI tools can't see, reach out: anhphong.pham@gmail.com · anhphong.dev

License

MIT

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    Enables AI agents to extract structured JSON from invoices and receipts in PDF and image formats using Claude Vision. Supports full document parsing, line item extraction, validation, and batch CSV export with API key or cryptocurrency payment options.
    MIT
  • A
    license
    -
    quality
    B
    maintenance
    InvoiceXML brings e-invoice compliance to your AI agent. Create, validate, convert, render, and extract structured invoices across UBL (Peppol BIS Billing 3.0, used worldwide), CII, Factur-X, ZUGFeRD, and XRechnung, all checked against the EN 16931 standard and official Schematron rules. Ask your assistant to generate a compliant invoice, validate one for errors, or convert between formats, with n
    5
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    Enables AI assistants to parse and analyze mortgage documents (Loan Estimates & Closing Disclosures), converting them into structured MISMO-compliant JSON and checking for TRID compliance violations.
    2
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/heocoi/edi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server