structured-address-fix-mcp

v0.0.6
io.github.sebastienrousseau/structured-address-fix-mcp Checked 10 hours ago Published 1 month ago

MCP server for ISO 20022 postal-address remediation ahead of the Nov 2026 CBPR+ cliff.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_policies List address policies

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.

classify_address Classify a postal address

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.

ParameterTypeDescription
address *objectAn ISO 20022 postal address as a JSON object using canonical field names, e.g. {'street_name': 'Downing St', 'building_number': '10', 'post_code': 'SW1A 2AA', 'town_name': 'London', 'country': 'GB'} o…

assess_address Assess a postal address

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.

ParameterTypeDescription
address *objectAn ISO 20022 postal address as a JSON object using canonical field names, e.g. {'street_name': 'Downing St', 'building_number': '10', 'post_code': 'SW1A 2AA', 'town_name': 'London', 'country': 'GB'} o…
as_ofThe assessment date as an ISO 8601 string (YYYY-MM-DD). Decides cliff wording; defaults to today.
country_hintISO 3166-1 alpha-2 hint when the address has no country of its own.
policy_idThe policy to assess against (see list_policies). Defaults to 'cbpr-2026' when omitted.

assess_message Assess an ISO 20022 message

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.

ParameterTypeDescription
xml *stringAn ISO 20022 message as XML.
as_ofThe assessment date as an ISO 8601 string (YYYY-MM-DD). Decides cliff wording; defaults to today.
policy_idThe policy to assess against (see list_policies). Defaults to 'cbpr-2026' when omitted.

remediate_address Remediate a postal address

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.

ParameterTypeDescription
address *objectAn ISO 20022 postal address as a JSON object using canonical field names, e.g. {'street_name': 'Downing St', 'building_number': '10', 'post_code': 'SW1A 2AA', 'town_name': 'London', 'country': 'GB'} o…
as_ofThe assessment date as an ISO 8601 string (YYYY-MM-DD). Decides cliff wording; defaults to today.
country_hintISO 3166-1 alpha-2 hint.
policy_idThe policy to assess against (see list_policies). Defaults to 'cbpr-2026' when omitted.

remediate_message Remediate an ISO 20022 message

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.

ParameterTypeDescription
xml *stringAn ISO 20022 message as XML.
applybooleanWhen true, apply the operations and return the patched XML in 'patched_xml'.
as_ofThe assessment date as an ISO 8601 string (YYYY-MM-DD). Decides cliff wording; defaults to today.
policy_idThe policy to assess against (see list_policies). Defaults to 'cbpr-2026' when omitted.

preview_patch Preview remediation patch

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.

ParameterTypeDescription
xml *stringAn ISO 20022 message as XML.
as_ofThe assessment date as an ISO 8601 string (YYYY-MM-DD). Decides cliff wording; defaults to today.
policy_idThe policy to assess against (see list_policies). Defaults to 'cbpr-2026' when omitted.

explain_finding Explain a finding code

Explain what a finding code means and how to resolve it. Args: code: The finding code to explain.

ParameterTypeDescription
code *stringA finding code, e.g. 'SAF001' (see the codes in any assessment result).

get_cutover_date Get the ISO 20022 cutover date

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 commun…

normalize_country_code Normalize a country code

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.

ParameterTypeDescription
country_name_or_code *stringA country name, endonym, alias, or 2/3-letter code, e.g. 'Deutschland', 'UK', 'U.S.A.', 'DEU'.

split_street_and_building Split street and building

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.

ParameterTypeDescription
street_line *stringA single free-text street line, e.g. '10 Downing Street', 'Rue de Rivoli 12', or 'Flat 2, 221B Baker Street'.

validate_postal_policy Validate a postal-code policy

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.

ParameterTypeDescription
address *objectAn ISO 20022 postal address as a JSON object using canonical field names, e.g. {'street_name': 'Downing St', 'building_number': '10', 'post_code': 'SW1A 2AA', 'town_name': 'London', 'country': 'GB'} o…
country_code *stringThe ISO 3166-1 alpha-2 code whose post_code policy to apply (US, GB, DE, FR, JP).

parse_address_libpostal Parse an address with libpostal

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…

ParameterTypeDescription
unstructured_address *stringA single free-text postal address, e.g. '12 Rue de Rivoli, 75001 Paris, France'.
country_hintAn ISO 3166-1 alpha-2 hint (or country name) used when the address text does not name its own country.