structured-address-fix-mcp
structured-address-fix-mcp exposes ISO 20022 postal-address classification, assessment, and remediation as 13 MCP tools for AI agents.
Discover policies — list available address rulebooks (e.g.
cbpr-2026,sepa,hvps-plus,generic-structured) with tiers vialist_policies.Classify addresses — determine whether a postal address is structured, hybrid, or unstructured (
classify_address).Assess compliance — score a single address (
assess_address) or every addressed party in a pacs.008/pain.001 message (assess_message) against a policy, with datedas_ofandcountry_hintoptions.Remediate — propose the compliant form of an address (
remediate_address) or an entire message (remediate_message, with optionalapplyto return patched XML), with before/after and confidence-scored patch operations.Dry-run patches — preview the operations remediation would apply to a message without changing it (
preview_patch).Explain findings — decode finding codes such as
SAF001and how to resolve them (explain_finding).Check the cutover — report the binding structured-address date and the scheme that sets it (
get_cutover_date; currently deferred, date is null).Normalize country codes — resolve names, endonyms, aliases, and 2/3-letter codes to ISO 3166-1 alpha-2 (
normalize_country_code).Split street lines — separate street name, building, and sub-building, handling leading- and trailing-number conventions (
split_street_and_building).Validate postcodes — check an address's
post_codeagainst US, GB, DE, FR, or JP format policies (validate_postal_policy).Parse free text — convert an unstructured address into ISO 20022 fields (StrtNm, BldgNb, PstCd, TwnNm, Ctry) using libpostal or a deterministic fallback (
parse_address_libpostal).Deploy flexibly — run over stdio, streamable HTTP, or SSE transports, in-process or via an MCP client like Claude Desktop.
Provides assessment and remediation of postal addresses against the SEPA policy, including policy listing, classification, compliance findings, and proposed structured-address fixes.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@structured-address-fix-mcp assess this pacs.008 message for structured address compliance"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
structured-address-fix-mcp: An MCP Server for ISO 20022 Postal Addresses
A Model Context Protocol server that exposes the
structured-address-fix ISO 20022 postal-address library as tools for
AI agents and assistants — classify an address's shape, assess it against a
scheme policy, and remediate it (or a whole pacs.008 / pain.001 message) into
the structured form the November 2026 cutover requires, all from your
favourite MCP client.
The 14 November 2026 cliff. On that date CBPR+, HVPS+, T2, CHAPS, and Fedwire stop accepting fully unstructured postal addresses: a payment whose debtor/creditor address is a free-text blob is rejected.
structured-address-fix-mcpputs the readiness check and the fix in front of your agent —assess_messageflags the offending parties,remediate_messageproposes the compliant form, andget_cutover_datereports the binding date. v0.0.6, stdio, streamable HTTP and SSE transports, 13 tools, Python 3.12+.
Contents
Transports — stdio, streamable HTTP (2026-07-28 and 2025-11-25) and SSE from one command line
Related MCP server: camt053-mcp
Overview
The Model Context Protocol (MCP) is an open standard that lets AI agents
and assistants discover and call external tools in a uniform way.
structured-address-fix-mcp is an MCP server that turns the
structured-address-fix library into a set of first-class agent tools,
so an assistant can read a postal address — or every addressed party in an
ISO 20022 pacs.008 / pain.001 message — and bring it into line with the
structured-address rules that become mandatory on 14 November 2026,
directly from a conversation.
The headline capability is the one-shot remediation workflow: assess a message, find the parties whose addresses will be rejected at the cliff, and emit the compliant form with each change explained and confidence-scored.
Every tool is a thin, typed wrapper over structured_address_fix.services —
the single shared facade also used by the CLI — so all interfaces behave
identically. Tools return JSON-serialisable data; on an error they return an
{"error": ...} payload rather than raising.
Website: https://sebastienrousseau.github.io/structured-address-fix/
Source code: https://github.com/sebastienrousseau/structured-address-fix-mcp
Bug reports: https://github.com/sebastienrousseau/structured-address-fix-mcp/issues
flowchart LR
A["MCP client<br/>(Claude Desktop, IDE, agent)"] -->|stdio, streamable HTTP or SSE| B["structured-address-fix-mcp"]
B -->|delegates to| C["structured_address_fix.services"]
C -->|classify + assess + remediate| D["ISO 20022 postal addresses<br/>(pacs.008 / pain.001)"]The ISO 20022 MCP Suite
structured-address-fix-mcp is the postal-address specialist in a set of
coordinated, vendor-neutral MCP servers for the ISO 20022 migration.
Dependency ranges are kept aligned across the suite, so the servers co-install
cleanly in a single Python environment: start with one, add the rest as your
workflow grows.
Server | Scope | Install | Use it when |
ISO 20022 postal-address classification, assessment, and remediation for the Nov 2026 structured-address cliff |
| You need to get debtor/creditor addresses cliff-ready — this package | |
Generate, validate, parse & scheme-check ISO 20022 pacs.008 FI-to-FI credit transfers, with Nov-2026 address linting |
| You work with pacs.008 messages end to end | |
Generate & validate ISO 20022 pain.001 payment-initiation files (v03–v12, pain.008, SEPA) with rulebook checks |
| You originate outbound payment files | |
ISO 20022 camt.05x bank statements: parse, validate, filter, reverse; MT94x migration; CBPR+ readiness |
| You work with bank-to-customer statements | |
Orchestration gateway: detect → validate → clearing-profile lint → readiness score, plus remediation and |
| You want one high-level readiness / orchestration entry point over the suite | |
Manages, validates and serves bank-specific clearing profiles / rule packs; premium rule-pack entitlement gating |
| You lint payments against your own institution's market practice | |
Compiles readiness findings, remediation diffs and simulated responses into a sealed, Ed25519-signable audit evidence pack |
| You need tamper-evident audit / certification artifacts |
The suite also includes the iso20022-mcp
gateway (unified search / describe / validate / generate / parse
meta-tools across the whole message catalogue) and
acmt001-mcp (account
management). Where pacs008-mcp lints a message for address problems,
structured-address-fix-mcp is the specialist that classifies, assesses, and
fixes the addresses themselves against per-scheme policies.
Install
structured-address-fix-mcp runs on macOS, Linux, and Windows and requires
Python 3.12+ and pip. It pulls in the core structured-address-fix
library and the MCP SDK automatically.
python -m pip install structured-address-fix-mcppython -m venv venv
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windows
python -m pip install -U structured-address-fix-mcpQuick Start
For the 10-minute install → MCP client config → first conversation
tutorial, see docs/quickstart.md.
Launch the server over stdio (the default transport):
structured-address-fix-mcpRegister it with any MCP client (e.g. Claude Desktop) by adding it to the client's configuration:
{
"mcpServers": {
"structured-address-fix": { "command": "structured-address-fix-mcp" }
}
}The command speaks MCP on stdin/stdout by default — it is meant to be launched by an MCP client, not used interactively. For a shared deployment or an HTTP client, see Transports. The agent can then call the tools below to assess and remediate postal addresses on demand.
Transports
One command line, three transports:
Command | Transport | Endpoint | Protocol revisions |
| stdio | the client spawns the process | 2026-07-28, 2025-11-25 |
| Streamable HTTP |
| 2026-07-28 (stateless, |
| HTTP+SSE (2024-11-05) |
| for clients that still expect the older transport |
--host and --port change the bind address (defaults 127.0.0.1 and
8000). The HTTP transports carry no authentication of their own: bind
loopback, or put the server behind a gateway you trust before binding a
routable address. Every release is verified over streamable HTTP with
scout in both protocol
eras and over SSE with the MCP SDK client; see
ADR 0001.
{
"mcpServers": {
"structured-address-fix": { "url": "http://127.0.0.1:8000/mcp" }
}
}Tools
All tools delegate to the shared structured_address_fix.services layer, so
they behave identically to the CLI. Tools return JSON-serialisable data; on a
domain, validation, or value error they return an {"error": ...} payload.
list_policies— List every available address policy (rulebook) with its tier (e.g.cbpr-2026,sepa,hvps-plus,generic-structured)classify_address— Classify a postal address as structured, hybrid, or unstructured (a quick shape check)assess_address— Score a single address against a policy and return its findingsassess_message— Assess every addressed party in a pacs.008 / pain.001 message against a policyremediate_address— Propose the compliant form of an address, with the before/after and confidence-scored patch operationsremediate_message— Assess and remediate every addressed party in a message; optionally apply the operations and return the patched XMLpreview_patch— Return the patch operations remediation would apply to a message (a dry run)explain_finding— Explain what a finding code (e.g.SAF001) means and how to resolve itget_cutover_date— Return the binding November 2026 structured-address cutover date and the scheme that sets itnormalize_country_code— Resolve a country name or code to its ISO 3166-1 alpha-2 code, accepting English names, local endonyms (Deutschland, España, Nippon) and everyday aliases (UK, USA, Holland, UAE)split_street_and_building— Split a street line into street name, building and sub-building, handling both the leading-number convention (10 Downing Street) and the trailing-number one used across much of continental Europevalidate_postal_policy— Validate an address'spost_codeagainst a country's format policy (US ZIP / ZIP+4, GB alphanumeric, and others)parse_address_libpostal— Parse a free-text address into ISO 20022 postal fields; uses libpostal's statistical parser when the optionalpostalextra is installed, and a deterministic fallback otherwise
Optional parameters shared across the assessment/remediation tools: policy_id
(defaults to cbpr-2026), as_of (an YYYY-MM-DD date that decides the cliff
wording; defaults to today), and country_hint (an ISO 3166-1 alpha-2 code to
assume when an address carries no country of its own).
Using the tools
You can invoke the tools in-process — without a transport — straight through the
FastMCP instance. This mirrors what an agent receives over stdio. The runnable
version of this snippet lives in examples/mcp_tools.py.
import asyncio
from structured_address_fix_mcp import server
# A fully unstructured address: two free-text lines, no structured fields.
# At the 14 Nov 2026 cliff this form is rejected across the major schemes.
unstructured = {
"address_lines": ["10 Downing St", "London SW1A 2AA"],
"country": "GB",
}
async def main() -> None:
async def call(name, args):
result = await server.server.call_tool(name, args)
# mcp 2.x returns a CallToolResult (read .content); 1.x
# returns the content list, or a (content, meta) tuple.
content = getattr(result, "content", None)
if content is None:
content = result[0] if isinstance(result, tuple) else result
return content[0].text if content else ""
# When does the cliff bite?
print(await call("get_cutover_date", {}))
# -> {"date": "2026-11-14", "scheme": "SWIFT CBPR+ UG2026"}
# What shape is this address in right now?
print(await call("classify_address", {"address": unstructured}))
# -> {"classification": "unstructured"}
# Propose the compliant form, with each change explained.
print(await call("remediate_address",
{"address": unstructured, "policy_id": "cbpr-2026"}))
# -> {"policy_id": "cbpr-2026", "findings": [...], "suggestions": [...],
# "is_compliant_before": false, "is_compliant_after": true, ...}
asyncio.run(main())Run it directly:
python examples/mcp_tools.pyRelated MCP Servers
Part of the ISO 20022 MCP Suite — open-source, Apache-2.0 licensed MCP servers for banking and financial-services AI agents:
Server | Purpose |
Generate, validate, parse & scheme-check ISO 20022 pacs.008 FI-to-FI credit transfers + Nov-2026 address linting | |
Generate & validate ISO 20022 pain.001 payment files (v03–v12, pain.008, SEPA) with rulebook checks | |
Parse, validate, filter & reverse ISO 20022 camt.05x bank statements; MT94x migration; CBPR+ readiness | |
Generate & validate ISO 20022 acmt account-management messages | |
Unified gateway: |
When not to use structured-address-fix-mcp
You have no MCP client. This server only makes sense paired with an MCP-aware host (Claude Desktop, the IDE plugins, an agent framework). For scripted / CI use, the
structured-address-fixCLI covers the same ground without the stdio protocol overhead.You need an authenticated, multi-tenant service. The HTTP transports (Transports) carry no authentication of their own and bind loopback by default; put them behind a gateway you trust. OAuth 2.1 resource-server auth and tenant scoping are on the roadmap, not in this release.
You need streaming responses. Tool calls return whole values, not streams. Large messages are assessed and remediated in one call, not chunked over multiple responses.
You need to build the pacs.008 / pain.001 message. Out of scope; this server fixes the addresses inside a message. Use
pacs008-mcporpain001-mcpto generate and validate the message itself.
Development
structured-address-fix-mcp uses Poetry and mise.
git clone https://github.com/sebastienrousseau/structured-address-fix-mcp.git && cd structured-address-fix-mcp
mise install
poetry install
poetry shellNote: the server depends on the core
structured-address-fixlibrary. Until it is published to PyPI, the dev dependency group installs it from the sibling checkout (../structured-address-fix); seeCONTRIBUTING.md.
A Makefile orchestrates the quality gates (kept in lockstep with CI):
make check # all gates (REQUIRED before commit): lint + type-check + test + examples
make test # pytest
make lint # ruff + black
make type-check # mypy --strict
make security # banditSecurity
structured-address-fix-mcp is a thin wrapper — every tool delegates to
structured_address_fix.services, where the defence-in-depth for XML parsing
(defusedxml) lives. Tools catch the documented domain, validation, and value
errors and return an {"error": ...} envelope per the suite convention; they
never propagate raw exceptions to the MCP client. Reporting practice, supported
versions, and the full supply-chain posture (SLSA L3 provenance, PEP 740
attestations, SBOMs, and the NIST SP 800-218 SSDF practice mapping) are
documented in SECURITY.md. Vulnerabilities go via GitHub
Private Vulnerability Reporting, not public issues.
Documentation
README.md— this fileCHANGELOG.md— release notesSECURITY.md— disclosure + supported versionsSUPPORT.md— how to get helpROADMAP.md— what's next (OAuth on the HTTP transports, observability, entitlement gating)MAINTAINERS.md— who can mergedocs/quickstart.md— 10-minute install → first conversationdocs/deployment-cookbook.md— client configs (Claude Desktop, Cursor, containers) and the HTTP transportsdocs/adr/— architecture decision recordsARCHITECTURE.md— a map of the codebaseRELEASING.md— how a release is cutexamples/— runnable scriptsglama.json— Glama directory manifest
MCP Registry
mcp-name: io.github.sebastienrousseau/structured-address-fix-mcp
License
Licensed under the Apache License, Version 2.0. Any contribution submitted for inclusion shall be licensed as above, without additional terms.
Contributing
Contributions are welcome — see the contributing instructions. Thanks to all contributors.
Acknowledgements
Built on the structured-address-fix ISO 20022 postal-address library
and the Model Context Protocol Python SDK.
Available Tools
13 toolsassess_addressAssess a postal addressARead-onlyIdempotent
Score a single address against a policy and return its findings.
Args:
address: The postal address to assess.
policy_id: The policy to assess against (defaults to cbpr-2026).
as_of: The assessment date (YYYY-MM-DD); defaults to today.
country_hint: Country to assume when the address has none.
Inputs: address (required), as_of, policy_id, country_hint. Returns: object
assess_messageAssess an ISO 20022 messageARead-onlyIdempotent
Assess every addressed party in a pacs.008 / pain.001 message.
Args:
xml: The ISO 20022 message document.
policy_id: The policy to assess against (defaults to cbpr-2026).
as_of: The assessment date (YYYY-MM-DD); defaults to today.
Inputs: xml (required), as_of, policy_id. Returns: object
classify_addressClassify a postal addressARead-onlyIdempotent
Classify a postal address as structured, hybrid, or unstructured.
Use this for a quick shape check before deciding whether to remediate.
For the specific compliance findings under a policy, use
``assess_address`` instead.
Args:
address: The postal address to classify.
Inputs: address (required). Returns: object
explain_findingExplain a finding codeARead-onlyIdempotent
Explain what a finding code means and how to resolve it.
Args:
code: The finding code to explain.
Inputs: code (required). Returns: object
get_cutover_dateGet the ISO 20022 cutover dateARead-onlyIdempotent
Report when the structured-address requirement binds, if it yet does.
Swift accepted a community request on 27 August 2026 and deferred every
payments change in Standards Release 2026, the structured-address
requirement among them. No replacement date has been set; Swift will
confirm timing by December 2026 at the latest.
``date`` is therefore ``None``. It is left null rather than filled with
the withdrawn date because an agent reading this hands the answer to
somebody planning a migration, and a date with no force is worse than no
date at all. The requirement itself was agreed by the community in 2023
and stands: ``status`` says deferred, not withdrawn.
The deferral is Swift's, and covers CBPR+. Domestic market
infrastructures set their own timing and several were aligned to the same
November date; check the schemes you settle through rather than assuming
they moved with Swift.
Inputs: no named parameters. Returns: object
list_policiesList address policiesARead-onlyIdempotent
List every available address policy (rulebook) with its tier.
Use this first to discover the ``policy_id`` values the other tools
accept (e.g. ``cbpr-2026``, ``sepa``, ``hvps-plus``,
``generic-structured``).
Returns a list of ``{"id": ..., "title": ..., "tier": ...}`` objects.
Inputs: no named parameters. Returns: result
normalize_country_codeNormalize a country codeARead-onlyIdempotent
Resolve a country name or code to its ISO 3166-1 alpha-2 code.
Accepts English names, common local-language endonyms (Deutschland,
España, Nippon), everyday aliases (UK, USA, Holland, UAE), and existing
2- or 3-letter codes. Matching is case-, accent-, and punctuation-
insensitive.
Args:
country_name_or_code: The country name, alias, or code to resolve.
Returns a ``{"country_code": "DE"}`` object, or ``{"error": ...}`` when
the input matches no known country.
Inputs: country_name_or_code (required). Returns: object
parse_address_libpostalParse an address with libpostalARead-onlyIdempotent
Parse a free-text address into ISO 20022 postal fields.
Uses the optional libpostal statistical parser (the ``postal`` binding,
which requires the system libpostal C library) when it is installed,
and otherwise degrades to this repo's own regex heuristics. Either way
the address is mapped to ``StrtNm``, ``BldgNb``, ``PstCd``, ``TwnNm``
and ``Ctry``. The result's ``parser`` field is ``"libpostal"`` or
``"fallback"`` so callers know which path ran. Runs purely on CPU with
no network or filesystem access, though the libpostal path depends on
an external C library.
Args:
unstructured_address: The free-text address to parse.
country_hint: Country to assume when the text names none.
Returns ``{"parser": ..., "address": {StrtNm, BldgNb, PstCd, TwnNm,
Ctry}}``.
Inputs: unstructured_address (required), country_hint. Returns: object
preview_patchPreview remediation patchARead-onlyIdempotent
Return the patch operations remediation would apply (a dry run).
Args:
xml: The ISO 20022 message document.
policy_id: The policy to remediate for (defaults to cbpr-2026).
as_of: The assessment date (YYYY-MM-DD); defaults to today.
Inputs: xml (required), as_of, policy_id. Returns: result
remediate_addressRemediate a postal addressARead-onlyIdempotent
Propose the compliant form of an address, with explained changes.
Returns the findings, the before/after addresses, and the patch
operations (each carrying the finding it resolves, the source token,
and a confidence score).
Args:
address: The postal address to remediate.
policy_id: The policy to remediate for (defaults to cbpr-2026).
as_of: The assessment date (YYYY-MM-DD); defaults to today.
country_hint: Country to assume when the address has none.
Inputs: address (required), as_of, policy_id, country_hint. Returns: object
remediate_messageRemediate an ISO 20022 messageCRead-onlyIdempotent
Assess and remediate every addressed party in a message.
Args:
xml: The ISO 20022 message document.
policy_id: The policy to remediate for (defaults to cbpr-2026).
apply: Whether to apply the operations and return patched XML.
as_of: The assessment date (YYYY-MM-DD); defaults to today.
Inputs: xml (required), apply, as_of, policy_id. Returns: object
split_street_and_buildingSplit street and buildingARead-onlyIdempotent
Split a street line into street name, building, and sub-building.
Handles the leading-number convention (US/UK: ``10 Downing Street``),
the trailing-number convention (much of continental Europe: ``Rue de
Rivoli 12``), and an optional sub-building marker (``Flat 2``, ``Apt
3B``, ``Suite 400``). When no building number is present the whole line
is returned as ``street_name`` (never an error).
Args:
street_line: The free-text street line to split.
Returns ``{"street_name", "building_number", "sub_building"}`` with
``building_number`` / ``sub_building`` set to ``null`` when absent.
Inputs: street_line (required). Returns: object
validate_postal_policyValidate a postal-code policyARead-onlyIdempotent
Validate an address's post_code against a country's format policy.
Supported policies: US (5-digit ZIP or ZIP+4), GB (alphanumeric UK
postcode), DE and FR (5 digits), JP (3-then-4 digits). The address is a
canonical-field JSON object; only its ``post_code`` is inspected.
Args:
address: The structured address whose post_code to validate.
country_code: The alpha-2 code selecting the policy.
Returns ``{"is_compliant": bool, "policy_errors": [...]}``. An unknown
country or a missing post_code is reported as non-compliant with a
descriptive error rather than raising.
Inputs: address (required), country_code (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Most tools are clearly separated by scope (single address vs message, assess vs remediate), but preview_patch substantially overlaps remediate_message with apply=false, and the parsing helpers have fuzzy boundaries. Descriptions and cross-references help, but an agent could still select the wrong tool in several cases.
All tool names follow the same verb_noun snake_case convention: list_, assess_, remediate_, preview_, explain_, get_, normalize_, split_, validate_, parse_. The pattern is predictable and makes the action and target easy to infer.
Thirteen tools is within the ideal range for a domain covering policy discovery, assessment, remediation, patch preview, explanation, and address parsing helpers. The count feels appropriate for the breadth of the structured-address-fix workflow, not padded or excessive.
The tool surface covers the core workflow well: list policies, assess messages and addresses, preview and apply remediation, explain findings, and normalize/parse address components. Minor gaps exist, such as no way to enumerate all finding codes and parse_address_libpostal not mapping every ISO 20022 sub-field, but agents can work around these.
Maintenance
Related MCP Connectors
Remote MCP server exposing 330 production AI-agent services for web/data processing, validation, AI utilities, blockchain/crypto utilities, and x402 pay-per-use access.
EU AI Act risk classifier, TARIC code validator, and 3-way freight reconciliation MCP server.
Address validation & geocoding for AI agents: 240+ countries, UK PAF, free US/CA enrichment
MCP server for OnceAsk, the AI-native current-address layer for people and agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server for AddressPenny address validation that enables users to validate postal addresses, bulk-clean address lists, and extract addresses from unstructured text through Claude Desktop, Cursor, and other MCP-compatible agents.312 npmMIT
- AlicenseAqualityBmaintenanceMCP server that enables AI agents to parse, validate, and reverse ISO 20022 bank statements, with tools for discovering message types and return reasons.2490 PyPI2Apache 2.0
- AlicenseAqualityBmaintenanceMatches expected payments (pain.001) against observed booked entries (camt.053) for ISO 20022 cash reconciliation, providing explainable match results with scoring and classification.10169 PyPI1Apache 2.0
- AlicenseAqualityDmaintenanceAn MCP server that provides AI agents with tools to validate SWIFT MT and ISO 20022 MX payment messages, check BIC/IBAN correctness, and convert between MT and MX formats.711 npmMIT