acmt001-mcp 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,189 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work.
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean any work of authorship, including
48
+ the original version of the Work and any modifications or additions
49
+ to that Work or Derivative Works thereof, that is intentionally
50
+ submitted to the Licensor for inclusion in the Work by the copyright owner
51
+ or by an individual or Legal Entity authorized to submit on behalf of
52
+ the copyright owner. For the purposes of this definition, "submitted"
53
+ means any form of electronic, verbal, or written communication sent
54
+ to the Licensor or its representatives, including but not limited to
55
+ communication on electronic mailing lists, source code control systems,
56
+ and issue tracking systems that are managed by, or on behalf of, the
57
+ Licensor for the purpose of discussing and improving the Work, but
58
+ excluding communication that is conspicuously marked or otherwise
59
+ designated in writing by the copyright owner as "Not a Contribution."
60
+
61
+ "Contributor" shall mean Licensor and any individual or Legal Entity
62
+ on behalf of whom a Contribution has been received by the Licensor and
63
+ subsequently incorporated within the Work.
64
+
65
+ 2. Grant of Copyright License. Subject to the terms and conditions of
66
+ this License, each Contributor hereby grants to You a perpetual,
67
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
68
+ copyright license to reproduce, prepare Derivative Works of,
69
+ publicly display, publicly perform, sublicense, and distribute the
70
+ Work and such Derivative Works in Source or Object form.
71
+
72
+ 3. Grant of Patent License. Subject to the terms and conditions of
73
+ this License, each Contributor hereby grants to You a perpetual,
74
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
75
+ (except as stated in this section) patent license to make, have made,
76
+ use, offer to sell, sell, import, and otherwise transfer the Work,
77
+ where such license applies only to those patent claims licensable
78
+ by such Contributor that are necessarily infringed by their
79
+ Contribution(s) alone or by combination of their Contribution(s)
80
+ with the Work to which such Contribution(s) was submitted. If You
81
+ institute patent litigation against any entity (including a
82
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
83
+ or a Contribution incorporated within the Work constitutes direct
84
+ or contributory patent infringement, then any patent licenses
85
+ granted to You under this License for that Work shall terminate
86
+ as of the date such litigation is filed.
87
+
88
+ 4. Redistribution. You may reproduce and distribute copies of the
89
+ Work or Derivative Works thereof in any medium, with or without
90
+ modifications, and in Source or Object form, provided that You
91
+ meet the following conditions:
92
+
93
+ (a) You must give any other recipients of the Work or
94
+ Derivative Works a copy of this License; and
95
+
96
+ (b) You must cause any modified files to carry prominent notices
97
+ stating that You changed the files; and
98
+
99
+ (c) You must retain, in the Source form of any Derivative Works
100
+ that You distribute, all copyright, patent, trademark, and
101
+ attribution notices from the Source form of the Work,
102
+ excluding those notices that do not pertain to any part of
103
+ the Derivative Works; and
104
+
105
+ (d) If the Work includes a "NOTICE" text file as part of its
106
+ distribution, then any Derivative Works that You distribute must
107
+ include a readable copy of the attribution notices contained
108
+ within such NOTICE file, excluding any notices that do not
109
+ pertain to any part of the Derivative Works, in at least one
110
+ of the following places: within a NOTICE text file distributed
111
+ as part of the Derivative Works; within the Source form or
112
+ documentation, if provided along with the Derivative Works; or,
113
+ within a display generated by the Derivative Works, if and
114
+ wherever such third-party notices normally appear. The contents
115
+ of the NOTICE file are for informational purposes only and
116
+ do not modify the License. You may add Your own attribution
117
+ notices within Derivative Works that You distribute, alongside
118
+ or as an addendum to the NOTICE text from the Work, provided
119
+ that such additional attribution notices cannot be construed
120
+ as modifying the License.
121
+
122
+ You may add Your own copyright statement to Your modifications and
123
+ may provide additional or different license terms and conditions
124
+ for use, reproduction, or distribution of Your modifications, or
125
+ for any such Derivative Works as a whole, provided Your use,
126
+ reproduction, and distribution of the Work otherwise complies with
127
+ the conditions stated in this License.
128
+
129
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
130
+ any Contribution intentionally submitted for inclusion in the Work
131
+ by You to the Licensor shall be under the terms and conditions of
132
+ this License, without any additional terms or conditions.
133
+ Notwithstanding the above, nothing herein shall supersede or modify
134
+ the terms of any separate license agreement you may have executed
135
+ with Licensor regarding such Contributions.
136
+
137
+ 6. Trademarks. This License does not grant permission to use the trade
138
+ names, trademarks, service marks, or product names of the Licensor,
139
+ except as required for reasonable and customary use in describing the
140
+ origin of the Work and reproducing the content of the NOTICE file.
141
+
142
+ 7. Disclaimer of Warranty. Unless required by applicable law or
143
+ agreed to in writing, Licensor provides the Work (and each
144
+ Contributor provides its Contributions) on an "AS IS" BASIS,
145
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
146
+ implied, including, without limitation, any warranties or conditions
147
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
148
+ PARTICULAR PURPOSE. You are solely responsible for determining the
149
+ appropriateness of using or redistributing the Work and assume any
150
+ risks associated with Your exercise of permissions under this License.
151
+
152
+ 8. Limitation of Liability. In no event and under no legal theory,
153
+ whether in tort (including negligence), contract, or otherwise,
154
+ unless required by applicable law (such as deliberate and grossly
155
+ negligent acts) or agreed to in writing, shall any Contributor be
156
+ liable to You for damages, including any direct, indirect, special,
157
+ incidental, or consequential damages of any character arising as a
158
+ result of this License or out of the use or inability to use the
159
+ Work (including but not limited to damages for loss of goodwill,
160
+ work stoppage, computer failure or malfunction, or any and all
161
+ other commercial damages or losses), even if such Contributor
162
+ has been advised of the possibility of such damages.
163
+
164
+ 9. Accepting Warranty or Additional Liability. While redistributing
165
+ the Work or Derivative Works thereof, You may choose to offer,
166
+ and charge a fee for, acceptance of support, warranty, indemnity,
167
+ or other liability obligations and/or rights consistent with this
168
+ License. However, in accepting such obligations, You may act only
169
+ on Your own behalf and on Your sole responsibility, not on behalf
170
+ of any other Contributor, and only if You agree to indemnify,
171
+ defend, and hold each Contributor harmless for any liability
172
+ incurred by, or claims asserted against, such Contributor by reason
173
+ of your accepting any such warranty or additional liability.
174
+
175
+ END OF TERMS AND CONDITIONS
176
+
177
+ Copyright 2023-2026 Sebastien Rousseau
178
+
179
+ Licensed under the Apache License, Version 2.0 (the "License");
180
+ you may not use this file except in compliance with the License.
181
+ You may obtain a copy of the License at
182
+
183
+ http://www.apache.org/licenses/LICENSE-2.0
184
+
185
+ Unless required by applicable law or agreed to in writing, software
186
+ distributed under the License is distributed on an "AS IS" BASIS,
187
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
188
+ See the License for the specific language governing permissions and
189
+ limitations under the License.
@@ -0,0 +1,271 @@
1
+ Metadata-Version: 2.4
2
+ Name: acmt001-mcp
3
+ Version: 0.0.1
4
+ Summary: Model Context Protocol (MCP) server exposing the acmt001 ISO 20022 Account Management library as agent tools.
5
+ License: Apache-2.0
6
+ License-File: LICENSE
7
+ Author: Sebastien Rousseau
8
+ Author-email: sebastian.rousseau@gmail.com
9
+ Requires-Python: >=3.10,<4.0
10
+ Classifier: License :: OSI Approved :: Apache Software License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Requires-Dist: acmt001 (>=0.0.1)
18
+ Requires-Dist: mcp (>=1.2)
19
+ Project-URL: Homepage, https://acmt001.com
20
+ Project-URL: Repository, https://github.com/sebastienrousseau/acmt001-mcp
21
+ Description-Content-Type: text/markdown
22
+
23
+ # acmt001-mcp: An MCP Server for ISO 20022 Account Management
24
+
25
+ ![acmt001-mcp banner][banner]
26
+
27
+ [![PyPI Version][pypi-badge]][07]
28
+ [![Python Versions][python-versions-badge]][07]
29
+ [![PyPI Downloads][pypi-downloads-badge]][07]
30
+ [![Licence][licence-badge]][01]
31
+ [![Tests][tests-badge]][tests-url]
32
+ [![Quality][quality-badge]][quality-url]
33
+ [![Documentation][docs-badge]][docs-url]
34
+
35
+ **A [Model Context Protocol][mcp] server that exposes the [`acmt001`][core]
36
+ ISO 20022 Account Management library as tools for AI agents and assistants** —
37
+ discover message types, inspect input schemas, validate records and financial
38
+ identifiers, and generate validated XML, all from your favourite MCP client.
39
+
40
+ > **Latest release: v0.0.1** — six MCP tools over stdio, all backed by the
41
+ > shared `acmt001.services` layer, for Python 3.10+.
42
+ > [See what's new →][release-001]
43
+
44
+ ## Contents
45
+
46
+ - [Overview](#overview)
47
+ - [Install](#install)
48
+ - [Quick Start](#quick-start)
49
+ - [Tools](#tools)
50
+ - [Using the tools](#using-the-tools)
51
+ - [Development](#development)
52
+ - [Licence](#licence)
53
+ - [Contribution](#contribution)
54
+ - [Acknowledgements](#acknowledgements)
55
+
56
+ ## Overview
57
+
58
+ The [Model Context Protocol][mcp] (MCP) is an open standard that lets AI agents
59
+ and assistants discover and call external tools in a uniform way. **acmt001-mcp**
60
+ is an MCP server that turns the [`acmt001`][core] library into a set of
61
+ first-class agent tools, so an assistant can generate and validate **ISO 20022
62
+ `acmt` Account Management XML messages** — the standardised instructions,
63
+ confirmations, and reports that govern the lifecycle of a bank account (opening,
64
+ maintenance, closing, identification, and switching) — directly from a
65
+ conversation.
66
+
67
+ Every tool is a thin, typed wrapper over `acmt001.services` — the single shared
68
+ facade also used by the CLI and REST API — so all interfaces behave identically.
69
+ Tools return JSON-serialisable data; on a validation error they return an
70
+ `{"error": ...}` payload rather than raising.
71
+
72
+ - **Website:** <https://acmt001.com>
73
+ - **Source code:** <https://github.com/sebastienrousseau/acmt001-mcp>
74
+ - **Bug reports:** <https://github.com/sebastienrousseau/acmt001-mcp/issues>
75
+
76
+ This package is part of the **acmt001 suite** — a set of independently
77
+ installable packages that share the `acmt001.services` layer:
78
+
79
+ - [`acmt001`][core] — the core library (CLI + REST API)
80
+ - `acmt001-mcp` — this package, the **Model Context Protocol** server
81
+ - [`acmt001-lsp`][lsp] — the **Language Server Protocol** server for editors
82
+
83
+ ```mermaid
84
+ flowchart LR
85
+ A["MCP client<br/>(Claude Desktop, IDE, agent)"] -->|stdio| B["acmt001-mcp"]
86
+ B -->|delegates to| C["acmt001.services"]
87
+ C -->|render + validate| D["ISO 20022 acmt XML"]
88
+ ```
89
+
90
+ ## Install
91
+
92
+ **acmt001-mcp** runs on macOS, Linux, and Windows and requires **Python 3.10+**
93
+ and **pip**. It pulls in the core `acmt001` library and the MCP SDK
94
+ automatically.
95
+
96
+ ```sh
97
+ python -m pip install acmt001-mcp
98
+ ```
99
+
100
+ > **Note:** while the core `acmt001` library is not yet on PyPI, install it from
101
+ > source first:
102
+ >
103
+ > ```sh
104
+ > python -m pip install "git+https://github.com/sebastienrousseau/acmt001.git"
105
+ > python -m pip install acmt001-mcp
106
+ > ```
107
+
108
+ <details>
109
+ <summary>Using an isolated virtual environment (recommended)</summary>
110
+
111
+ ```sh
112
+ python -m venv venv
113
+ source venv/bin/activate # macOS/Linux
114
+ venv\Scripts\activate # Windows
115
+ python -m pip install -U acmt001-mcp
116
+ ```
117
+ </details>
118
+
119
+ ## Quick Start
120
+
121
+ Launch the server over stdio (the FastMCP default transport):
122
+
123
+ ```sh
124
+ acmt001-mcp
125
+ ```
126
+
127
+ Register it with any MCP client (e.g. Claude Desktop) by adding it to the
128
+ client's configuration:
129
+
130
+ ```json
131
+ {
132
+ "mcpServers": {
133
+ "acmt001": { "command": "acmt001-mcp" }
134
+ }
135
+ }
136
+ ```
137
+
138
+ The agent can then call the tools below to validate account data and generate
139
+ ISO 20022 messages on demand.
140
+
141
+ ## Tools
142
+
143
+ All tools delegate to the shared `acmt001.services` layer, so they behave
144
+ identically to the CLI and REST API.
145
+
146
+ | Tool | Purpose |
147
+ |------|---------|
148
+ | `list_message_types` | List the 34 supported acmt message types |
149
+ | `get_required_fields` | Required input fields for a message type |
150
+ | `get_input_schema` | Full input JSON Schema for a message type |
151
+ | `validate_records` | Validate flat records against a message type |
152
+ | `validate_identifier` | Validate an IBAN, BIC, or LEI |
153
+ | `generate_message` | Generate a validated acmt XML message |
154
+
155
+ ## Using the tools
156
+
157
+ You can invoke the tools in-process — without a transport — straight through the
158
+ FastMCP instance. This mirrors what an agent receives over stdio. The runnable
159
+ version of this snippet lives in [`examples/mcp_tools.py`](examples/mcp_tools.py).
160
+
161
+ ```python
162
+ import asyncio
163
+
164
+ from acmt001_mcp.server import server
165
+
166
+ # A single flat account-opening record.
167
+ record = [
168
+ {
169
+ "msg_id": "ACMT-MSG-0001",
170
+ "creation_date_time": "2026-01-15T10:30:00",
171
+ "process_id": "ACMT-PRC-0001",
172
+ "account_id": "GB29NWBK60161331926819",
173
+ "account_currency": "EUR",
174
+ "account_name": "Treasury Operating Account",
175
+ "account_type_cd": "CACC",
176
+ "account_servicer_bic": "NWBKGB2LXXX",
177
+ "account_owner_name": "Acme Embedded Finance Ltd",
178
+ "account_owner_country": "GB",
179
+ "org_full_legal_name": "Acme Embedded Finance Limited",
180
+ "org_country_of_operation": "GB",
181
+ "org_id_lei": "5493001KJTIIGC8Y1R12",
182
+ }
183
+ ]
184
+
185
+
186
+ async def main() -> None:
187
+ async def call(name, args):
188
+ result = await server.call_tool(name, args)
189
+ content = result[0] if isinstance(result, tuple) else result
190
+ return content[0].text if content else ""
191
+
192
+ # Validate an identifier.
193
+ print(await call("validate_identifier",
194
+ {"kind": "lei", "value": "5493001KJTIIGC8Y1R12"}))
195
+ # -> {"kind": "lei", "value": "5493001KJTIIGC8Y1R12", "valid": true}
196
+
197
+ # Generate a validated ISO 20022 Account Opening Request.
198
+ xml = await call("generate_message",
199
+ {"message_type": "acmt.007.001.05", "records": record})
200
+ print(xml[:46]) # -> <?xml version="1.0" encoding="UTF-8"?> ...
201
+
202
+
203
+ asyncio.run(main())
204
+ ```
205
+
206
+ Run it directly:
207
+
208
+ ```sh
209
+ python examples/mcp_tools.py
210
+ ```
211
+
212
+ ## Development
213
+
214
+ **acmt001-mcp** uses [Poetry](https://python-poetry.org/) and
215
+ [mise](https://mise.jdx.dev/).
216
+
217
+ ```bash
218
+ git clone https://github.com/sebastienrousseau/acmt001-mcp.git && cd acmt001-mcp
219
+ mise install
220
+ poetry install
221
+ poetry shell
222
+ ```
223
+
224
+ > This package depends on the core `acmt001` library. Until it is on PyPI,
225
+ > install it from source first:
226
+ > `pip install "git+https://github.com/sebastienrousseau/acmt001.git"`.
227
+
228
+ A `Makefile` orchestrates the quality gates (kept in lockstep with CI):
229
+
230
+ ```bash
231
+ make check # all gates (REQUIRED before commit)
232
+ make test # pytest
233
+ make lint # ruff + black
234
+ make type-check # mypy --strict
235
+ ```
236
+
237
+ ## Licence
238
+
239
+ Licensed under the [Apache Licence, Version 2.0][01]. Any contribution submitted
240
+ for inclusion shall be licensed as above, without additional terms.
241
+
242
+ ## Contribution
243
+
244
+ Contributions are welcome — see the [contributing instructions][04]. Thanks to
245
+ all [contributors][05].
246
+
247
+ ## Acknowledgements
248
+
249
+ Built on the [`acmt001`][core] ISO 20022 Account Management library and the
250
+ [Model Context Protocol][mcp] Python SDK.
251
+
252
+ [01]: https://opensource.org/license/apache-2-0/
253
+ [04]: https://github.com/sebastienrousseau/acmt001-mcp/blob/main/CONTRIBUTING.md
254
+ [05]: https://github.com/sebastienrousseau/acmt001-mcp/graphs/contributors
255
+ [07]: https://pypi.org/project/acmt001-mcp/
256
+ [core]: https://github.com/sebastienrousseau/acmt001
257
+ [lsp]: https://github.com/sebastienrousseau/acmt001-lsp
258
+ [mcp]: https://modelcontextprotocol.io
259
+ [release-001]: https://github.com/sebastienrousseau/acmt001-mcp/releases/tag/v0.0.1
260
+ [banner]: https://kura.pro/acmt001-mcp/images/banners/banner-acmt001-mcp.svg 'acmt001-mcp'
261
+ [docs-badge]: https://img.shields.io/badge/Docs-acmt001.com-blue?style=for-the-badge
262
+ [docs-url]: https://acmt001.com/
263
+ [licence-badge]: https://img.shields.io/pypi/l/acmt001-mcp?style=for-the-badge
264
+ [pypi-badge]: https://img.shields.io/pypi/v/acmt001-mcp?style=for-the-badge
265
+ [pypi-downloads-badge]: https://img.shields.io/pypi/dm/acmt001-mcp.svg?style=for-the-badge
266
+ [python-versions-badge]: https://img.shields.io/pypi/pyversions/acmt001-mcp.svg?style=for-the-badge
267
+ [quality-badge]: https://img.shields.io/github/actions/workflow/status/sebastienrousseau/acmt001-mcp/ci.yml?branch=main&label=Quality&style=for-the-badge
268
+ [quality-url]: https://github.com/sebastienrousseau/acmt001-mcp/actions/workflows/ci.yml
269
+ [tests-badge]: https://img.shields.io/github/actions/workflow/status/sebastienrousseau/acmt001-mcp/ci.yml?branch=main&label=Tests&style=for-the-badge
270
+ [tests-url]: https://github.com/sebastienrousseau/acmt001-mcp/actions/workflows/ci.yml
271
+
@@ -0,0 +1,248 @@
1
+ # acmt001-mcp: An MCP Server for ISO 20022 Account Management
2
+
3
+ ![acmt001-mcp banner][banner]
4
+
5
+ [![PyPI Version][pypi-badge]][07]
6
+ [![Python Versions][python-versions-badge]][07]
7
+ [![PyPI Downloads][pypi-downloads-badge]][07]
8
+ [![Licence][licence-badge]][01]
9
+ [![Tests][tests-badge]][tests-url]
10
+ [![Quality][quality-badge]][quality-url]
11
+ [![Documentation][docs-badge]][docs-url]
12
+
13
+ **A [Model Context Protocol][mcp] server that exposes the [`acmt001`][core]
14
+ ISO 20022 Account Management library as tools for AI agents and assistants** —
15
+ discover message types, inspect input schemas, validate records and financial
16
+ identifiers, and generate validated XML, all from your favourite MCP client.
17
+
18
+ > **Latest release: v0.0.1** — six MCP tools over stdio, all backed by the
19
+ > shared `acmt001.services` layer, for Python 3.10+.
20
+ > [See what's new →][release-001]
21
+
22
+ ## Contents
23
+
24
+ - [Overview](#overview)
25
+ - [Install](#install)
26
+ - [Quick Start](#quick-start)
27
+ - [Tools](#tools)
28
+ - [Using the tools](#using-the-tools)
29
+ - [Development](#development)
30
+ - [Licence](#licence)
31
+ - [Contribution](#contribution)
32
+ - [Acknowledgements](#acknowledgements)
33
+
34
+ ## Overview
35
+
36
+ The [Model Context Protocol][mcp] (MCP) is an open standard that lets AI agents
37
+ and assistants discover and call external tools in a uniform way. **acmt001-mcp**
38
+ is an MCP server that turns the [`acmt001`][core] library into a set of
39
+ first-class agent tools, so an assistant can generate and validate **ISO 20022
40
+ `acmt` Account Management XML messages** — the standardised instructions,
41
+ confirmations, and reports that govern the lifecycle of a bank account (opening,
42
+ maintenance, closing, identification, and switching) — directly from a
43
+ conversation.
44
+
45
+ Every tool is a thin, typed wrapper over `acmt001.services` — the single shared
46
+ facade also used by the CLI and REST API — so all interfaces behave identically.
47
+ Tools return JSON-serialisable data; on a validation error they return an
48
+ `{"error": ...}` payload rather than raising.
49
+
50
+ - **Website:** <https://acmt001.com>
51
+ - **Source code:** <https://github.com/sebastienrousseau/acmt001-mcp>
52
+ - **Bug reports:** <https://github.com/sebastienrousseau/acmt001-mcp/issues>
53
+
54
+ This package is part of the **acmt001 suite** — a set of independently
55
+ installable packages that share the `acmt001.services` layer:
56
+
57
+ - [`acmt001`][core] — the core library (CLI + REST API)
58
+ - `acmt001-mcp` — this package, the **Model Context Protocol** server
59
+ - [`acmt001-lsp`][lsp] — the **Language Server Protocol** server for editors
60
+
61
+ ```mermaid
62
+ flowchart LR
63
+ A["MCP client<br/>(Claude Desktop, IDE, agent)"] -->|stdio| B["acmt001-mcp"]
64
+ B -->|delegates to| C["acmt001.services"]
65
+ C -->|render + validate| D["ISO 20022 acmt XML"]
66
+ ```
67
+
68
+ ## Install
69
+
70
+ **acmt001-mcp** runs on macOS, Linux, and Windows and requires **Python 3.10+**
71
+ and **pip**. It pulls in the core `acmt001` library and the MCP SDK
72
+ automatically.
73
+
74
+ ```sh
75
+ python -m pip install acmt001-mcp
76
+ ```
77
+
78
+ > **Note:** while the core `acmt001` library is not yet on PyPI, install it from
79
+ > source first:
80
+ >
81
+ > ```sh
82
+ > python -m pip install "git+https://github.com/sebastienrousseau/acmt001.git"
83
+ > python -m pip install acmt001-mcp
84
+ > ```
85
+
86
+ <details>
87
+ <summary>Using an isolated virtual environment (recommended)</summary>
88
+
89
+ ```sh
90
+ python -m venv venv
91
+ source venv/bin/activate # macOS/Linux
92
+ venv\Scripts\activate # Windows
93
+ python -m pip install -U acmt001-mcp
94
+ ```
95
+ </details>
96
+
97
+ ## Quick Start
98
+
99
+ Launch the server over stdio (the FastMCP default transport):
100
+
101
+ ```sh
102
+ acmt001-mcp
103
+ ```
104
+
105
+ Register it with any MCP client (e.g. Claude Desktop) by adding it to the
106
+ client's configuration:
107
+
108
+ ```json
109
+ {
110
+ "mcpServers": {
111
+ "acmt001": { "command": "acmt001-mcp" }
112
+ }
113
+ }
114
+ ```
115
+
116
+ The agent can then call the tools below to validate account data and generate
117
+ ISO 20022 messages on demand.
118
+
119
+ ## Tools
120
+
121
+ All tools delegate to the shared `acmt001.services` layer, so they behave
122
+ identically to the CLI and REST API.
123
+
124
+ | Tool | Purpose |
125
+ |------|---------|
126
+ | `list_message_types` | List the 34 supported acmt message types |
127
+ | `get_required_fields` | Required input fields for a message type |
128
+ | `get_input_schema` | Full input JSON Schema for a message type |
129
+ | `validate_records` | Validate flat records against a message type |
130
+ | `validate_identifier` | Validate an IBAN, BIC, or LEI |
131
+ | `generate_message` | Generate a validated acmt XML message |
132
+
133
+ ## Using the tools
134
+
135
+ You can invoke the tools in-process — without a transport — straight through the
136
+ FastMCP instance. This mirrors what an agent receives over stdio. The runnable
137
+ version of this snippet lives in [`examples/mcp_tools.py`](examples/mcp_tools.py).
138
+
139
+ ```python
140
+ import asyncio
141
+
142
+ from acmt001_mcp.server import server
143
+
144
+ # A single flat account-opening record.
145
+ record = [
146
+ {
147
+ "msg_id": "ACMT-MSG-0001",
148
+ "creation_date_time": "2026-01-15T10:30:00",
149
+ "process_id": "ACMT-PRC-0001",
150
+ "account_id": "GB29NWBK60161331926819",
151
+ "account_currency": "EUR",
152
+ "account_name": "Treasury Operating Account",
153
+ "account_type_cd": "CACC",
154
+ "account_servicer_bic": "NWBKGB2LXXX",
155
+ "account_owner_name": "Acme Embedded Finance Ltd",
156
+ "account_owner_country": "GB",
157
+ "org_full_legal_name": "Acme Embedded Finance Limited",
158
+ "org_country_of_operation": "GB",
159
+ "org_id_lei": "5493001KJTIIGC8Y1R12",
160
+ }
161
+ ]
162
+
163
+
164
+ async def main() -> None:
165
+ async def call(name, args):
166
+ result = await server.call_tool(name, args)
167
+ content = result[0] if isinstance(result, tuple) else result
168
+ return content[0].text if content else ""
169
+
170
+ # Validate an identifier.
171
+ print(await call("validate_identifier",
172
+ {"kind": "lei", "value": "5493001KJTIIGC8Y1R12"}))
173
+ # -> {"kind": "lei", "value": "5493001KJTIIGC8Y1R12", "valid": true}
174
+
175
+ # Generate a validated ISO 20022 Account Opening Request.
176
+ xml = await call("generate_message",
177
+ {"message_type": "acmt.007.001.05", "records": record})
178
+ print(xml[:46]) # -> <?xml version="1.0" encoding="UTF-8"?> ...
179
+
180
+
181
+ asyncio.run(main())
182
+ ```
183
+
184
+ Run it directly:
185
+
186
+ ```sh
187
+ python examples/mcp_tools.py
188
+ ```
189
+
190
+ ## Development
191
+
192
+ **acmt001-mcp** uses [Poetry](https://python-poetry.org/) and
193
+ [mise](https://mise.jdx.dev/).
194
+
195
+ ```bash
196
+ git clone https://github.com/sebastienrousseau/acmt001-mcp.git && cd acmt001-mcp
197
+ mise install
198
+ poetry install
199
+ poetry shell
200
+ ```
201
+
202
+ > This package depends on the core `acmt001` library. Until it is on PyPI,
203
+ > install it from source first:
204
+ > `pip install "git+https://github.com/sebastienrousseau/acmt001.git"`.
205
+
206
+ A `Makefile` orchestrates the quality gates (kept in lockstep with CI):
207
+
208
+ ```bash
209
+ make check # all gates (REQUIRED before commit)
210
+ make test # pytest
211
+ make lint # ruff + black
212
+ make type-check # mypy --strict
213
+ ```
214
+
215
+ ## Licence
216
+
217
+ Licensed under the [Apache Licence, Version 2.0][01]. Any contribution submitted
218
+ for inclusion shall be licensed as above, without additional terms.
219
+
220
+ ## Contribution
221
+
222
+ Contributions are welcome — see the [contributing instructions][04]. Thanks to
223
+ all [contributors][05].
224
+
225
+ ## Acknowledgements
226
+
227
+ Built on the [`acmt001`][core] ISO 20022 Account Management library and the
228
+ [Model Context Protocol][mcp] Python SDK.
229
+
230
+ [01]: https://opensource.org/license/apache-2-0/
231
+ [04]: https://github.com/sebastienrousseau/acmt001-mcp/blob/main/CONTRIBUTING.md
232
+ [05]: https://github.com/sebastienrousseau/acmt001-mcp/graphs/contributors
233
+ [07]: https://pypi.org/project/acmt001-mcp/
234
+ [core]: https://github.com/sebastienrousseau/acmt001
235
+ [lsp]: https://github.com/sebastienrousseau/acmt001-lsp
236
+ [mcp]: https://modelcontextprotocol.io
237
+ [release-001]: https://github.com/sebastienrousseau/acmt001-mcp/releases/tag/v0.0.1
238
+ [banner]: https://kura.pro/acmt001-mcp/images/banners/banner-acmt001-mcp.svg 'acmt001-mcp'
239
+ [docs-badge]: https://img.shields.io/badge/Docs-acmt001.com-blue?style=for-the-badge
240
+ [docs-url]: https://acmt001.com/
241
+ [licence-badge]: https://img.shields.io/pypi/l/acmt001-mcp?style=for-the-badge
242
+ [pypi-badge]: https://img.shields.io/pypi/v/acmt001-mcp?style=for-the-badge
243
+ [pypi-downloads-badge]: https://img.shields.io/pypi/dm/acmt001-mcp.svg?style=for-the-badge
244
+ [python-versions-badge]: https://img.shields.io/pypi/pyversions/acmt001-mcp.svg?style=for-the-badge
245
+ [quality-badge]: https://img.shields.io/github/actions/workflow/status/sebastienrousseau/acmt001-mcp/ci.yml?branch=main&label=Quality&style=for-the-badge
246
+ [quality-url]: https://github.com/sebastienrousseau/acmt001-mcp/actions/workflows/ci.yml
247
+ [tests-badge]: https://img.shields.io/github/actions/workflow/status/sebastienrousseau/acmt001-mcp/ci.yml?branch=main&label=Tests&style=for-the-badge
248
+ [tests-url]: https://github.com/sebastienrousseau/acmt001-mcp/actions/workflows/ci.yml
@@ -0,0 +1,18 @@
1
+ # Copyright (C) 2023-2026 Sebastien Rousseau.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12
+ # implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ """acmt001-mcp: a Model Context Protocol server for the acmt001 library."""
17
+
18
+ __version__ = "0.0.1"
@@ -0,0 +1,155 @@
1
+ # Copyright (C) 2023-2026 Sebastien Rousseau.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12
+ # implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ """Model Context Protocol (MCP) server for Acmt001.
17
+
18
+ This server exposes the Acmt001 library's ISO 20022 ``acmt`` capabilities as
19
+ MCP tools so that any MCP-compatible client (Claude Desktop, IDEs, agents) can
20
+ discover message types, inspect input schemas, validate records and financial
21
+ identifiers, and generate validated XML messages.
22
+
23
+ Every tool is a thin, typed wrapper over :mod:`acmt001.services` -- the single
24
+ shared facade also used by the CLI, REST API, and LSP server -- so all
25
+ interfaces behave identically. Tools return JSON-serializable data (dicts,
26
+ lists, or strings); on a :class:`ValueError` they return an ``{"error": ...}``
27
+ dictionary rather than raising.
28
+
29
+ Launching the server:
30
+ * As a console script (installed with the ``servers`` extra)::
31
+
32
+ acmt001-mcp
33
+
34
+ * Programmatically::
35
+
36
+ from acmt001.mcp.server import main
37
+ main()
38
+
39
+ * In an MCP client config (e.g. Claude Desktop ``claude_desktop_config.json``)::
40
+
41
+ {
42
+ "mcpServers": {
43
+ "acmt001": {
44
+ "command": "acmt001-mcp"
45
+ }
46
+ }
47
+ }
48
+
49
+ The server communicates over stdio (FastMCP's default transport).
50
+ """
51
+
52
+ import json
53
+
54
+ from acmt001 import services
55
+ from mcp.server.fastmcp import FastMCP
56
+
57
+ server = FastMCP("acmt001")
58
+
59
+
60
+ @server.tool()
61
+ def list_message_types() -> list[dict]:
62
+ """List every supported ISO 20022 acmt message type.
63
+
64
+ Returns a list of ``{"message_type": ..., "name": ...}`` dictionaries, one
65
+ per supported message type (e.g. ``acmt.001.001.08``).
66
+ """
67
+ try:
68
+ return services.list_message_types()
69
+ except ValueError as exc:
70
+ return [{"error": str(exc)}]
71
+
72
+
73
+ @server.tool()
74
+ def get_required_fields(message_type: str) -> list[str]:
75
+ """List the required input field names for a given acmt message type.
76
+
77
+ Args:
78
+ message_type: A supported ISO 20022 acmt message type.
79
+ """
80
+ try:
81
+ return services.get_required_fields(message_type)
82
+ except ValueError as exc:
83
+ return [f"error: {exc}"]
84
+
85
+
86
+ @server.tool()
87
+ def get_input_schema(message_type: str) -> dict:
88
+ """Return the JSON Schema describing the flat input record for a type.
89
+
90
+ Args:
91
+ message_type: A supported ISO 20022 acmt message type.
92
+ """
93
+ try:
94
+ return services.get_input_schema(message_type)
95
+ except ValueError as exc:
96
+ return {"error": str(exc)}
97
+
98
+
99
+ @server.tool()
100
+ def validate_records(message_type: str, records: list[dict]) -> dict:
101
+ """Validate flat records against a message type's input JSON Schema.
102
+
103
+ Returns a report ``{"valid": bool, "total": int, "valid_count": int,
104
+ "errors": [...]}``.
105
+
106
+ Args:
107
+ message_type: A supported ISO 20022 acmt message type.
108
+ records: One or more flat account records to validate.
109
+ """
110
+ try:
111
+ return services.validate_records(message_type, records)
112
+ except ValueError as exc:
113
+ return {"error": str(exc)}
114
+
115
+
116
+ @server.tool()
117
+ def validate_identifier(kind: str, value: str) -> dict:
118
+ """Validate a financial identifier (IBAN, BIC, or LEI).
119
+
120
+ Returns ``{"kind": str, "value": str, "valid": bool}``.
121
+
122
+ Args:
123
+ kind: One of ``"iban"``, ``"bic"``, or ``"lei"`` (case-insensitive).
124
+ value: The identifier value to check.
125
+ """
126
+ try:
127
+ return services.validate_identifier(kind, value)
128
+ except ValueError as exc:
129
+ return {"error": str(exc)}
130
+
131
+
132
+ @server.tool()
133
+ def generate_message(message_type: str, records: list[dict]) -> str:
134
+ """Generate a validated ISO 20022 acmt XML message from flat records.
135
+
136
+ Returns the validated XML document as a string, or an ``{"error": ...}``
137
+ payload (serialized) if generation fails.
138
+
139
+ Args:
140
+ message_type: A supported ISO 20022 acmt message type.
141
+ records: One or more flat account records.
142
+ """
143
+ try:
144
+ return services.generate(message_type, records)
145
+ except ValueError as exc:
146
+ return json.dumps({"error": str(exc)})
147
+
148
+
149
+ def main() -> None:
150
+ """Run the Acmt001 MCP server over stdio (the ``acmt001-mcp`` entry point)."""
151
+ server.run()
152
+
153
+
154
+ if __name__ == "__main__":
155
+ main()
@@ -0,0 +1,105 @@
1
+ [tool.poetry]
2
+ name = "acmt001-mcp"
3
+ version = "0.0.1"
4
+ description = "Model Context Protocol (MCP) server exposing the acmt001 ISO 20022 Account Management library as agent tools."
5
+ authors = ["Sebastien Rousseau <sebastian.rousseau@gmail.com>"]
6
+ license = "Apache-2.0"
7
+ readme = "README.md"
8
+ repository = "https://github.com/sebastienrousseau/acmt001-mcp"
9
+ homepage = "https://acmt001.com"
10
+ packages = [
11
+ { include = "acmt001_mcp" },
12
+ ]
13
+
14
+ [tool.poetry.scripts]
15
+ acmt001-mcp = "acmt001_mcp.server:main"
16
+
17
+ [tool.poetry.dependencies]
18
+ python = ">=3.10,<4.0"
19
+ acmt001 = ">=0.0.1"
20
+ mcp = ">=1.2"
21
+
22
+ [tool.poetry.group.dev.dependencies]
23
+ pytest = ">=9.0.3,<10.0.0"
24
+ pytest-cov = ">=6.0.0,<8.0.0"
25
+ black = "^24.0.0"
26
+ ruff = "^0.1.0"
27
+ mypy = "^1.11.0"
28
+ bandit = "^1.7.0"
29
+
30
+ [build-system]
31
+ requires = ["poetry-core"]
32
+ build-backend = "poetry.core.masonry.api"
33
+
34
+ [tool.black]
35
+ line-length = 79
36
+ target-version = ['py310']
37
+
38
+ [tool.pytest.ini_options]
39
+ testpaths = ["tests"]
40
+ python_files = "test_*.py"
41
+ python_classes = "Test*"
42
+ python_functions = "test_*"
43
+ addopts = ["-ra", "--strict-markers", "--tb=short"]
44
+
45
+ [tool.ruff]
46
+ line-length = 79
47
+ target-version = "py310"
48
+ extend-exclude = ["*.md", "tmp_env", ".venv", ".eggs"]
49
+
50
+ [tool.ruff.lint]
51
+ select = ["E", "W", "F", "I", "B", "C4", "UP"]
52
+ ignore = ["E501"]
53
+
54
+ [tool.ruff.lint.per-file-ignores]
55
+ "__init__.py" = ["F401"]
56
+ "tests/conftest.py" = ["E402"]
57
+
58
+ [tool.ruff.format]
59
+ quote-style = "double"
60
+ indent-style = "space"
61
+ skip-magic-trailing-comma = false
62
+
63
+ [tool.mypy]
64
+ python_version = "3.10"
65
+ strict = true
66
+ warn_return_any = true
67
+ warn_unused_configs = true
68
+ disallow_untyped_defs = true
69
+ disallow_any_unimported = false
70
+ no_implicit_optional = true
71
+ warn_redundant_casts = true
72
+ warn_unused_ignores = true
73
+ warn_no_return = true
74
+ check_untyped_defs = true
75
+ strict_equality = true
76
+ exclude = [
77
+ "tmp_env/",
78
+ ".venv/",
79
+ ".eggs/",
80
+ ]
81
+
82
+ [[tool.mypy.overrides]]
83
+ module = "mcp.*"
84
+ ignore_missing_imports = true
85
+
86
+ [[tool.mypy.overrides]]
87
+ module = "acmt001.*"
88
+ ignore_missing_imports = true
89
+
90
+ [[tool.mypy.overrides]]
91
+ # The tools mirror the (untyped) acmt001.services facade verbatim, returning
92
+ # bare dict/list/str. Relax the two strict checks that signature would trip
93
+ # (generic dict/list args and Any propagated from services) while keeping the
94
+ # rest of strict mode in force.
95
+ module = "acmt001_mcp.*"
96
+ disallow_any_generics = false
97
+ warn_return_any = false
98
+
99
+ [[tool.mypy.overrides]]
100
+ module = "tests.*"
101
+ disallow_untyped_defs = false
102
+ disallow_incomplete_defs = false
103
+ disallow_untyped_calls = false
104
+ warn_unused_ignores = false
105
+ disable_error_code = ["arg-type", "return-value", "attr-defined", "assignment"]