be-eli-mcp 0.1.0__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,59 @@
1
+ name: release
2
+
3
+ # Publishes to PyPI (org secret PYPI_API_TOKEN) + the MCP Registry (GitHub OIDC).
4
+ # Trigger: push a version tag, e.g. `git tag v0.1.0 && git push origin v0.1.0`.
5
+
6
+ on:
7
+ push:
8
+ tags:
9
+ - "v*"
10
+ workflow_dispatch: {} # manual re-run of the MCP Registry publish without bumping the package version
11
+
12
+ permissions:
13
+ contents: read
14
+ id-token: write # required for the MCP Registry OIDC login
15
+
16
+ jobs:
17
+ build-and-publish-pypi:
18
+ if: github.event_name == 'push' # only on a version tag; skipped on manual dispatch
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.12"
27
+
28
+ - name: Install build tooling
29
+ run: python -m pip install --upgrade build
30
+
31
+ - name: Build sdist + wheel
32
+ run: python -m build
33
+
34
+ - name: Publish to PyPI (org API token)
35
+ uses: pypa/gh-action-pypi-publish@release/v1
36
+ with:
37
+ password: ${{ secrets.PYPI_API_TOKEN }}
38
+
39
+ publish-mcp-registry:
40
+ needs: build-and-publish-pypi
41
+ # run after a successful PyPI publish, OR standalone on manual dispatch
42
+ if: always() && (github.event_name == 'workflow_dispatch' || needs.build-and-publish-pypi.result == 'success')
43
+ runs-on: ubuntu-latest
44
+ permissions:
45
+ contents: read
46
+ id-token: write # OIDC login to the MCP Registry
47
+ steps:
48
+ - uses: actions/checkout@v4
49
+
50
+ - name: Install mcp-publisher
51
+ run: |
52
+ curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_amd64.tar.gz" | tar xz mcp-publisher
53
+ sudo mv mcp-publisher /usr/local/bin/
54
+
55
+ - name: Login to MCP Registry (GitHub OIDC)
56
+ run: mcp-publisher login github-oidc
57
+
58
+ - name: Publish server.json to MCP Registry
59
+ run: mcp-publisher publish
@@ -0,0 +1,25 @@
1
+ # Python
2
+ .venv/
3
+ __pycache__/
4
+ *.py[cod]
5
+ *.egg-info/
6
+ dist/
7
+ build/
8
+ .pytest_cache/
9
+ .mypy_cache/
10
+ .ruff_cache/
11
+
12
+ # Local runtime (never source)
13
+ .matematic/
14
+ *.log
15
+ .mcp.json
16
+
17
+ # Live API probe scratch (raw dumps - not part of the package)
18
+ _probe/
19
+
20
+ # OS
21
+ .DS_Store
22
+ Thumbs.db
23
+
24
+ # Note: tests/fixtures/* ARE committed - public CC0 ejustice.just.fgov.be data needed for
25
+ # offline tests.
@@ -0,0 +1,12 @@
1
+ {
2
+ "mcpServers": {
3
+ "be-eli-mcp": {
4
+ "command": "be-eli-mcp",
5
+ "env": {
6
+ "BE_ELI_BASE_URL": "https://www.ejustice.just.fgov.be",
7
+ "BE_ELI_CACHE_DIR": "~/.matematic/cache/be-eli",
8
+ "BE_ELI_AUDIT_DIR": "~/.matematic/audit"
9
+ }
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "allow_paths": ["tests/fixtures/"]
3
+ }
@@ -0,0 +1,90 @@
1
+ # Constitution of be-eli-mcp
2
+
3
+ Version: 0.1.0
4
+ Date: 2026-07-06
5
+ Licence: Apache-2.0
6
+
7
+ `be-eli-mcp` is an MCP server for Belgian legislation via Moniteur Belge / Belgisch Staatsblad
8
+ (`ejustice.just.fgov.be`), the official gazette of the Belgian Federal Public Service Justice. It
9
+ fetches act metadata and full text by ELI coordinates, with verifiable citations.
10
+
11
+ The 4 principles below are inherited from the `eu-legal-mcp` line Constitution (Article IV).
12
+
13
+ ---
14
+
15
+ ## Art. 1. Public data only
16
+
17
+ ejustice.just.fgov.be is the official, public, keyless source of Belgian legislation. Content is
18
+ noted as CC Zero (CC0) by the third-party worldwidelaw/legal-sources catalog and by data.gov.be
19
+ convention for Belgian federal open data; **this project does not assert its own independent
20
+ confirmation of the CC0 licence text from ejustice.just.fgov.be itself** - the site's footer shows
21
+ only a generic "Conditions d'utilisation" PDF link, which this project has not parsed for a
22
+ licence grant. Treat the CC0 note as inherited-and-plausible, not verified-by-us. The server is
23
+ read-only against ejustice.just.fgov.be and sends nothing beyond the requested coordinates.
24
+
25
+ ## Art. 2. Mandatory audit log
26
+
27
+ Every tool call MUST append one JSON line to `~/.matematic/audit/be-eli-mcp.jsonl`
28
+ (ts / tool / input_hash SHA-256 / output_count_or_size / duration_ms / status). Inability to write
29
+ = the tool returns an error, it does not silently skip.
30
+
31
+ ## Art. 3. Vendor neutrality
32
+
33
+ No tool hardcodes an LLM provider, assumes a model, or adds commercial telemetry. The server talks
34
+ only to `www.ejustice.just.fgov.be` and the local filesystem. Authentication: none; own backoff +
35
+ cache.
36
+
37
+ ## Art. 4. ELI citations and a human-readable citation are mandatory
38
+
39
+ Every response MUST carry three fields:
40
+
41
+ - `eli_uri`: the **native** ejustice.just.fgov.be ELI URL for the requested coordinates
42
+ (`https://www.ejustice.just.fgov.be/eli/{type}/{yyyy}/{mm}/{dd}/{numac}/justel`). This is
43
+ constructed from coordinates the caller supplied AND confirmed against the page's own content
44
+ (title block present) before being returned - a coordinate with no matching NUMAC is surfaced
45
+ as `not_found`, never as a fabricated or empty `Act`.
46
+ - `human_readable_citation`: built from the parsed Belgian title, which follows the "D MOIS
47
+ YYYY. - Loi/Arrete/... " convention in the source itself. **Belgium is trilingual (French/Dutch/
48
+ German)**: the title text ejustice returns depends on the language toggle used; this connector
49
+ defaults to French for `human_readable_citation` by LDH (Le Droit Belge) convention, but this is
50
+ an editorial default, not a claim that French is more "official" than Dutch or German - all
51
+ three are co-official. Callers needing the Dutch (Belgisch Staatsblad) or German form should use
52
+ `be_get_text(language="nl"|"de")`.
53
+ - `source_url`: the same ELI URL. Unlike Legilux (Luxembourg) or the Irish Statute Book,
54
+ ejustice.just.fgov.be has no separate "human portal" distinct from the ELI page itself - the ELI
55
+ URL IS the page a human would open.
56
+
57
+ ---
58
+
59
+ ## Open points
60
+
61
+ 1. **No HTTP search** - ejustice.just.fgov.be exposes no keyword/full-text search API reachable
62
+ without a browser session. Discovery is by ELI coordinates (from a citation you already hold)
63
+ or by browsing `be_list_year` (a year-listing page per `doc_type`) for NUMAC discovery. This is
64
+ the same "get-by-coordinate" shape as `ie-eli-mcp` and `lu-eli-mcp`.
65
+ 2. **CGI fallback not used as primary path** - the worldwidelaw/legal-sources catalog names
66
+ `/cgi/article_body.pl` as a fallback full-text endpoint. Live discovery in this session found
67
+ the `/eli/.../justel` page itself already serves complete, structured full text with metadata,
68
+ so the CGI fallback was not required and is not wired into `client.py`. The catalog's claim
69
+ about `article_body.pl` was not independently re-verified; treat it as unconfirmed if a future
70
+ maintainer needs it.
71
+ 3. **Not-found is content-based, not status-based** - verified live: an ELI path with a
72
+ non-existent NUMAC returns HTTP 200 with an empty shell page, not 404/410. `citations.py`
73
+ detects this via `has_content()` (absence of the `list-item--title` block) rather than trusting
74
+ the HTTP status code. Any future change to the site's error-page markup could silently break
75
+ this detection; the offline fixture test (`test_parse.py::test_has_content_false_for_notfound_fixture`)
76
+ guards it.
77
+ 4. **Listing titles are best-effort** - `be_list_year` extracts titles from the year-listing page
78
+ by proximity-matching a title-block regex to a date/source block; some entries (especially
79
+ older administrative notices) have no title line in the listing and will return `title: null`.
80
+ Callers wanting the authoritative title should call `be_get_act`.
81
+ 5. **Consolidated ("justel") vs original ("moniteur") text** - this connector reads the
82
+ `/justel` (consolidated) variant. The `/moniteur` (as-originally-published) variant exists as a
83
+ separate ELI suffix but is not always present for every NUMAC (verified: some NUMACs 404 on
84
+ `/moniteur`); it is not wired into a tool in this v0.1.0.
85
+
86
+ ## Constitution evolution
87
+
88
+ Changes to art. 1-4 follow SEMVER + an entry in `CHANGELOG.md` + a `pyproject.toml` bump.
89
+
90
+ First version: 2026-07-06. Author: Wieslaw Mazur / MateMatic.
@@ -0,0 +1,77 @@
1
+ # Discovery - be-eli-mcp (Belgium, Moniteur Belge / Belgisch Staatsblad)
2
+
3
+ Date: 2026-07-06. Decision: **BUILD** (clean keyless, HTML-structured, ELI-coordinate source,
4
+ reachable and parseable this session).
5
+
6
+ ## Context
7
+
8
+ Belgium's official gazette is `ejustice.just.fgov.be`, run by the Federal Public Service Justice.
9
+ The EU eur-lex ELI register documents Belgium's ELI grammar; a third-party catalog
10
+ (`worldwidelaw/legal-sources`, `sources/BE/moniteurbelge/config.yaml`) additionally names the
11
+ endpoint shapes and a `cgi/article_body.pl` fallback. Both were used as leads, not trusted
12
+ blindly - every claim below was independently re-probed live against production.
13
+
14
+ ## Source (probed live, not trusted from docs)
15
+
16
+ - **Host:** `https://www.ejustice.just.fgov.be`. Keyless, no auth headers required.
17
+ - **ELI grammar (confirmed live):**
18
+ `GET /eli/{type}/{yyyy}/{mm}/{dd}/{numac}/justel` returns the consolidated act as HTML, `200 OK`.
19
+ `type` confirmed working for `loi` and `arrete`; `decret`, `ordonnance`, `constitution` follow
20
+ the same catalog-documented grammar but were not each individually re-fetched this session.
21
+ `numac` is Belgium's own legislative numbering system (10-digit, e.g. `2020040054`).
22
+ - **`/moniteur` variant** (original as-published text, same ELI path with `/moniteur` suffix
23
+ instead of `/justel`): returned **404** for the one NUMAC tested (`2020040054`), even though the
24
+ year-listing page links to it. Not every NUMAC has a `/moniteur` manifestation reachable this
25
+ way, or the suffix requires different handling than assumed. **Not wired into a tool** in
26
+ v0.1.0 - flagged as an open point in CONSTITUTION.md rather than forced.
27
+ - **No free-text search API.** The only browse mechanism found is the year-listing page
28
+ `/eli/{type}/{year}`, which lists all NUMACs published that year for that type (242 entries for
29
+ `loi`/2020) - this is a listing, not a keyword search. Same "get-by-coordinate" shape as
30
+ `ie-eli-mcp` (Ireland: year+number+type) and `lu-eli-mcp` (Luxembourg: ELI-native, no SPARQL).
31
+ - **Not-found is HTTP 200, not 404.** A constructed ELI path with a non-existent NUMAC
32
+ (`.../9999999999/justel`) returns HTTP 200 with a byte-for-byte-similar-length empty shell page
33
+ (same `list`/`links` div skeleton, no `list-item--title` or `Texte` block). Confirmed by
34
+ comparing response length (7974 bytes for both a real `arrete` fixture and the fake-NUMAC
35
+ fixture) and by absence of the title/text markup. `citations.has_content()` is the guard.
36
+ - **Response format: structured HTML, not prose-scrape.** The `/justel` page carries stable,
37
+ class-named blocks: `<p class="list-item--title">` (title), a `plain-text` block with
38
+ labelled `<strong>Source:</strong>` / `<strong>Publication:</strong>` /
39
+ `<strong>Numero:</strong>` / `<strong>Entree en vigueur:</strong>` fields, a `<h2 id="text">`
40
+ ("Texte"/"Tekst") section containing `Art. N.` anchors, and a `Liens` section with the
41
+ canonical ELI URL and a PDF link. This is regex-parseable in the same spirit as `ie-eli-mcp`'s
42
+ ISB header-block extraction - not fragile prose-scraping.
43
+ - **Trilingual.** `/cgi_loi/article.pl?language={fr|nl|de}&numac_search={numac}&caller=eli`
44
+ toggles the language of the same NUMAC (confirmed: FR and NL both returned 200 with correctly
45
+ translated `Texte`/`Tekst` sections for the test act). German was not individually re-fetched
46
+ but follows the same URL pattern per the site's own language nav links. **Gotcha found during
47
+ smoke testing:** the `cn_search=...&view_numac={numac}fr` parameter combination (copied from
48
+ the site's own FR nav link, which happened to still resolve to full FR content) does **not**
49
+ reliably serve full content for other languages - for NL it returned a short stub/redirect page
50
+ with no title/text blocks. Switching to `numac_search={numac}` (dropping `cn_search`/
51
+ `view_numac` entirely) reliably returns the full structured page for all three languages.
52
+ - **worldwidelaw's `cgi/article_body.pl` fallback claim: not independently confirmed.** The
53
+ `/justel` page already provides complete full text + metadata, so this session did not need
54
+ the CGI fallback and did not verify it live. Documented as an open point, not asserted as
55
+ working.
56
+ - **Licence:** the worldwidelaw catalog and data.gov.be convention describe Belgian federal
57
+ Moniteur Belge data as CC0. This session did not locate and parse an explicit licence grant on
58
+ ejustice.just.fgov.be itself (the footer links only to a generic "Conditions d'utilisation"
59
+ PDF). Treated as inherited-and-plausible, not independently verified - see CONSTITUTION Art. 1.
60
+
61
+ ## Citation contract mapping
62
+
63
+ | Field | Source |
64
+ | --- | --- |
65
+ | `eli_uri` | constructed from caller-supplied coordinates, confirmed against real page content before being returned (never fabricated for a not-found coordinate) |
66
+ | `human_readable_citation` | the parsed Belgian title ("D MOIS YYYY. - Loi/Arrete ..."), French by LDH convention; NL/DE available via `language` param |
67
+ | `source_url` | the same ELI URL (no separate human portal exists) |
68
+
69
+ ## Build
70
+
71
+ `audit.py` + `cache.py` reused verbatim (env `BE_ELI_*`, log `be-eli-mcp.jsonl`). New for BE:
72
+ `client.py` (keyless GET of `/justel` pages, language-toggle CGI endpoint, year-listing pages),
73
+ `citations.py` (regex extraction of the class-named HTML blocks + content-based not-found
74
+ detection + year-listing entry parsing), `models.py`, `server.py` (3 tools: `be_get_act`,
75
+ `be_get_text`, `be_list_year`; `ToolError` {invalid_arg / not_found / upstream_error}). Tests:
76
+ offline drift + offline fixture parse (3 live-captured HTML fixtures in `tests/fixtures/`) + live
77
+ smoke. The factory holds: infrastructure reused, only the source adapter is new.
@@ -0,0 +1,5 @@
1
+ # Dockerfile — lets Glama (or any sandbox) build and introspect this MCP server.
2
+ # The server is published on PyPI; this installs it and runs its stdio entrypoint.
3
+ FROM python:3.11-slim
4
+ RUN pip install --no-cache-dir be-eli-mcp
5
+ ENTRYPOINT ["be-eli-mcp"]
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,97 @@
1
+ Metadata-Version: 2.4
2
+ Name: be-eli-mcp
3
+ Version: 0.1.0
4
+ Summary: MCP server for Belgian legislation via Moniteur Belge / Belgisch Staatsblad (ejustice.just.fgov.be) — ELI-coordinate metadata and full text with verifiable citations.
5
+ Project-URL: Repository, https://github.com/matematicsolutions/be-eli-mcp
6
+ Project-URL: Issues, https://github.com/matematicsolutions/be-eli-mcp/issues
7
+ Project-URL: Homepage, https://matematic.co
8
+ Author-email: Matematic Solutions <kontakt@matematic.co>, Wieslaw Mazur <mazur.wieslaw2022@gmail.com>
9
+ License: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: belgisch-staatsblad,belgium,eli,law,legaltech,mcp,moniteur-belge
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Legal Industry
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Office/Business
20
+ Requires-Python: >=3.11
21
+ Requires-Dist: anyio>=4.3
22
+ Requires-Dist: diskcache>=5.6
23
+ Requires-Dist: fastmcp>=0.2.0
24
+ Requires-Dist: httpx>=0.27
25
+ Requires-Dist: pydantic>=2.6
26
+ Provides-Extra: dev
27
+ Requires-Dist: mypy>=1.10; extra == 'dev'
28
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
29
+ Requires-Dist: pytest>=8.0; extra == 'dev'
30
+ Requires-Dist: ruff>=0.5; extra == 'dev'
31
+ Description-Content-Type: text/markdown
32
+
33
+ # be-eli-mcp
34
+
35
+ <!-- mcp-name: io.github.matematicsolutions/be-eli-mcp -->
36
+
37
+ An MCP server for **Belgian legislation** via [Moniteur Belge / Belgisch Staatsblad]
38
+ (https://www.ejustice.just.fgov.be), the official gazette of the Belgian Federal Public Service
39
+ Justice. It fetches act metadata and full text by ELI coordinates, with verifiable citations.
40
+ Part of the **eu-legal-mcp** line of national legal connectors by [MateMatic](https://matematic.co).
41
+
42
+ Belgian legislation is addressed by ELI coordinates - `type` / `year` / `month` / `day` / `numac`
43
+ (the Belgian legislative numbering system) - at
44
+ `https://www.ejustice.just.fgov.be/eli/{type}/{yyyy}/{mm}/{dd}/{numac}/justel`. Every response
45
+ carries a native `eli_uri`, a `human_readable_citation` and a `source_url`.
46
+
47
+ > **Read-only.** The server only queries ejustice.just.fgov.be and writes a local audit log. It
48
+ > never modifies official text.
49
+
50
+ > **Belgium is trilingual** (French / Dutch / German). `human_readable_citation` defaults to the
51
+ > French form by LDH convention; use `be_get_text(language=...)` for Dutch (Belgisch Staatsblad)
52
+ > or German. See CONSTITUTION.md Art. 4 for the full caveat.
53
+
54
+ ## Tools
55
+
56
+ | Tool | What it does |
57
+ | --- | --- |
58
+ | `be_get_act(doc_type, year, month, day, numac)` | Metadata for an act by its ELI coordinates. `doc_type` is one of `loi`, `decret`, `ordonnance`, `arrete`, `constitution`. Returns the native `eli_uri`, title, source authority, publication date, entry-into-force date, table of contents, and the citation contract. |
59
+ | `be_get_text(doc_type, year, month, day, numac, language="fr")` | The verbatim consolidated text ("Texte"/"Tekst" section) in `fr` (default), `nl` or `de`. |
60
+ | `be_list_year(doc_type, year)` | Browse a year's listing for one `doc_type`, to discover NUMAC coordinates. Titles in this listing are best-effort (may be `None`); call `be_get_act` for the authoritative title. |
61
+
62
+ There is **no free-text search**: ejustice.just.fgov.be exposes no keyword-search API. Discover
63
+ acts by ELI coordinates (from a citation you already hold) or by browsing `be_list_year`.
64
+
65
+ ## Configuration
66
+
67
+ ejustice.just.fgov.be is keyless. Configuration is optional:
68
+
69
+ | Variable | Meaning |
70
+ | --- | --- |
71
+ | `BE_ELI_BASE_URL` | ejustice host (default `https://www.ejustice.just.fgov.be`). |
72
+ | `BE_ELI_CACHE_DIR` | Disk cache dir (default `~/.matematic/cache/be-eli`). |
73
+ | `BE_ELI_AUDIT_DIR` | Audit log dir (default `~/.matematic/audit`). |
74
+
75
+ Copy `.mcp.json.example` to your MCP client config.
76
+
77
+ ## Install
78
+
79
+ ```bash
80
+ py -3.13 -m venv .venv
81
+ .\.venv\Scripts\python.exe -m pip install -e ".[dev]" # Windows
82
+ # or: python -m pip install -e ".[dev]" # POSIX
83
+ ```
84
+
85
+ ## Tests
86
+
87
+ ```bash
88
+ pytest tests/test_instructions_drift.py tests/test_parse.py # offline
89
+ pytest tests/test_smoke.py -v # live, hits ejustice.just.fgov.be
90
+ ```
91
+
92
+ ## Licence
93
+
94
+ Apache-2.0. Moniteur Belge / Belgisch Staatsblad content is © the Belgian federal state; this
95
+ software only retrieves and cites it. See CONSTITUTION.md Art. 1 for a note on the licence status
96
+ of the source data (widely described as CC0 by third-party catalogs; not independently
97
+ re-verified against ejustice.just.fgov.be's own terms page in this project).
@@ -0,0 +1,65 @@
1
+ # be-eli-mcp
2
+
3
+ <!-- mcp-name: io.github.matematicsolutions/be-eli-mcp -->
4
+
5
+ An MCP server for **Belgian legislation** via [Moniteur Belge / Belgisch Staatsblad]
6
+ (https://www.ejustice.just.fgov.be), the official gazette of the Belgian Federal Public Service
7
+ Justice. It fetches act metadata and full text by ELI coordinates, with verifiable citations.
8
+ Part of the **eu-legal-mcp** line of national legal connectors by [MateMatic](https://matematic.co).
9
+
10
+ Belgian legislation is addressed by ELI coordinates - `type` / `year` / `month` / `day` / `numac`
11
+ (the Belgian legislative numbering system) - at
12
+ `https://www.ejustice.just.fgov.be/eli/{type}/{yyyy}/{mm}/{dd}/{numac}/justel`. Every response
13
+ carries a native `eli_uri`, a `human_readable_citation` and a `source_url`.
14
+
15
+ > **Read-only.** The server only queries ejustice.just.fgov.be and writes a local audit log. It
16
+ > never modifies official text.
17
+
18
+ > **Belgium is trilingual** (French / Dutch / German). `human_readable_citation` defaults to the
19
+ > French form by LDH convention; use `be_get_text(language=...)` for Dutch (Belgisch Staatsblad)
20
+ > or German. See CONSTITUTION.md Art. 4 for the full caveat.
21
+
22
+ ## Tools
23
+
24
+ | Tool | What it does |
25
+ | --- | --- |
26
+ | `be_get_act(doc_type, year, month, day, numac)` | Metadata for an act by its ELI coordinates. `doc_type` is one of `loi`, `decret`, `ordonnance`, `arrete`, `constitution`. Returns the native `eli_uri`, title, source authority, publication date, entry-into-force date, table of contents, and the citation contract. |
27
+ | `be_get_text(doc_type, year, month, day, numac, language="fr")` | The verbatim consolidated text ("Texte"/"Tekst" section) in `fr` (default), `nl` or `de`. |
28
+ | `be_list_year(doc_type, year)` | Browse a year's listing for one `doc_type`, to discover NUMAC coordinates. Titles in this listing are best-effort (may be `None`); call `be_get_act` for the authoritative title. |
29
+
30
+ There is **no free-text search**: ejustice.just.fgov.be exposes no keyword-search API. Discover
31
+ acts by ELI coordinates (from a citation you already hold) or by browsing `be_list_year`.
32
+
33
+ ## Configuration
34
+
35
+ ejustice.just.fgov.be is keyless. Configuration is optional:
36
+
37
+ | Variable | Meaning |
38
+ | --- | --- |
39
+ | `BE_ELI_BASE_URL` | ejustice host (default `https://www.ejustice.just.fgov.be`). |
40
+ | `BE_ELI_CACHE_DIR` | Disk cache dir (default `~/.matematic/cache/be-eli`). |
41
+ | `BE_ELI_AUDIT_DIR` | Audit log dir (default `~/.matematic/audit`). |
42
+
43
+ Copy `.mcp.json.example` to your MCP client config.
44
+
45
+ ## Install
46
+
47
+ ```bash
48
+ py -3.13 -m venv .venv
49
+ .\.venv\Scripts\python.exe -m pip install -e ".[dev]" # Windows
50
+ # or: python -m pip install -e ".[dev]" # POSIX
51
+ ```
52
+
53
+ ## Tests
54
+
55
+ ```bash
56
+ pytest tests/test_instructions_drift.py tests/test_parse.py # offline
57
+ pytest tests/test_smoke.py -v # live, hits ejustice.just.fgov.be
58
+ ```
59
+
60
+ ## Licence
61
+
62
+ Apache-2.0. Moniteur Belge / Belgisch Staatsblad content is © the Belgian federal state; this
63
+ software only retrieves and cites it. See CONSTITUTION.md Art. 1 for a note on the licence status
64
+ of the source data (widely described as CC0 by third-party catalogs; not independently
65
+ re-verified against ejustice.just.fgov.be's own terms page in this project).
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://glama.ai/mcp/schemas/server.json",
3
+ "maintainers": ["mazurwieslaw2022-cmd"]
4
+ }