Generate and validate ISO 20022 Exceptions & Investigations (E&I) camt messages -- starting with camt.056 FI-to-FI Payment Cancellation Request -- with an MCP server.
Project description
camt-exceptions: ISO 20022 Exceptions & Investigations, generated + XSD-valid
Generate and validate ISO 20022 Exceptions & Investigations (E&I) camt
messages — with an MCP server. Starts with camt.056 (FI-to-FI
Payment Cancellation Request): the message a bank sends to recall or cancel a
payment it already dispatched — a duplicate, an erroneous amount, a fraud
recall. Output is validated against the official bundled XSD before it's
returned.
Latest release: v0.0.1 —
camt.056.001.12generation + validation, 4 MCP tools over stdio, 100% branch coverage, for Python 3.10+. Part of the ISO 20022 MCP suite. Additional E&I messages (camt.029, camt.026, camt.027, camt.087) plug into the same engine.
Why E&I
When a payment goes wrong, the fix is an Exceptions & Investigations message —
and these are the least tooled corner of ISO 20022. camt.056 alone covers
the single most common need: "I need to cancel/recall that payment." This
library makes it a one-call, schema-valid operation for an agent, with the same
depth as the credit-transfer generators elsewhere in the suite.
Install
pip install camt-exceptions
# or run the MCP server without installing:
uvx camt-exceptions
MCP client config (e.g. Claude Desktop):
{
"mcpServers": {
"camt-exceptions": {
"command": "camt-exceptions-mcp"
}
}
}
Quick start — cancel a payment
from camt_exceptions import generator as g
xml = g.generate_message("camt.056.001.12", {
"assignment_id": "CXL-001",
"assigner_agent_bic": "DEUTDEFF",
"assignee_agent_bic": "COBADEFF",
"creation_date_time": "2026-03-02T10:00:00",
"original_msg_id": "MSG-ORIG-001",
"original_msg_nm_id": "pacs.008.001.08",
"transactions": [{
"original_end_to_end_id": "E2E-001",
"original_interbank_settlement_amount": "1000.00",
"original_interbank_settlement_currency": "EUR",
"cancellation_reason_cd": "DUPL", # duplicate payment
}],
})
assert g.validate_xml("camt.056.001.12", xml)["is_valid"] # True
Tools
| Tool | What it does |
|---|---|
list_message_types |
List supported E&I message types and names. |
get_required_fields |
Required top-level fields for a message type. |
generate_message |
Generate a validated E&I XML message from a record (validated against the bundled XSD before return). |
validate_xml |
Validate raw XML against a message type's bundled XSD. |
Supported messages
| Message | Name | Status |
|---|---|---|
camt.056.001.12 |
FI to FI Payment Cancellation Request | ✅ |
camt.029 |
Resolution of Investigation | planned |
camt.026 |
Unable to Apply | planned |
camt.027 |
Claim Non-Receipt | planned |
camt.087 |
Request to Modify Payment | planned |
Each new message plugs into the same engine: bundle its official XSD +
template.xml and register it in MESSAGE_TYPES. Generated output is always
XSD-validated before return, so correctness is machine-checked, not asserted.
Note: the payment-status and return messages of the E&I family —
pacs.002(Payment Status Report) andpacs.004(Payment Return) — are already generated, XSD-valid, bypacs008-mcp.
The suite
Part of a family of vendor-neutral, Python-native ISO 20022 MCP servers:
iso20022-mcp— unified gateway across the families.pain001-mcp·pacs008-mcp·camt053-mcp·acmt001-mcp— per-family servers.reconcile-mcp— statement/payment reconciliation.
Development
git clone https://github.com/sebastienrousseau/camt-exceptions
cd camt-exceptions
python -m venv .venv && . .venv/bin/activate
pip install -e . && pip install pytest pytest-cov ruff black mypy
pytest # 100% branch coverage gate; output is XSD-validated
ruff check camt_exceptions tests && black --check camt_exceptions tests && mypy camt_exceptions
Licence
Code licensed under the Apache License, Version 2.0. Bundled ISO
20022 message schemas (*.xsd) are © ISO 20022 and redistributed under the
ISO 20022 terms; they are the same schemas published at
iso20022.org.
mcp-name: io.github.sebastienrousseau/camt-exceptions
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file camt_exceptions-0.0.1.tar.gz.
File metadata
- Download URL: camt_exceptions-0.0.1.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
712a227723de4a7be53f1e5de0732d12f30a0d3509a6a9d3b9f115ab2638de31
|
|
| MD5 |
e3d3b642ba80da998530fd936b3f2749
|
|
| BLAKE2b-256 |
0b6f7841c5dce3e52f6c819fd1afab9014433bc70310eba2a1e0080a1959b368
|
Provenance
The following attestation bundles were made for camt_exceptions-0.0.1.tar.gz:
Publisher:
release.yml on sebastienrousseau/camt-exceptions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
camt_exceptions-0.0.1.tar.gz -
Subject digest:
712a227723de4a7be53f1e5de0732d12f30a0d3509a6a9d3b9f115ab2638de31 - Sigstore transparency entry: 2153808614
- Sigstore integration time:
-
Permalink:
sebastienrousseau/camt-exceptions@a94408d7af1cc2114bfb94584e79ad6b8d8d284c -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/sebastienrousseau
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a94408d7af1cc2114bfb94584e79ad6b8d8d284c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file camt_exceptions-0.0.1-py3-none-any.whl.
File metadata
- Download URL: camt_exceptions-0.0.1-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f188b75946d9129dc256a03edda68d76339fd5bc50f9ebb293369eb10c3a4569
|
|
| MD5 |
c879c63229fc188a3883f108d0696680
|
|
| BLAKE2b-256 |
c3698b659d3a19e76d27cadb741e3830a6bbe4fcf2d154994ae3f5af35792a4d
|
Provenance
The following attestation bundles were made for camt_exceptions-0.0.1-py3-none-any.whl:
Publisher:
release.yml on sebastienrousseau/camt-exceptions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
camt_exceptions-0.0.1-py3-none-any.whl -
Subject digest:
f188b75946d9129dc256a03edda68d76339fd5bc50f9ebb293369eb10c3a4569 - Sigstore transparency entry: 2153808629
- Sigstore integration time:
-
Permalink:
sebastienrousseau/camt-exceptions@a94408d7af1cc2114bfb94584e79ad6b8d8d284c -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/sebastienrousseau
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a94408d7af1cc2114bfb94584e79ad6b8d8d284c -
Trigger Event:
workflow_dispatch
-
Statement type: