edi-mcp
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.
README
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"
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_edirecovers what it can and reports anomalies as warnings;validate_ediis 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()insrc/ack997.tsmaps 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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。