openstates-mcp-server 0.1.1
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.
- package/CLAUDE.md +397 -0
- package/Dockerfile +99 -0
- package/LICENSE +201 -0
- package/README.md +324 -0
- package/changelog/0.1.x/0.1.0.md +23 -0
- package/changelog/0.1.x/0.1.1.md +29 -0
- package/changelog/template.md +119 -0
- package/dist/config/server-config.d.ts +13 -0
- package/dist/config/server-config.d.ts.map +1 -0
- package/dist/config/server-config.js +19 -0
- package/dist/config/server-config.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +50 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/bill-research.prompt.d.ts +11 -0
- package/dist/mcp-server/prompts/definitions/bill-research.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/bill-research.prompt.js +65 -0
- package/dist/mcp-server/prompts/definitions/bill-research.prompt.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/legislator-profile.prompt.d.ts +10 -0
- package/dist/mcp-server/prompts/definitions/legislator-profile.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/legislator-profile.prompt.js +55 -0
- package/dist/mcp-server/prompts/definitions/legislator-profile.prompt.js.map +1 -0
- package/dist/mcp-server/resources/definitions/jurisdiction.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/jurisdiction.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/jurisdiction.resource.js +60 -0
- package/dist/mcp-server/resources/definitions/jurisdiction.resource.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-bill.tool.d.ts +121 -0
- package/dist/mcp-server/tools/definitions/get-bill.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-bill.tool.js +319 -0
- package/dist/mcp-server/tools/definitions/get-bill.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-committee.tool.d.ts +30 -0
- package/dist/mcp-server/tools/definitions/get-committee.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-committee.tool.js +89 -0
- package/dist/mcp-server/tools/definitions/get-committee.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-event.tool.d.ts +65 -0
- package/dist/mcp-server/tools/definitions/get-event.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-event.tool.js +231 -0
- package/dist/mcp-server/tools/definitions/get-event.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-jurisdiction.tool.d.ts +34 -0
- package/dist/mcp-server/tools/definitions/get-jurisdiction.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-jurisdiction.tool.js +99 -0
- package/dist/mcp-server/tools/definitions/get-jurisdiction.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-legislators-by-location.tool.d.ts +53 -0
- package/dist/mcp-server/tools/definitions/get-legislators-by-location.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-legislators-by-location.tool.js +156 -0
- package/dist/mcp-server/tools/definitions/get-legislators-by-location.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/list-jurisdictions.tool.d.ts +42 -0
- package/dist/mcp-server/tools/definitions/list-jurisdictions.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/list-jurisdictions.tool.js +110 -0
- package/dist/mcp-server/tools/definitions/list-jurisdictions.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-bills.tool.d.ts +102 -0
- package/dist/mcp-server/tools/definitions/search-bills.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-bills.tool.js +285 -0
- package/dist/mcp-server/tools/definitions/search-bills.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-committees.tool.d.ts +44 -0
- package/dist/mcp-server/tools/definitions/search-committees.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-committees.tool.js +127 -0
- package/dist/mcp-server/tools/definitions/search-committees.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-events.tool.d.ts +62 -0
- package/dist/mcp-server/tools/definitions/search-events.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-events.tool.js +198 -0
- package/dist/mcp-server/tools/definitions/search-events.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-people.tool.d.ts +64 -0
- package/dist/mcp-server/tools/definitions/search-people.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-people.tool.js +193 -0
- package/dist/mcp-server/tools/definitions/search-people.tool.js.map +1 -0
- package/dist/services/openstates/openstates-service.d.ts +30 -0
- package/dist/services/openstates/openstates-service.d.ts.map +1 -0
- package/dist/services/openstates/openstates-service.js +246 -0
- package/dist/services/openstates/openstates-service.js.map +1 -0
- package/dist/services/openstates/types.d.ts +324 -0
- package/dist/services/openstates/types.d.ts.map +1 -0
- package/dist/services/openstates/types.js +6 -0
- package/dist/services/openstates/types.js.map +1 -0
- package/package.json +90 -0
- package/server.json +99 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
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
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2025 Casey Hand @cyanheads
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>openstates-mcp-server</h1>
|
|
3
|
+
<p><b>Search bills, legislators, committees, and events across all 50 US states, DC, and Puerto Rico via MCP. STDIO or Streamable HTTP.</b>
|
|
4
|
+
<div>10 Tools • 1 Resource • 2 Prompts</div>
|
|
5
|
+
</p>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div align="center">
|
|
9
|
+
|
|
10
|
+
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/openstates-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/openstates-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
|
+
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div align="center">
|
|
15
|
+
|
|
16
|
+
[](https://github.com/cyanheads/openstates-mcp-server/releases/latest/download/openstates-mcp-server.mcpb) [](https://cursor.com/en/install-mcp?name=openstates-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm9wZW5zdGF0ZXMtbWNwLXNlcnZlciJdLCJlbnYiOnsiT1BFTlNUQVRFU19BUElfS0VZIjoieW91ci1hcGkta2V5In19) [](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22openstates-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22openstates-mcp-server%22%5D%2C%22env%22%3A%7B%22OPENSTATES_API_KEY%22%3A%22your-api-key%22%7D%7D)
|
|
17
|
+
|
|
18
|
+
[](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Tools
|
|
25
|
+
|
|
26
|
+
10 tools covering the full Open States v3 API surface — bills, legislators, committees, events, and jurisdictions:
|
|
27
|
+
|
|
28
|
+
| Tool | Description |
|
|
29
|
+
|:---|:---|
|
|
30
|
+
| `openstates_search_bills` | Search state legislative bills across all covered US jurisdictions with full-text search, jurisdiction/session filtering, subject tags, and sponsor lookups |
|
|
31
|
+
| `openstates_get_bill` | Fetch full detail for a specific bill by OCD ID or three-part path (jurisdiction + session + bill_id) |
|
|
32
|
+
| `openstates_search_people` | Search state legislators and officials by name, jurisdiction, chamber, district, or party |
|
|
33
|
+
| `openstates_get_legislators_by_location` | Find all legislators representing a geographic coordinate (latitude/longitude) |
|
|
34
|
+
| `openstates_search_committees` | List committees for a jurisdiction (experimental — not all states have coverage) |
|
|
35
|
+
| `openstates_get_committee` | Fetch committee detail by OCD organization ID, with optional membership roster |
|
|
36
|
+
| `openstates_search_events` | Search hearings, floor sessions, and committee meetings (experimental) |
|
|
37
|
+
| `openstates_get_event` | Fetch full event detail including agenda, participants, and media links |
|
|
38
|
+
| `openstates_list_jurisdictions` | List all 52 jurisdictions covered by Open States with session identifiers and coverage metadata |
|
|
39
|
+
| `openstates_get_jurisdiction` | Fetch full metadata for a specific jurisdiction including all legislative sessions and their identifiers |
|
|
40
|
+
|
|
41
|
+
### `openstates_search_bills`
|
|
42
|
+
|
|
43
|
+
Search state legislative bills with rich filtering and inline related data.
|
|
44
|
+
|
|
45
|
+
- Full-text search across bill titles, abstracts, and text (`q`)
|
|
46
|
+
- Filter by jurisdiction (state name, two-letter abbreviation, or OCD-ID), session, chamber, classification, subject tags, and sponsor
|
|
47
|
+
- Sort by latest action, first action, or update time — use `sort=latest_action_desc` for bills currently moving through the legislature
|
|
48
|
+
- `include` parameter requests sponsorships, actions, votes, abstracts, versions, and related bills inline — eliminates follow-up `openstates_get_bill` calls for most research workflows
|
|
49
|
+
- `action_since` and `updated_since` date filters for change-tracking
|
|
50
|
+
- Pagination up to 20 results per page
|
|
51
|
+
- Empty-result recovery: echoes applied filters and suggests how to broaden
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### `openstates_get_bill`
|
|
56
|
+
|
|
57
|
+
Fetch complete bill detail by OCD ID or path lookup.
|
|
58
|
+
|
|
59
|
+
- Two lookup modes: `openstates_id` (OCD bill ID from search results, preferred) or the three-part path `jurisdiction + session + bill_id`
|
|
60
|
+
- Accepts bill identifiers in legislature format (e.g., `HB 1000`, `SB 42`)
|
|
61
|
+
- `include=votes` returns full vote tallies and per-legislator positions
|
|
62
|
+
- `include=versions,documents` provides links to bill text and fiscal notes
|
|
63
|
+
- Sponsors carry linked person records (OCD person ID + name) when available
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
### `openstates_search_people`
|
|
68
|
+
|
|
69
|
+
Search legislators and officials by name, jurisdiction, chamber, or district.
|
|
70
|
+
|
|
71
|
+
- Case-insensitive substring matching on name
|
|
72
|
+
- `org_classification` targets a specific chamber: `upper` (Senate), `lower` (House/Assembly), `legislature` (all), `executive` (governors and executive officials)
|
|
73
|
+
- `include=offices` returns phone, fax, and mailing address
|
|
74
|
+
- `include=links` returns website and social media links
|
|
75
|
+
- Strongly recommended to provide `jurisdiction` — omitting it returns legislators across all states
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
### `openstates_get_legislators_by_location`
|
|
80
|
+
|
|
81
|
+
Find all state legislators representing a geographic coordinate.
|
|
82
|
+
|
|
83
|
+
- Pass decimal-degree latitude/longitude to get state senators and representatives for that location
|
|
84
|
+
- Useful for constituent-to-representative matching, address-based policy research, and electoral boundary analysis
|
|
85
|
+
- Does not geocode addresses — the caller must provide coordinates
|
|
86
|
+
- Returns a coverage note when no legislators are found (e.g., coordinates outside US boundaries)
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
### `openstates_list_jurisdictions` and `openstates_get_jurisdiction`
|
|
91
|
+
|
|
92
|
+
Discover and look up jurisdiction coverage metadata.
|
|
93
|
+
|
|
94
|
+
- `openstates_list_jurisdictions` returns all 52 jurisdictions (50 states + DC + Puerto Rico) in a single call with `per_page=52` (the default)
|
|
95
|
+
- `include=legislative_sessions` returns all historical and current session identifiers — required before filtering bill searches by session, since formats vary widely by state (e.g., `2025`, `2025-2026`, `2025rs`, `2025s1`)
|
|
96
|
+
- `openstates_get_jurisdiction` fetches one jurisdiction by OCD-ID, state name, or two-letter abbreviation
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### Committee and event tools (experimental)
|
|
101
|
+
|
|
102
|
+
`openstates_search_committees`, `openstates_get_committee`, `openstates_search_events`, and `openstates_get_event` are experimental — Open States is actively working to restore committee support and most states do not publish event data. Empty results may indicate the state lacks data, not that no committees or events exist. All four tools include a `coverage_note` in their output documenting this limitation.
|
|
103
|
+
|
|
104
|
+
## Resources and prompts
|
|
105
|
+
|
|
106
|
+
| Type | Name | Description |
|
|
107
|
+
|:---|:---|:---|
|
|
108
|
+
| Resource | `openstates://jurisdiction/{jurisdiction_id}` | Jurisdiction metadata including current sessions, coverage dates, and bill/people update timestamps |
|
|
109
|
+
| Prompt | `openstates_bill_research` | Structured framework for analyzing a state bill: summary, sponsors, committee referrals, action timeline, vote record, and related legislation |
|
|
110
|
+
| Prompt | `openstates_legislator_profile` | Research framework for profiling a legislator: sponsored bills, committee assignments, voting record, and contact details |
|
|
111
|
+
|
|
112
|
+
All resource data is also reachable via tools. Use `openstates_get_jurisdiction` for programmatic jurisdiction lookups; the resource is useful for injecting jurisdiction context as stable reference material.
|
|
113
|
+
|
|
114
|
+
## Features
|
|
115
|
+
|
|
116
|
+
Built on [`@cyanheads/mcp-ts-core`](https://www.npmjs.com/package/@cyanheads/mcp-ts-core):
|
|
117
|
+
|
|
118
|
+
- Declarative tool, resource, and prompt definitions — single file per primitive, framework handles registration and validation
|
|
119
|
+
- Unified error handling — handlers throw, framework catches, classifies, and formats
|
|
120
|
+
- Pluggable auth: `none`, `jwt`, `oauth`
|
|
121
|
+
- Swappable storage backends: `in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`
|
|
122
|
+
- Structured logging with optional OpenTelemetry tracing
|
|
123
|
+
- STDIO and Streamable HTTP transports
|
|
124
|
+
|
|
125
|
+
Open States-specific:
|
|
126
|
+
|
|
127
|
+
- Full Open States v3 API coverage: bills, people, committees, events, and jurisdictions
|
|
128
|
+
- Dual lookup modes on bill and committee fetchers (OCD ID or structured path)
|
|
129
|
+
- Geo-based legislator lookup via the Open States people-by-geo endpoint
|
|
130
|
+
- Server-level instructions prime the agent with session discovery workflow and `include` parameter strategy before any tool calls
|
|
131
|
+
|
|
132
|
+
Agent-friendly output:
|
|
133
|
+
|
|
134
|
+
- Empty-result recovery: tools echo the applied filters and suggest how to broaden when no results are returned
|
|
135
|
+
- Experimental coverage notes on committee and event tools — agents can surface these to users rather than returning silent empty results
|
|
136
|
+
- `include` parameter pattern across all search and get tools — avoids N+1 follow-up calls for common research workflows (e.g., `include=sponsorships,actions` on `openstates_search_bills`)
|
|
137
|
+
|
|
138
|
+
## Getting started
|
|
139
|
+
|
|
140
|
+
Requires an Open States API key — register free at [open.pluralpolicy.com](https://open.pluralpolicy.com/accounts/profile/).
|
|
141
|
+
|
|
142
|
+
Add the following to your MCP client configuration file:
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"mcpServers": {
|
|
147
|
+
"openstates": {
|
|
148
|
+
"type": "stdio",
|
|
149
|
+
"command": "bunx",
|
|
150
|
+
"args": ["openstates-mcp-server@latest"],
|
|
151
|
+
"env": {
|
|
152
|
+
"MCP_TRANSPORT_TYPE": "stdio",
|
|
153
|
+
"MCP_LOG_LEVEL": "info",
|
|
154
|
+
"OPENSTATES_API_KEY": "your-api-key"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Or with npx (no Bun required):
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"mcpServers": {
|
|
166
|
+
"openstates": {
|
|
167
|
+
"type": "stdio",
|
|
168
|
+
"command": "npx",
|
|
169
|
+
"args": ["-y", "openstates-mcp-server@latest"],
|
|
170
|
+
"env": {
|
|
171
|
+
"MCP_TRANSPORT_TYPE": "stdio",
|
|
172
|
+
"MCP_LOG_LEVEL": "info",
|
|
173
|
+
"OPENSTATES_API_KEY": "your-api-key"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Or with Docker:
|
|
181
|
+
|
|
182
|
+
```json
|
|
183
|
+
{
|
|
184
|
+
"mcpServers": {
|
|
185
|
+
"openstates": {
|
|
186
|
+
"type": "stdio",
|
|
187
|
+
"command": "docker",
|
|
188
|
+
"args": [
|
|
189
|
+
"run", "-i", "--rm",
|
|
190
|
+
"-e", "MCP_TRANSPORT_TYPE=stdio",
|
|
191
|
+
"-e", "OPENSTATES_API_KEY=your-api-key",
|
|
192
|
+
"ghcr.io/cyanheads/openstates-mcp-server:latest"
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
For Streamable HTTP, set the transport and start the server:
|
|
200
|
+
|
|
201
|
+
```sh
|
|
202
|
+
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 OPENSTATES_API_KEY=your-key bun run start:http
|
|
203
|
+
# Server listens at http://localhost:3010/mcp
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Prerequisites
|
|
207
|
+
|
|
208
|
+
- [Bun v1.3.0](https://bun.sh/) or higher (or Node.js v24+).
|
|
209
|
+
- An Open States API key — register free at [open.pluralpolicy.com](https://open.pluralpolicy.com/accounts/profile/).
|
|
210
|
+
|
|
211
|
+
### Installation
|
|
212
|
+
|
|
213
|
+
1. **Clone the repository:**
|
|
214
|
+
|
|
215
|
+
```sh
|
|
216
|
+
git clone https://github.com/cyanheads/openstates-mcp-server.git
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
2. **Navigate into the directory:**
|
|
220
|
+
|
|
221
|
+
```sh
|
|
222
|
+
cd openstates-mcp-server
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
3. **Install dependencies:**
|
|
226
|
+
|
|
227
|
+
```sh
|
|
228
|
+
bun install
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
4. **Configure environment:**
|
|
232
|
+
|
|
233
|
+
```sh
|
|
234
|
+
cp .env.example .env
|
|
235
|
+
# edit .env and set OPENSTATES_API_KEY
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## Configuration
|
|
239
|
+
|
|
240
|
+
All configuration is validated at startup via Zod schemas in `src/config/server-config.ts`. Key environment variables:
|
|
241
|
+
|
|
242
|
+
| Variable | Description | Default |
|
|
243
|
+
|:---|:---|:---|
|
|
244
|
+
| `OPENSTATES_API_KEY` | **Required.** Open States API key from [open.pluralpolicy.com](https://open.pluralpolicy.com/accounts/profile/). | — |
|
|
245
|
+
| `OPENSTATES_API_BASE_URL` | Open States API base URL. | `https://v3.openstates.org` |
|
|
246
|
+
| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
|
|
247
|
+
| `MCP_HTTP_PORT` | HTTP server port. | `3010` |
|
|
248
|
+
| `MCP_HTTP_ENDPOINT_PATH` | HTTP endpoint path. | `/mcp` |
|
|
249
|
+
| `MCP_PUBLIC_URL` | Public origin override for TLS-terminating reverse-proxy deployments. | none |
|
|
250
|
+
| `MCP_AUTH_MODE` | Auth mode: `none`, `jwt`, or `oauth`. | `none` |
|
|
251
|
+
| `MCP_LOG_LEVEL` | Log level (`debug`, `info`, `notice`, `warning`, `error`). | `info` |
|
|
252
|
+
| `MCP_GC_PRESSURE_INTERVAL_MS` | Opt-in Bun-only forced-GC interval (ms). Try `60000` if heap grows under sustained HTTP load. | `0` (disabled) |
|
|
253
|
+
| `LOGS_DIR` | Directory for log files (Node.js only). | `<project-root>/logs` |
|
|
254
|
+
| `STORAGE_PROVIDER_TYPE` | Storage backend: `in-memory`, `filesystem`, `supabase`, `cloudflare-kv/r2/d1`. | `in-memory` |
|
|
255
|
+
| `OTEL_ENABLED` | Enable OpenTelemetry instrumentation. | `false` |
|
|
256
|
+
|
|
257
|
+
See [`.env.example`](./.env.example) for the full list of optional overrides.
|
|
258
|
+
|
|
259
|
+
## Running the server
|
|
260
|
+
|
|
261
|
+
### Local development
|
|
262
|
+
|
|
263
|
+
- **Build and run the production version:**
|
|
264
|
+
|
|
265
|
+
```sh
|
|
266
|
+
# One-time build
|
|
267
|
+
bun run rebuild
|
|
268
|
+
|
|
269
|
+
# Run the built server
|
|
270
|
+
bun run start:stdio
|
|
271
|
+
# or
|
|
272
|
+
bun run start:http
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
- **Run checks and tests:**
|
|
276
|
+
|
|
277
|
+
```sh
|
|
278
|
+
bun run devcheck # Lint, format, typecheck, security
|
|
279
|
+
bun run test # Vitest test suite
|
|
280
|
+
bun run lint:mcp # Validate MCP definitions against spec
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Docker
|
|
284
|
+
|
|
285
|
+
```sh
|
|
286
|
+
docker build -t openstates-mcp-server .
|
|
287
|
+
docker run --rm -e OPENSTATES_API_KEY=your-key -e MCP_TRANSPORT_TYPE=http -p 3010:3010 openstates-mcp-server
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to `/var/log/openstates-mcp-server`. OpenTelemetry peer dependencies are installed by default — build with `--build-arg OTEL_ENABLED=false` to omit them.
|
|
291
|
+
|
|
292
|
+
## Project structure
|
|
293
|
+
|
|
294
|
+
| Directory | Purpose |
|
|
295
|
+
|:---|:---|
|
|
296
|
+
| `src/index.ts` | `createApp()` entry point — registers tools, resources, prompts, and inits the Open States service. |
|
|
297
|
+
| `src/config` | Server-specific environment variable parsing and validation with Zod. |
|
|
298
|
+
| `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). Ten tools across bills, people, committees, events, and jurisdictions. |
|
|
299
|
+
| `src/mcp-server/resources` | Resource definitions. Jurisdiction metadata resource. |
|
|
300
|
+
| `src/mcp-server/prompts` | Prompt definitions. Bill research and legislator profile prompts. |
|
|
301
|
+
| `src/services/openstates` | Open States API v3 service layer — HTTP client, request handling, domain types. |
|
|
302
|
+
| `tests/` | Unit and integration tests mirroring `src/`. |
|
|
303
|
+
|
|
304
|
+
## Development guide
|
|
305
|
+
|
|
306
|
+
See [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:
|
|
307
|
+
|
|
308
|
+
- Handlers throw, framework catches — no `try/catch` in tool logic
|
|
309
|
+
- Use `ctx.log` for request-scoped logging, `ctx.state` for tenant-scoped storage
|
|
310
|
+
- Register new tools and resources via the arrays in `src/index.ts`
|
|
311
|
+
- Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
|
|
312
|
+
|
|
313
|
+
## Contributing
|
|
314
|
+
|
|
315
|
+
Issues and pull requests are welcome. Run checks and tests before submitting:
|
|
316
|
+
|
|
317
|
+
```sh
|
|
318
|
+
bun run devcheck
|
|
319
|
+
bun run test
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
## License
|
|
323
|
+
|
|
324
|
+
Apache-2.0 — see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Initial release — full Open States v3 API coverage: bills, legislators, committees, events, and jurisdictions for all 50 US states, DC, and Puerto Rico."
|
|
3
|
+
breaking: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 0.1.0 — 2026-05-23
|
|
7
|
+
|
|
8
|
+
## Added
|
|
9
|
+
|
|
10
|
+
- **`openstates_search_bills`** — full-text bill search with jurisdiction, session, chamber, subject, sponsor, and date filters; `include` parameter for inline sponsorships, actions, votes, abstracts, and versions
|
|
11
|
+
- **`openstates_get_bill`** — fetch full bill detail by OCD bill ID or three-part path (jurisdiction + session + bill_id); supports votes, actions, versions, documents, and related bills via `include`
|
|
12
|
+
- **`openstates_search_people`** — search state legislators and officials by name, jurisdiction, chamber, district, or party; `include=offices,links` for contact info and social links
|
|
13
|
+
- **`openstates_get_legislators_by_location`** — geo-based legislator lookup by decimal-degree latitude/longitude
|
|
14
|
+
- **`openstates_search_committees`** — list committees by jurisdiction and chamber (experimental)
|
|
15
|
+
- **`openstates_get_committee`** — fetch committee detail by OCD organization ID with optional membership roster (experimental)
|
|
16
|
+
- **`openstates_search_events`** — search hearings, floor sessions, and committee meetings with date range and agenda filters (experimental)
|
|
17
|
+
- **`openstates_get_event`** — fetch full event detail including agenda, participants, media, and documents (experimental)
|
|
18
|
+
- **`openstates_list_jurisdictions`** — list all 52 covered jurisdictions with coverage metadata; `include=legislative_sessions` for session identifiers
|
|
19
|
+
- **`openstates_get_jurisdiction`** — fetch full jurisdiction metadata by OCD-ID, state name, or two-letter abbreviation
|
|
20
|
+
- **`openstates://jurisdiction/{jurisdiction_id}`** resource — jurisdiction metadata for stable reference context in agent workflows
|
|
21
|
+
- **`openstates_bill_research`** prompt — structured framework for comprehensive bill analysis
|
|
22
|
+
- **`openstates_legislator_profile`** prompt — research framework for legislator profiling
|
|
23
|
+
- Server-level instructions prime the agent with session discovery workflow and `include` parameter strategy
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Initial public release — 10 tools, 1 resource, 2 prompts for US state legislature data via the Open States API v3."
|
|
3
|
+
breaking: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 0.1.1 — 2026-05-23
|
|
7
|
+
|
|
8
|
+
Initial public release of openstates-mcp-server.
|
|
9
|
+
|
|
10
|
+
## Added
|
|
11
|
+
|
|
12
|
+
- **`openstates_search_bills`** — full-text bill search with jurisdiction, session, chamber, subject, sponsor, and date filters; `include` parameter for inline sponsorships, actions, votes, abstracts, and versions
|
|
13
|
+
- **`openstates_get_bill`** — fetch full bill detail by OCD bill ID or three-part path (jurisdiction + session + bill_id)
|
|
14
|
+
- **`openstates_search_people`** — search state legislators and officials by name, jurisdiction, chamber, district, or party
|
|
15
|
+
- **`openstates_get_legislators_by_location`** — geo-based legislator lookup by decimal-degree latitude/longitude
|
|
16
|
+
- **`openstates_search_committees`** — list committees by jurisdiction and chamber (experimental)
|
|
17
|
+
- **`openstates_get_committee`** — fetch committee detail by OCD organization ID with optional membership roster (experimental)
|
|
18
|
+
- **`openstates_search_events`** — search hearings, floor sessions, and committee meetings with date range and agenda filters (experimental)
|
|
19
|
+
- **`openstates_get_event`** — fetch full event detail including agenda, participants, media, and documents (experimental)
|
|
20
|
+
- **`openstates_list_jurisdictions`** — list all 52 covered jurisdictions with coverage metadata
|
|
21
|
+
- **`openstates_get_jurisdiction`** — fetch full jurisdiction metadata by OCD-ID, state name, or two-letter abbreviation
|
|
22
|
+
- **`openstates://jurisdiction/{jurisdiction_id}`** resource — jurisdiction metadata for stable reference context in agent workflows
|
|
23
|
+
- **`openstates_bill_research`** prompt — structured framework for comprehensive bill analysis
|
|
24
|
+
- **`openstates_legislator_profile`** prompt — research framework for legislator profiling
|
|
25
|
+
- Server-level instructions prime the agent with session discovery workflow and `include` parameter strategy
|
|
26
|
+
|
|
27
|
+
## Dependencies
|
|
28
|
+
|
|
29
|
+
- `@cyanheads/mcp-ts-core` ^0.9.7
|