
jPOS MCP Server
io.github.mohisyed由 GitHub 账号 mohisyed 发布v0.1.1更新于 Oct 24, 2026
MCP server for jPOS and ISO 8583. Deterministic payment protocol tools for AI agents.
概览
本地 MCP 服务器,为 AI 助手提供确定性的 jPOS 与 ISO 8583 参考工具:字段规范、MTI 解码、packager XML 生成、部署描述符校验、报文校验和文档检索。
- 可以做什么
- 查询 ISO 8583 字段规范,并将 MTI 解码为版本、类别、功能和来源及预期响应
- 适用场景
- 适合在使用 jPOS 或 ISO 8583 处理支付报文时使用,让助手引用经过核实的字段与 packager 信息,而不是猜测类名或翻阅编程指南。
- 运行要求
- 本机需 Python 3.11+ 和 uv 包管理器;可通过 uvx 或克隆仓库运行。可选的 search_jpos 工具需要先下载 jPOS 编程指南 PDF 并运行摄取脚本构建知识库,该过程会下载嵌入模型。无需凭据或 API 密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 jPOS MCP Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
jPOS MCP Server
mcp-name: io.github.mohisyed/jpos-mcp-server
The first open-source MCP server for jPOS and ISO 8583.
[License: MIT] [Python 3.11+] [Tests] [Coverage]
Claude validating a real ISO 8583 financial transaction request using deterministic tools. No guessing — every answer comes from verified data.
An MCP server that gives AI agents (Claude, Cursor, VS Code Copilot) deterministic, verified access to ISO 8583 field specs, MTI decoding, jPOS packager XML generation, deploy descriptor validation, message building, and jPOS documentation search.
No more guessing packager class names. No more scrolling a 300-page PDF. Call a tool, get the right answer.
Table of Contents
- Quickstart
- Tools
- Architecture
- Testing
- Knowledge Base (RAG)
- Docker
- Claude Desktop Setup
- MCP Inspector
- Security
- Troubleshooting
- Roadmap
- Contributing
Quickstart
Prerequisites: Python 3.11+ and uv package manager.
All 6 tools work immediately after step 1. Step 2 enables the search_jpos RAG tool with real documentation.
Tools
Why deterministic tools instead of LLM inference?
LLMs can guess that field 35 uses IFA_LLVAR, but they sometimes hallucinate class names like IFA_LLTRACK2 (doesn't exist). Our tools read from data/iso_fields.json — a verified lookup table — so the answer is always correct. The AI decides which tool to call; our code provides the facts.
Architecture
Sub-server composition
The server is split into 4 domain-specific sub-servers mounted via FastMCP.mount(). Each sub-server is independently testable — a bug in the RAG pipeline doesn't prevent ISO field lookups from working. Adding a new domain is one file + one mount() call in main.py.
Timeout guardrails
Every tool is wrapped with @with_timeout() using asyncio.wait_for(). If a tool hangs (e.g., ChromaDB cold start), it returns a structured error dict instead of blocking the entire MCP server. Timeout tiers:
Testing
Why we test
Payment systems have zero tolerance for wrong answers. A bad packager class name (IFA_LLVAR vs IFB_LLHEX) causes cryptic byte-level parsing errors that take hours to debug. Our tests verify that every tool returns correct, deterministic results across all input types.
Running tests
Test structure (114 tests, 3 layers)
Writing new tests
When adding a tool, cover three categories:
- Happy path — valid input returns expected output
- Invalid input — bad types, out-of-range values, malformed data return structured errors
- Edge cases — boundary values, empty inputs, PCI-sensitive data
All tools are async def, so use @pytest.mark.asyncio:
Knowledge Base (RAG)
The search_jpos tool uses two-stage hybrid retrieval over jPOS documentation: a bi-encoder (mpnet) for fast candidate retrieval, followed by a cross-encoder reranker for high-precision ordering.
How it works
- Ingestion — PDFs and markdown files are cleaned (boilerplate, TOC dot-leaders, page headers stripped) and split into 200-word chunks with 40-word overlap. Low-signal chunks are filtered out at ingest time.
- Embedding — Each chunk is encoded into a 768-dimensional vector using
all-mpnet-base-v2and stored in ChromaDB. - Query expansion — Short or jargon-heavy queries (e.g. "STAN", "IFB_LLHEX") get domain context added before embedding so the model has enough signal to disambiguate.
- Stage 1 retrieval — Top 25 candidates fetched via cosine similarity.
- Stage 2 rerank — Cross-encoder (
ms-marco-MiniLM-L-6-v2) scores each(query, chunk)pair by attending across both inputs. This is significantly more accurate than cosine alone. - Display score — Combination of cross-encoder + cosine + rank-position bonus, returned as the top 5 chunks.
The cross-encoder loads lazily on first call (~1s). Falls back to keyword-overlap reranking if the model can't load (offline environments).
Setting up the knowledge base
The ingest script processes:
- PDFs from
knowledge/sources/*.pdf— page-by-page chunking with cleanup - Markdown from
docs/*.md— section-aware chunking (splits on##headings) - Markdown from
knowledge/sources/*.md— for any additional docs you add
Ingestion is idempotent — running it again skips existing chunks and only adds new ones.
Default knowledge base after a full ingest: ~786 chunks across the jPOS Programmer's Guide, ISO 8583-1:2003 spec, Wikipedia reference, jPOS tutorial pages, and project docs.
Adding your own documents
Drop any .pdf or .md files into knowledge/sources/ and re-run:
Good candidates:
- ISO 8583 reference guides
- Your organization's interchange spec documentation
- jPOS tutorial pages (save as markdown)
- GenericPackager XML examples with annotations
Search quality
Scores are calibrated for the cross-encoder + mpnet pipeline:
Benchmark across 25 representative queries: 0.886 average score, 100% strong results.
Docker
Build and run
Docker architecture
- Base image:
python:3.11-slim - Embedding model pre-downloaded at build time (avoids 30-60s cold start)
- Non-root user (
appuser:1001) for security - Persistent volume for ChromaDB data (survives container restarts)
- Healthcheck every 30s on
/health
Claude Desktop with Docker
Claude Desktop Setup
macOS
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
Windows
Edit %APPDATA%\Claude\claude_desktop_config.json:
After saving, restart Claude Desktop. All tools appear in the hammer (tools) menu.
Verifying it works
Ask Claude: "What's the jPOS packager class for field 35?"
Claude should call lookup_field(35) and return the exact spec — IFA_LLVAR for ASCII, IFB_LLHEX for BCD — not a guess.
MCP Inspector
The MCP Inspector is a browser-based UI for testing tools interactively:
This opens a browser at http://localhost:6274 where you can:
- See all registered tools and their JSON Schema
- Call any tool with custom inputs
- Inspect responses in real time
- Debug tool errors without needing Claude Desktop
Security
This server is designed with PCI DSS awareness:
- Real PANs are rejected — The Luhn algorithm detects real card numbers in any tool input. Only test PANs (
4111111111111111,5500005555555559, etc.) are accepted. This runs before any other processing. - Sensitive fields redacted from logs —
PaymentSafeFormatterstrips fields 2 (PAN), 35 (Track 2), 45 (Track 1), 52 (PIN), 55 (EMV), and 64 (MAC) from all log output. - stderr-only logging — stdout is reserved for the JSON-RPC stream (stdio transport). A single
print()would corrupt the protocol. - Non-root Docker — Container runs as
appuser:1001. - No credentials — The server stores no keys, tokens, or secrets.
- Pinned dependencies —
fastmcp==3.1.1exact pin prevents supply chain surprises. - Hardcoded tool descriptions — Tool descriptions are in Python decorators, never loaded from external data (prevents injection).
What must never pass through this server
Troubleshooting
ModuleNotFoundError: No module named 'fastmcp'
Dependencies aren't installed. Run:
search_jpos returns "Knowledge base not initialized"
ChromaDB hasn't been populated. Run:
Claude Desktop doesn't show tools
- Check that
cwdinclaude_desktop_config.jsonis an absolute path - Make sure
uvis in your PATH (try runninguv --versionin terminal) - Restart Claude Desktop completely (quit + reopen, not just close window)
Tests fail with import errors
Make sure you installed dev dependencies:
print() broke the stdio transport
Any stdout output corrupts JSON-RPC. Find and remove print() statements. Use logging.getLogger(__name__).info() instead — it writes to stderr.
Timeout errors on search_jpos
First call after startup can take 5-10s (ChromaDB + embedding model cold start). The 15s timeout accommodates this. If it persists, check that knowledge/chroma_db/ exists and has data.
Roadmap
- V1 — MVP — 6 tools, Claude Desktop, Docker, 114 tests (91% coverage), cross-encoder reranked RAG, GitHub Actions CI/security, issue templates, SECURITY.md
- V2 — Enhanced — Java sidecar (live pack/unpack), custom interchange specs, jPOS log parser, OAuth 2.1, PyPI package, MCP registry submission
- V3 — Platform — Hosted deployment, multi-spec (Visa/MC/Amex/Discover), horizontal scaling, transaction analytics
See docs/roadmap-and-architecture.md for full details.
Contributing
See CONTRIBUTING.md for setup instructions and guidelines.
License
来源:README.md,提交 f2321bf
工具
0版本历史
1- v0.1.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分