us-eli-mcp 0.3.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.
- us_eli_mcp-0.3.0/.github/workflows/release.yml +61 -0
- us_eli_mcp-0.3.0/.gitignore +20 -0
- us_eli_mcp-0.3.0/.publication-gate.json +3 -0
- us_eli_mcp-0.3.0/DISCOVERY.md +105 -0
- us_eli_mcp-0.3.0/LICENSE +202 -0
- us_eli_mcp-0.3.0/PKG-INFO +112 -0
- us_eli_mcp-0.3.0/README.md +81 -0
- us_eli_mcp-0.3.0/SOURCES.md +157 -0
- us_eli_mcp-0.3.0/glama.json +4 -0
- us_eli_mcp-0.3.0/pyproject.toml +65 -0
- us_eli_mcp-0.3.0/server.json +22 -0
- us_eli_mcp-0.3.0/src/us_eli_mcp/__init__.py +4 -0
- us_eli_mcp-0.3.0/src/us_eli_mcp/audit.py +94 -0
- us_eli_mcp-0.3.0/src/us_eli_mcp/cache.py +56 -0
- us_eli_mcp-0.3.0/src/us_eli_mcp/citations.py +254 -0
- us_eli_mcp-0.3.0/src/us_eli_mcp/client.py +87 -0
- us_eli_mcp-0.3.0/src/us_eli_mcp/courtlistener_client.py +109 -0
- us_eli_mcp-0.3.0/src/us_eli_mcp/ecfr_client.py +115 -0
- us_eli_mcp-0.3.0/src/us_eli_mcp/federal_register_client.py +155 -0
- us_eli_mcp-0.3.0/src/us_eli_mcp/govinfo_client.py +119 -0
- us_eli_mcp-0.3.0/src/us_eli_mcp/models.py +88 -0
- us_eli_mcp-0.3.0/src/us_eli_mcp/server.py +721 -0
- us_eli_mcp-0.3.0/tests/fixtures/courtlistener_search.json +223 -0
- us_eli_mcp-0.3.0/tests/fixtures/ecfr_search.json +1 -0
- us_eli_mcp-0.3.0/tests/fixtures/ecfr_versions.json +1 -0
- us_eli_mcp-0.3.0/tests/fixtures/fr_document.json +1 -0
- us_eli_mcp-0.3.0/tests/fixtures/fr_search.json +1 -0
- us_eli_mcp-0.3.0/tests/test_feature003_offline.py +101 -0
- us_eli_mcp-0.3.0/tests/test_feature003_smoke.py +79 -0
- us_eli_mcp-0.3.0/tests/test_govinfo_smoke.py +25 -0
- us_eli_mcp-0.3.0/tests/test_smoke.py +26 -0
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
# NOTE: switched from OIDC trusted-publishing after a persistent invalid-publisher
|
|
6
|
+
# error across the fleet; see gb-eli-mcp for the same pattern already working.
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
tags:
|
|
11
|
+
- "v*"
|
|
12
|
+
workflow_dispatch: {} # manual re-run of the MCP Registry publish without bumping the package version
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
id-token: write # required for the MCP Registry OIDC login
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
build-and-publish-pypi:
|
|
20
|
+
if: github.event_name == 'push' # only on a version tag; skipped on manual dispatch
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.12"
|
|
29
|
+
|
|
30
|
+
- name: Install build tooling
|
|
31
|
+
run: python -m pip install --upgrade build
|
|
32
|
+
|
|
33
|
+
- name: Build sdist + wheel
|
|
34
|
+
run: python -m build
|
|
35
|
+
|
|
36
|
+
- name: Publish to PyPI (org API token)
|
|
37
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
38
|
+
with:
|
|
39
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
40
|
+
|
|
41
|
+
publish-mcp-registry:
|
|
42
|
+
needs: build-and-publish-pypi
|
|
43
|
+
# run after a successful PyPI publish, OR standalone on manual dispatch
|
|
44
|
+
if: always() && (github.event_name == 'workflow_dispatch' || needs.build-and-publish-pypi.result == 'success')
|
|
45
|
+
runs-on: ubuntu-latest
|
|
46
|
+
permissions:
|
|
47
|
+
contents: read
|
|
48
|
+
id-token: write # OIDC login to the MCP Registry
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@v4
|
|
51
|
+
|
|
52
|
+
- name: Install mcp-publisher
|
|
53
|
+
run: |
|
|
54
|
+
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_amd64.tar.gz" | tar xz mcp-publisher
|
|
55
|
+
sudo mv mcp-publisher /usr/local/bin/
|
|
56
|
+
|
|
57
|
+
- name: Login to MCP Registry (GitHub OIDC)
|
|
58
|
+
run: mcp-publisher login github-oidc
|
|
59
|
+
|
|
60
|
+
- name: Publish server.json to MCP Registry
|
|
61
|
+
run: mcp-publisher publish
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
|
|
16
|
+
# OS
|
|
17
|
+
.DS_Store
|
|
18
|
+
Thumbs.db
|
|
19
|
+
|
|
20
|
+
# Note: tests/fixtures/* ARE committed - public Finlex data needed for tests.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Discovery notes - USA
|
|
2
|
+
|
|
3
|
+
Date: 2026-07-06.
|
|
4
|
+
|
|
5
|
+
## v0.2.0 - GovInfo added (enacted law text); CourtListener tried and reverted
|
|
6
|
+
|
|
7
|
+
Date: 2026-07-06 (same day, second pass - cross-fleet audit found this
|
|
8
|
+
connector had zero case-law/full-text coverage, one gap common to all four
|
|
9
|
+
non-EU connectors probed that day: IL, US, GB, BR).
|
|
10
|
+
|
|
11
|
+
**CourtListener was implemented, then reverted.** A live probe confirmed
|
|
12
|
+
CourtListener v4's `/search/` endpoint works anonymously and is a real,
|
|
13
|
+
broad case-law source. But this connector's own "Why this connector
|
|
14
|
+
originally stopped at Congress.gov bills" section (below) had ALREADY made
|
|
15
|
+
a considered decision not to build a CourtListener wrapper here, because
|
|
16
|
+
`blakeox/courtlistener-mcp` (MIT, 49 tools) and
|
|
17
|
+
`john-walkoe/courtlistener_citations_mcp` (MIT) already do exactly that. A
|
|
18
|
+
concurrent multi-agent session momentarily built and shipped a CourtListener
|
|
19
|
+
integration anyway, overriding that decision without re-litigating it - on
|
|
20
|
+
review this was reverted, because "the gap is real" does not override "two
|
|
21
|
+
MIT projects already fill it"; the original reasoning still holds. If you
|
|
22
|
+
want US case law via MCP, use one of those two existing servers instead of
|
|
23
|
+
expecting it here.
|
|
24
|
+
|
|
25
|
+
**GovInfo was built instead** - the gap this connector's own DISCOVERY.md
|
|
26
|
+
already named as the natural v0.2 feature (see below), and one genuinely not
|
|
27
|
+
covered elsewhere in this fleet:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
GET https://api.govinfo.gov/collections/{collection}/{startDate}?offsetMark=*&pageSize=N&api_key=...
|
|
31
|
+
GET https://api.govinfo.gov/packages/{packageId}/summary?api_key=...
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Same api.data.gov key family as Congress.gov (`US_ELI_GOVINFO_API_KEY`,
|
|
35
|
+
falling back to `US_ELI_API_KEY`, falling back to `DEMO_KEY`). Covers US Code,
|
|
36
|
+
Statutes at Large, Federal Register, and CFR collections - full enacted-law
|
|
37
|
+
text, not just the legislative process `us_search_bills`/`us_get_bill` track.
|
|
38
|
+
|
|
39
|
+
New tools:
|
|
40
|
+
|
|
41
|
+
- `us_list_code_packages(collection, start_date, limit=20)` - list packages
|
|
42
|
+
in a GovInfo collection (e.g. `"USCODE"`, `"CFR"`, `"FR"`) modified since a
|
|
43
|
+
date.
|
|
44
|
+
- `us_get_code_package(package_id)` - metadata + content-format download
|
|
45
|
+
links (pdf/xml/txt) for one package.
|
|
46
|
+
|
|
47
|
+
Both tools follow the exact conventions already established for
|
|
48
|
+
`us_search_bills`/`us_get_bill`: `ToolAnnotations(readOnlyHint=True, ...)`,
|
|
49
|
+
`ToolError` with the same three codes, `AuditLogger`/`hash_input`/`timer()`
|
|
50
|
+
audit logging to the same JSONL file, `HttpCache`-backed caching via a new
|
|
51
|
+
`GovInfoClient` (`govinfo_client.py`, mirroring `CongressClient`'s
|
|
52
|
+
retry/backoff logic), and a `GovInfoPackage`/citation-contract dataclass pair
|
|
53
|
+
in `models.py`/`citations.py` parallel to `Bill`/`Citation`.
|
|
54
|
+
|
|
55
|
+
**Known transient issue, not a code defect**: `tests/test_govinfo_smoke.py`
|
|
56
|
+
hit a `429 Too Many Requests` on `DEMO_KEY` during this session, because the
|
|
57
|
+
same shared key was hammered repeatedly across several concurrent discovery
|
|
58
|
+
probes earlier in the day. `DEMO_KEY`'s rate limit resets on its own; this is
|
|
59
|
+
not evidence of a broken endpoint (the 400/500 errors seen earlier in
|
|
60
|
+
discovery were a URL-shape issue, since fixed - see the request shapes
|
|
61
|
+
above, both live-verified with a 200 once the rate limit was clear).
|
|
62
|
+
|
|
63
|
+
Version bumped 0.1.0 -> 0.2.0 (minor, per semver: new backward-compatible
|
|
64
|
+
tools, no breaking changes to `us_search_bills`/`us_get_bill`).
|
|
65
|
+
|
|
66
|
+
## Why this connector originally stopped at Congress.gov bills
|
|
67
|
+
|
|
68
|
+
The US legal-data landscape is more fragmented than the EU/Brazil pattern
|
|
69
|
+
this fleet otherwise follows - there is no single agency that owns
|
|
70
|
+
legislation + case law end to end (compare Finlex, or NeuRIS in Germany).
|
|
71
|
+
Three separate, already-mature pieces exist:
|
|
72
|
+
|
|
73
|
+
1. **Congress.gov** (this connector) - the legislative process, confirmed
|
|
74
|
+
live with `DEMO_KEY`, JSON, stable per-bill URL. Building this first is
|
|
75
|
+
the highest-value, lowest-effort slice.
|
|
76
|
+
2. **GovInfo** - enacted law text, same api.data.gov key family, separate
|
|
77
|
+
package/granule identifier scheme. Natural v0.2 feature for this repo -
|
|
78
|
+
not built in this original pass (kept the first release reviewable);
|
|
79
|
+
built in the v0.2.0 update above.
|
|
80
|
+
3. **CourtListener / Free Law Project** (case law) - `blakeox/courtlistener-mcp`
|
|
81
|
+
(MIT) and `john-walkoe/courtlistener_citations_mcp` (MIT) already exist and
|
|
82
|
+
are reasonably mature. A live-probe in an earlier sweep (2026-07-04) found
|
|
83
|
+
that CourtListener's citation-validation logic lives server-side (requires
|
|
84
|
+
a token + network call, breaking the zero-cloud pattern this fleet
|
|
85
|
+
otherwise favors); the one genuinely portable piece - a Jaccard
|
|
86
|
+
name-mismatch heuristic - was already ported into `citation-grounding-pl`
|
|
87
|
+
v2.1. Building a third CourtListener wrapper here would duplicate two
|
|
88
|
+
existing MIT projects instead of filling a real gap.
|
|
89
|
+
|
|
90
|
+
## Caselaw Access Project (case.law) - discontinued as a live API
|
|
91
|
+
|
|
92
|
+
Harvard's Caselaw Access Project shut down its own API and search in March
|
|
93
|
+
2024 (Harvard Library Innovation Lab blog, 2024-03-26) after the licensing
|
|
94
|
+
restriction from the original Ravel Law/LexisNexis agreement expired. The raw
|
|
95
|
+
bulk data (6.6M cases, CC0) now lives as a static Parquet dataset on Hugging
|
|
96
|
+
Face; the live search/API layer was handed to CourtListener. There is no
|
|
97
|
+
separate "CAP connector" left to build - it is the same CourtListener
|
|
98
|
+
ecosystem referenced above.
|
|
99
|
+
|
|
100
|
+
## DEMO_KEY caveat
|
|
101
|
+
|
|
102
|
+
`DEMO_KEY` works for both Congress.gov and GovInfo (both api.data.gov-hosted)
|
|
103
|
+
but is rate-limited and shared across every user of the public docs example -
|
|
104
|
+
fine for development, not for production traffic. Set `US_ELI_API_KEY` to
|
|
105
|
+
your own free key before real use.
|
us_eli_mcp-0.3.0/LICENSE
ADDED
|
@@ -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,112 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: us-eli-mcp
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: MCP server for US law: bills (Congress.gov), US Code (GovInfo), Federal Register, case law (CourtListener), eCFR - with verifiable citations.
|
|
5
|
+
Project-URL: Repository, https://github.com/matematicsolutions/us-eli-mcp
|
|
6
|
+
Project-URL: Issues, https://github.com/matematicsolutions/us-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: congress,law,legaltech,mcp,usa
|
|
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
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
27
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
28
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: ruff>=0.5; extra == 'dev'
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
# us-eli-mcp
|
|
33
|
+
|
|
34
|
+
<!-- mcp-name: io.github.matematicsolutions/us-eli-mcp -->
|
|
35
|
+
|
|
36
|
+
MCP server for US law with verifiable citations. Five sources behind ten
|
|
37
|
+
read-only tools:
|
|
38
|
+
|
|
39
|
+
- **Congress.gov API** - the federal legislative *process*: bills as they move
|
|
40
|
+
through committees and floor votes.
|
|
41
|
+
- **GovInfo API** - enacted law text as published packages: US Code, Statutes
|
|
42
|
+
at Large, CFR annual editions, Federal Register issues.
|
|
43
|
+
- **Federal Register API** - full-text search over 1,003,504 FR documents
|
|
44
|
+
(1994-2026, live-verified 2026-07-07), including 8,513 presidential
|
|
45
|
+
documents (1,550 executive orders). Keyless.
|
|
46
|
+
- **CourtListener search API** - full-text search over 8,294,123 court
|
|
47
|
+
opinions (live-verified 2026-07-07). The headline value is STATE case law
|
|
48
|
+
(California, New York, Texas, ...), which no federal source covers. Keyless,
|
|
49
|
+
~5 requests/min anonymous.
|
|
50
|
+
- **eCFR API** - the CURRENT Code of Federal Regulations: section-level
|
|
51
|
+
full-text search over 412,846 sections plus per-section amendment history.
|
|
52
|
+
Keyless.
|
|
53
|
+
|
|
54
|
+
## What this is not
|
|
55
|
+
|
|
56
|
+
- **State legislation** (all 50 states) - see [LegiScan](https://legiscan.com/legiscan),
|
|
57
|
+
a free-tier aggregator (30,000 queries/month) not wrapped here.
|
|
58
|
+
- **A federal case-law workhorse** - for heavy federal case-law research the
|
|
59
|
+
mature MIT-licensed wrappers
|
|
60
|
+
([blakeox/courtlistener-mcp](https://github.com/blakeox/courtlistener-mcp),
|
|
61
|
+
john-walkoe/courtlistener_citations_mcp) remain the recommendation; the
|
|
62
|
+
case-law tools here exist primarily for state courts. See SOURCES.md.
|
|
63
|
+
|
|
64
|
+
## Tools
|
|
65
|
+
|
|
66
|
+
| Tool | Purpose |
|
|
67
|
+
|---|---|
|
|
68
|
+
| `us_search_bills` | List bills by congress (e.g. `118`) and type (`hr`, `s`, `hres`, ...) |
|
|
69
|
+
| `us_get_bill` | Full detail + latest action for one bill |
|
|
70
|
+
| `us_list_code_packages` | List GovInfo packages in a collection (`USCODE`, `CFR`, `FR`, `STATUTE`) |
|
|
71
|
+
| `us_get_code_package` | Metadata + download links (PDF/XML/TXT) for one package |
|
|
72
|
+
| `us_search_federal_register` | Full-text search over FR documents; filter rules, notices, executive orders |
|
|
73
|
+
| `us_get_federal_register_doc` | One FR document with its official citation (e.g. `91 FR 41591`) |
|
|
74
|
+
| `us_search_case_law` | Full-text search over 8M+ opinions; `court` filter (e.g. `cal`, `ny`, `scotus`) |
|
|
75
|
+
| `us_get_case` | One opinion cluster by `cluster_id` |
|
|
76
|
+
| `us_search_cfr_sections` | Full-text search over the current CFR (eCFR) |
|
|
77
|
+
| `us_get_cfr_section_history` | Amendment history of one CFR section (e.g. 15 CFR 744.3) |
|
|
78
|
+
|
|
79
|
+
Every response carries `lex_uri` (a resolvable API URL), `human_readable_citation`
|
|
80
|
+
(the official convention: `"H.R. 1, 118th Congress"`, `"91 FR 41591"`,
|
|
81
|
+
`"People v. Miranda-Guerrero, 519 P.3d 1004 (California Supreme Court 2022)"`,
|
|
82
|
+
`"15 CFR § 744.3"`) and `source_url` (the public page). Reporter citations are
|
|
83
|
+
taken verbatim from the source and never fabricated; when none exists the
|
|
84
|
+
docket number is used instead.
|
|
85
|
+
|
|
86
|
+
## Install
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
pip install us-eli-mcp
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Configuration
|
|
93
|
+
|
|
94
|
+
| Env var | Default |
|
|
95
|
+
|---|---|
|
|
96
|
+
| `US_ELI_API_KEY` | `DEMO_KEY` (shared, low rate limit - get your own free key at [api.congress.gov/sign-up](https://api.congress.gov/sign-up/)) |
|
|
97
|
+
| `US_ELI_GOVINFO_API_KEY` | reuses `US_ELI_API_KEY` (same api.data.gov key family) |
|
|
98
|
+
| `US_ELI_CACHE_DIR` | `~/.matematic/cache/us-eli` |
|
|
99
|
+
| `US_ELI_AUDIT_DIR` | `~/.matematic/audit` |
|
|
100
|
+
| `US_ELI_BASE_URL` | `https://api.congress.gov/v3` |
|
|
101
|
+
| `US_ELI_GOVINFO_BASE_URL` | `https://api.govinfo.gov` |
|
|
102
|
+
| `US_ELI_FR_BASE_URL` | `https://www.federalregister.gov/api/v1` (keyless) |
|
|
103
|
+
| `US_ELI_COURTLISTENER_BASE_URL` | `https://www.courtlistener.com/api/rest/v4` (keyless) |
|
|
104
|
+
| `US_ELI_ECFR_BASE_URL` | `https://www.ecfr.gov/api` (keyless) |
|
|
105
|
+
|
|
106
|
+
The Federal Register, CourtListener and eCFR tools need no key at all.
|
|
107
|
+
|
|
108
|
+
## License
|
|
109
|
+
|
|
110
|
+
Apache-2.0 (code). Congress.gov, GovInfo, Federal Register and eCFR data are
|
|
111
|
+
US government works (public domain). CourtListener data is provided by the
|
|
112
|
+
Free Law Project.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# us-eli-mcp
|
|
2
|
+
|
|
3
|
+
<!-- mcp-name: io.github.matematicsolutions/us-eli-mcp -->
|
|
4
|
+
|
|
5
|
+
MCP server for US law with verifiable citations. Five sources behind ten
|
|
6
|
+
read-only tools:
|
|
7
|
+
|
|
8
|
+
- **Congress.gov API** - the federal legislative *process*: bills as they move
|
|
9
|
+
through committees and floor votes.
|
|
10
|
+
- **GovInfo API** - enacted law text as published packages: US Code, Statutes
|
|
11
|
+
at Large, CFR annual editions, Federal Register issues.
|
|
12
|
+
- **Federal Register API** - full-text search over 1,003,504 FR documents
|
|
13
|
+
(1994-2026, live-verified 2026-07-07), including 8,513 presidential
|
|
14
|
+
documents (1,550 executive orders). Keyless.
|
|
15
|
+
- **CourtListener search API** - full-text search over 8,294,123 court
|
|
16
|
+
opinions (live-verified 2026-07-07). The headline value is STATE case law
|
|
17
|
+
(California, New York, Texas, ...), which no federal source covers. Keyless,
|
|
18
|
+
~5 requests/min anonymous.
|
|
19
|
+
- **eCFR API** - the CURRENT Code of Federal Regulations: section-level
|
|
20
|
+
full-text search over 412,846 sections plus per-section amendment history.
|
|
21
|
+
Keyless.
|
|
22
|
+
|
|
23
|
+
## What this is not
|
|
24
|
+
|
|
25
|
+
- **State legislation** (all 50 states) - see [LegiScan](https://legiscan.com/legiscan),
|
|
26
|
+
a free-tier aggregator (30,000 queries/month) not wrapped here.
|
|
27
|
+
- **A federal case-law workhorse** - for heavy federal case-law research the
|
|
28
|
+
mature MIT-licensed wrappers
|
|
29
|
+
([blakeox/courtlistener-mcp](https://github.com/blakeox/courtlistener-mcp),
|
|
30
|
+
john-walkoe/courtlistener_citations_mcp) remain the recommendation; the
|
|
31
|
+
case-law tools here exist primarily for state courts. See SOURCES.md.
|
|
32
|
+
|
|
33
|
+
## Tools
|
|
34
|
+
|
|
35
|
+
| Tool | Purpose |
|
|
36
|
+
|---|---|
|
|
37
|
+
| `us_search_bills` | List bills by congress (e.g. `118`) and type (`hr`, `s`, `hres`, ...) |
|
|
38
|
+
| `us_get_bill` | Full detail + latest action for one bill |
|
|
39
|
+
| `us_list_code_packages` | List GovInfo packages in a collection (`USCODE`, `CFR`, `FR`, `STATUTE`) |
|
|
40
|
+
| `us_get_code_package` | Metadata + download links (PDF/XML/TXT) for one package |
|
|
41
|
+
| `us_search_federal_register` | Full-text search over FR documents; filter rules, notices, executive orders |
|
|
42
|
+
| `us_get_federal_register_doc` | One FR document with its official citation (e.g. `91 FR 41591`) |
|
|
43
|
+
| `us_search_case_law` | Full-text search over 8M+ opinions; `court` filter (e.g. `cal`, `ny`, `scotus`) |
|
|
44
|
+
| `us_get_case` | One opinion cluster by `cluster_id` |
|
|
45
|
+
| `us_search_cfr_sections` | Full-text search over the current CFR (eCFR) |
|
|
46
|
+
| `us_get_cfr_section_history` | Amendment history of one CFR section (e.g. 15 CFR 744.3) |
|
|
47
|
+
|
|
48
|
+
Every response carries `lex_uri` (a resolvable API URL), `human_readable_citation`
|
|
49
|
+
(the official convention: `"H.R. 1, 118th Congress"`, `"91 FR 41591"`,
|
|
50
|
+
`"People v. Miranda-Guerrero, 519 P.3d 1004 (California Supreme Court 2022)"`,
|
|
51
|
+
`"15 CFR § 744.3"`) and `source_url` (the public page). Reporter citations are
|
|
52
|
+
taken verbatim from the source and never fabricated; when none exists the
|
|
53
|
+
docket number is used instead.
|
|
54
|
+
|
|
55
|
+
## Install
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install us-eli-mcp
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Configuration
|
|
62
|
+
|
|
63
|
+
| Env var | Default |
|
|
64
|
+
|---|---|
|
|
65
|
+
| `US_ELI_API_KEY` | `DEMO_KEY` (shared, low rate limit - get your own free key at [api.congress.gov/sign-up](https://api.congress.gov/sign-up/)) |
|
|
66
|
+
| `US_ELI_GOVINFO_API_KEY` | reuses `US_ELI_API_KEY` (same api.data.gov key family) |
|
|
67
|
+
| `US_ELI_CACHE_DIR` | `~/.matematic/cache/us-eli` |
|
|
68
|
+
| `US_ELI_AUDIT_DIR` | `~/.matematic/audit` |
|
|
69
|
+
| `US_ELI_BASE_URL` | `https://api.congress.gov/v3` |
|
|
70
|
+
| `US_ELI_GOVINFO_BASE_URL` | `https://api.govinfo.gov` |
|
|
71
|
+
| `US_ELI_FR_BASE_URL` | `https://www.federalregister.gov/api/v1` (keyless) |
|
|
72
|
+
| `US_ELI_COURTLISTENER_BASE_URL` | `https://www.courtlistener.com/api/rest/v4` (keyless) |
|
|
73
|
+
| `US_ELI_ECFR_BASE_URL` | `https://www.ecfr.gov/api` (keyless) |
|
|
74
|
+
|
|
75
|
+
The Federal Register, CourtListener and eCFR tools need no key at all.
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
Apache-2.0 (code). Congress.gov, GovInfo, Federal Register and eCFR data are
|
|
80
|
+
US government works (public domain). CourtListener data is provided by the
|
|
81
|
+
Free Law Project.
|