@cyanheads/congressgov-mcp-server 0.3.3
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 +270 -0
- package/Dockerfile +99 -0
- package/LICENSE +191 -0
- package/README.md +296 -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 +22 -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-analysis.prompt.d.ts +11 -0
- package/dist/mcp-server/prompts/definitions/bill-analysis.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/bill-analysis.prompt.js +36 -0
- package/dist/mcp-server/prompts/definitions/bill-analysis.prompt.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/legislative-research.prompt.d.ts +10 -0
- package/dist/mcp-server/prompts/definitions/legislative-research.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/legislative-research.prompt.js +47 -0
- package/dist/mcp-server/prompts/definitions/legislative-research.prompt.js.map +1 -0
- package/dist/mcp-server/resources/definitions/bill-types.resource.d.ts +8 -0
- package/dist/mcp-server/resources/definitions/bill-types.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/bill-types.resource.js +39 -0
- package/dist/mcp-server/resources/definitions/bill-types.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/bill.resource.d.ts +11 -0
- package/dist/mcp-server/resources/definitions/bill.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/bill.resource.js +31 -0
- package/dist/mcp-server/resources/definitions/bill.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/committee.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/committee.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/committee.resource.js +26 -0
- package/dist/mcp-server/resources/definitions/committee.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/current-congress.resource.d.ts +8 -0
- package/dist/mcp-server/resources/definitions/current-congress.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/current-congress.resource.js +18 -0
- package/dist/mcp-server/resources/definitions/current-congress.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/member.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/member.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/member.resource.js +21 -0
- package/dist/mcp-server/resources/definitions/member.resource.js.map +1 -0
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts +37 -0
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.js +105 -0
- package/dist/mcp-server/tools/definitions/bill-lookup.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts +23 -0
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.js +57 -0
- package/dist/mcp-server/tools/definitions/bill-summaries.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts +24 -0
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.js +70 -0
- package/dist/mcp-server/tools/definitions/committee-lookup.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts +22 -0
- package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/committee-reports.tool.js +80 -0
- package/dist/mcp-server/tools/definitions/committee-reports.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts +15 -0
- package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/crs-reports.tool.js +41 -0
- package/dist/mcp-server/tools/definitions/crs-reports.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts +17 -0
- package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/daily-record.tool.js +67 -0
- package/dist/mcp-server/tools/definitions/daily-record.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts +20 -0
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.js +55 -0
- package/dist/mcp-server/tools/definitions/enacted-laws.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts +21 -0
- package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/member-lookup.tool.js +86 -0
- package/dist/mcp-server/tools/definitions/member-lookup.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts +18 -0
- package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/roll-votes.tool.js +65 -0
- package/dist/mcp-server/tools/definitions/roll-votes.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts +21 -0
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.js +90 -0
- package/dist/mcp-server/tools/definitions/senate-nominations.tool.js.map +1 -0
- package/dist/mcp-server/tools/format-helpers.d.ts +12 -0
- package/dist/mcp-server/tools/format-helpers.d.ts.map +1 -0
- package/dist/mcp-server/tools/format-helpers.js +72 -0
- package/dist/mcp-server/tools/format-helpers.js.map +1 -0
- package/dist/services/congress-api/congress-api-service.d.ts +75 -0
- package/dist/services/congress-api/congress-api-service.d.ts.map +1 -0
- package/dist/services/congress-api/congress-api-service.js +292 -0
- package/dist/services/congress-api/congress-api-service.js.map +1 -0
- package/dist/services/congress-api/types.d.ts +122 -0
- package/dist/services/congress-api/types.d.ts.map +1 -0
- package/dist/services/congress-api/types.js +6 -0
- package/dist/services/congress-api/types.js.map +1 -0
- package/package.json +71 -0
- package/server.json +111 -0
package/README.md
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>@cyanheads/congressgov-mcp-server</h1>
|
|
3
|
+
<p><b>Access U.S. congressional data - bills, votes, members, committees - through MCP. STDIO & Streamable HTTP.</b>
|
|
4
|
+
<div>10 Tools • 5 Resources • 2 Prompts</div>
|
|
5
|
+
</p>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div align="center">
|
|
9
|
+
|
|
10
|
+
[](https://www.npmjs.com/package/@cyanheads/congressgov-mcp-server) [](./CHANGELOG.md) [](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) [](https://modelcontextprotocol.io/)
|
|
11
|
+
|
|
12
|
+
[](./LICENSE) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Tools
|
|
19
|
+
|
|
20
|
+
Ten read-only tools for querying U.S. legislative data:
|
|
21
|
+
|
|
22
|
+
| Tool | Description |
|
|
23
|
+
|:---|:---|
|
|
24
|
+
| `congressgov_bill_lookup` | Browse and retrieve U.S. legislative bill data — actions, sponsors, summaries, text, related bills |
|
|
25
|
+
| `congressgov_enacted_laws` | Browse enacted public and private laws by congress |
|
|
26
|
+
| `congressgov_member_lookup` | Discover congressional members by state/district/congress, retrieve legislative portfolios |
|
|
27
|
+
| `congressgov_committee_lookup` | Browse congressional committees and their legislation, reports, and nominations |
|
|
28
|
+
| `congressgov_roll_votes` | Retrieve House roll call vote data and individual member voting positions |
|
|
29
|
+
| `congressgov_senate_nominations` | Browse presidential nominations to federal positions and track the Senate confirmation process |
|
|
30
|
+
| `congressgov_bill_summaries` | Browse recent CRS bill summaries — the "what's happening" feed |
|
|
31
|
+
| `congressgov_crs_reports` | Browse and retrieve nonpartisan CRS policy analysis reports |
|
|
32
|
+
| `congressgov_committee_reports` | Browse and retrieve committee reports accompanying legislation |
|
|
33
|
+
| `congressgov_daily_record` | Browse the daily Congressional Record — floor speeches, debates, and proceedings |
|
|
34
|
+
|
|
35
|
+
### `congressgov_bill_lookup`
|
|
36
|
+
|
|
37
|
+
Browse and retrieve U.S. legislative bill data from Congress.gov.
|
|
38
|
+
|
|
39
|
+
- Filter by congress number, bill type, and date range
|
|
40
|
+
- Retrieve detailed sub-resources: actions, amendments, committees, cosponsors, related bills, subjects, summaries, text versions, and titles
|
|
41
|
+
- Pagination support for browsing large result sets
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
### `congressgov_member_lookup`
|
|
46
|
+
|
|
47
|
+
Discover congressional members and their legislative activity.
|
|
48
|
+
|
|
49
|
+
- Browse by state, district, congress number, and chamber
|
|
50
|
+
- Retrieve a member's sponsored and cosponsored legislation
|
|
51
|
+
- Look up specific members by bioguide ID
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### `congressgov_committee_lookup`
|
|
56
|
+
|
|
57
|
+
Browse congressional committees and their legislation, reports, and nominations.
|
|
58
|
+
|
|
59
|
+
- Filter by chamber (House, Senate, Joint)
|
|
60
|
+
- Retrieve committee bills, reports, and nominations
|
|
61
|
+
- Look up specific committees by committee code
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
### `congressgov_roll_votes`
|
|
66
|
+
|
|
67
|
+
Retrieve House roll call vote data and individual member voting positions.
|
|
68
|
+
|
|
69
|
+
- Browse roll call votes by congress and session
|
|
70
|
+
- Retrieve individual member voting positions per roll call
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
### `congressgov_bill_summaries`
|
|
75
|
+
|
|
76
|
+
Browse recent CRS bill summaries.
|
|
77
|
+
|
|
78
|
+
- Filter by congress and bill type
|
|
79
|
+
- Browse chronologically to see what's moving through Congress
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### `congressgov_crs_reports`
|
|
84
|
+
|
|
85
|
+
Browse and retrieve CRS reports — nonpartisan policy analyses written by subject-matter experts at the Library of Congress.
|
|
86
|
+
|
|
87
|
+
- Browse the full report catalog
|
|
88
|
+
- Retrieve individual reports by product number
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
### `congressgov_daily_record`
|
|
93
|
+
|
|
94
|
+
Browse the daily Congressional Record — floor speeches, debates, and legislative text published each day Congress is in session.
|
|
95
|
+
|
|
96
|
+
- Browse volumes by congress number
|
|
97
|
+
- Retrieve specific issue articles
|
|
98
|
+
|
|
99
|
+
## Resources
|
|
100
|
+
|
|
101
|
+
| URI Pattern | Description |
|
|
102
|
+
|:---|:---|
|
|
103
|
+
| `congress://current` | Current congress number, session dates, chamber info |
|
|
104
|
+
| `congress://bill-types` | Reference table of valid bill type codes |
|
|
105
|
+
| `congress://member/{bioguideId}` | Member profile by bioguide ID |
|
|
106
|
+
| `congress://bill/{congress}/{billType}/{billNumber}` | Bill detail by congress, type, and number |
|
|
107
|
+
| `congress://committee/{committeeCode}` | Committee detail by committee code |
|
|
108
|
+
|
|
109
|
+
## Prompts
|
|
110
|
+
|
|
111
|
+
| Prompt | Description |
|
|
112
|
+
|:---|:---|
|
|
113
|
+
| `congressgov_bill_analysis` | Structured framework for analyzing a bill |
|
|
114
|
+
| `congressgov_legislative_research` | Research framework for a policy area across Congress |
|
|
115
|
+
|
|
116
|
+
## Features
|
|
117
|
+
|
|
118
|
+
Built on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core):
|
|
119
|
+
|
|
120
|
+
- Declarative tool definitions — single file per tool, framework handles registration and validation
|
|
121
|
+
- Unified error handling across all tools
|
|
122
|
+
- Pluggable auth (`none`, `jwt`, `oauth`)
|
|
123
|
+
- Swappable storage backends: `in-memory`, `filesystem`, `Supabase`
|
|
124
|
+
- Structured logging with optional OpenTelemetry tracing
|
|
125
|
+
- Runs locally (stdio/HTTP) or in Docker from the same codebase
|
|
126
|
+
|
|
127
|
+
Congress.gov-specific:
|
|
128
|
+
|
|
129
|
+
- Type-safe client for the Congress.gov REST API v3
|
|
130
|
+
- Authentication via free API key from [api.data.gov](https://api.data.gov/signup/)
|
|
131
|
+
- Automatic pagination and response normalization
|
|
132
|
+
- Rate limiting awareness (5,000 requests/hour per key)
|
|
133
|
+
- All tools are read-only and idempotent
|
|
134
|
+
|
|
135
|
+
## Getting started
|
|
136
|
+
|
|
137
|
+
### MCP client configuration
|
|
138
|
+
|
|
139
|
+
Add the following to your MCP client configuration file.
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
{
|
|
143
|
+
"mcpServers": {
|
|
144
|
+
"congressgov": {
|
|
145
|
+
"type": "stdio",
|
|
146
|
+
"command": "bunx",
|
|
147
|
+
"args": ["@cyanheads/congressgov-mcp-server@latest"],
|
|
148
|
+
"env": {
|
|
149
|
+
"CONGRESS_API_KEY": "your-api-key"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Or with npx (no Bun required):
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"mcpServers": {
|
|
161
|
+
"congressgov": {
|
|
162
|
+
"type": "stdio",
|
|
163
|
+
"command": "npx",
|
|
164
|
+
"args": ["-y", "@cyanheads/congressgov-mcp-server@latest"],
|
|
165
|
+
"env": {
|
|
166
|
+
"CONGRESS_API_KEY": "your-api-key"
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Or with Docker:
|
|
174
|
+
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"mcpServers": {
|
|
178
|
+
"congressgov": {
|
|
179
|
+
"type": "stdio",
|
|
180
|
+
"command": "docker",
|
|
181
|
+
"args": ["run", "-i", "--rm", "-e", "CONGRESS_API_KEY=your-api-key", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/congressgov-mcp-server:latest"]
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
For Streamable HTTP, set the transport and start the server:
|
|
188
|
+
|
|
189
|
+
```sh
|
|
190
|
+
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
|
|
191
|
+
# Server listens at http://localhost:3010/mcp
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Get a free API key at [api.data.gov/signup](https://api.data.gov/signup/) (5,000 requests/hour).
|
|
195
|
+
|
|
196
|
+
### Prerequisites
|
|
197
|
+
|
|
198
|
+
- [Bun v1.3.2](https://bun.sh/) or higher.
|
|
199
|
+
|
|
200
|
+
### Installation
|
|
201
|
+
|
|
202
|
+
1. **Clone the repository:**
|
|
203
|
+
|
|
204
|
+
```sh
|
|
205
|
+
git clone https://github.com/cyanheads/congressgov-mcp-server.git
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
2. **Navigate into the directory:**
|
|
209
|
+
|
|
210
|
+
```sh
|
|
211
|
+
cd congressgov-mcp-server
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
3. **Install dependencies:**
|
|
215
|
+
|
|
216
|
+
```sh
|
|
217
|
+
bun install
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
4. **Configure environment:**
|
|
221
|
+
|
|
222
|
+
```sh
|
|
223
|
+
cp .env.example .env
|
|
224
|
+
# Edit .env and add your CONGRESS_API_KEY
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Configuration
|
|
228
|
+
|
|
229
|
+
All configuration is validated at startup via Zod schemas in `src/config/server-config.ts`. Key environment variables:
|
|
230
|
+
|
|
231
|
+
| Variable | Description | Default |
|
|
232
|
+
|:---|:---|:---|
|
|
233
|
+
| `CONGRESS_API_KEY` | **Required.** API key from [api.data.gov](https://api.data.gov/signup/) | — |
|
|
234
|
+
| `CONGRESS_API_BASE_URL` | Congress.gov API base URL | `https://api.congress.gov/v3` |
|
|
235
|
+
| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http` | `stdio` |
|
|
236
|
+
| `MCP_HTTP_PORT` | HTTP server port | `3010` |
|
|
237
|
+
| `MCP_AUTH_MODE` | Authentication: `none`, `jwt`, or `oauth` | `none` |
|
|
238
|
+
| `MCP_LOG_LEVEL` | Log level (`debug`, `info`, `warning`, `error`, etc.) | `info` |
|
|
239
|
+
| `STORAGE_PROVIDER_TYPE` | Storage backend | `in-memory` |
|
|
240
|
+
| `OTEL_ENABLED` | Enable OpenTelemetry | `false` |
|
|
241
|
+
|
|
242
|
+
## Running the server
|
|
243
|
+
|
|
244
|
+
### Local development
|
|
245
|
+
|
|
246
|
+
- **Build and run the production version:**
|
|
247
|
+
|
|
248
|
+
```sh
|
|
249
|
+
bun run rebuild
|
|
250
|
+
bun run start:http # or start:stdio
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
- **Run checks and tests:**
|
|
254
|
+
```sh
|
|
255
|
+
bun run devcheck # Lints, formats, type-checks
|
|
256
|
+
bun run test # Runs test suite
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Docker
|
|
260
|
+
|
|
261
|
+
```sh
|
|
262
|
+
docker build -t congressgov-mcp-server .
|
|
263
|
+
docker run -e CONGRESS_API_KEY=your-api-key -p 3010:3010 congressgov-mcp-server
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## Project structure
|
|
267
|
+
|
|
268
|
+
| Directory | Purpose |
|
|
269
|
+
|:---|:---|
|
|
270
|
+
| `src/mcp-server/tools/definitions/` | Tool definitions (`*.tool.ts`). Ten Congress.gov tools. |
|
|
271
|
+
| `src/mcp-server/resources/definitions/` | Resource definitions. Congress, bill, member, and committee resources. |
|
|
272
|
+
| `src/mcp-server/prompts/definitions/` | Prompt definitions. Bill analysis and legislative research prompts. |
|
|
273
|
+
| `src/services/congress-api/` | Congress.gov API client — auth, pagination, rate limiting. |
|
|
274
|
+
| `src/config/` | Server-specific environment variable parsing and validation with Zod. |
|
|
275
|
+
| `tests/` | Unit and integration tests, mirroring the `src/` structure. |
|
|
276
|
+
|
|
277
|
+
## Development guide
|
|
278
|
+
|
|
279
|
+
See [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:
|
|
280
|
+
|
|
281
|
+
- Handlers throw, framework catches — no `try/catch` in tool logic
|
|
282
|
+
- Use `ctx.log` for logging, `ctx.state` for storage
|
|
283
|
+
- All tools are read-only with `readOnlyHint: true` and `idempotentHint: true`
|
|
284
|
+
|
|
285
|
+
## Contributing
|
|
286
|
+
|
|
287
|
+
Issues and pull requests are welcome. Run checks and tests before submitting:
|
|
288
|
+
|
|
289
|
+
```sh
|
|
290
|
+
bun run devcheck
|
|
291
|
+
bun run test
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
## License
|
|
295
|
+
|
|
296
|
+
This project is licensed under the Apache 2.0 License. See the [LICENSE](./LICENSE) file for details.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Server-specific configuration for the Congress.gov MCP server.
|
|
3
|
+
* @module config/server-config
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
declare const ServerConfigSchema: z.ZodObject<{
|
|
7
|
+
apiKey: z.ZodString;
|
|
8
|
+
baseUrl: z.ZodDefault<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type ServerConfig = z.infer<typeof ServerConfigSchema>;
|
|
11
|
+
export declare function getServerConfig(): ServerConfig;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=server-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAE3C,QAAA,MAAM,kBAAkB;;;iBAOtB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,wBAAgB,eAAe,IAAI,YAAY,CAM9C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Server-specific configuration for the Congress.gov MCP server.
|
|
3
|
+
* @module config/server-config
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
const ServerConfigSchema = z.object({
|
|
7
|
+
apiKey: z.string().min(1).describe('Congress.gov API key from api.data.gov'),
|
|
8
|
+
baseUrl: z
|
|
9
|
+
.string()
|
|
10
|
+
.url()
|
|
11
|
+
.default('https://api.congress.gov/v3')
|
|
12
|
+
.describe('Congress.gov API base URL'),
|
|
13
|
+
});
|
|
14
|
+
let _config;
|
|
15
|
+
export function getServerConfig() {
|
|
16
|
+
_config ??= ServerConfigSchema.parse({
|
|
17
|
+
apiKey: process.env.CONGRESS_API_KEY,
|
|
18
|
+
baseUrl: process.env.CONGRESS_API_BASE_URL,
|
|
19
|
+
});
|
|
20
|
+
return _config;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=server-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAE3C,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,wCAAwC,CAAC;IAC5E,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,EAAE;SACL,OAAO,CAAC,6BAA6B,CAAC;SACtC,QAAQ,CAAC,2BAA2B,CAAC;CACzC,CAAC,CAAC;AAIH,IAAI,OAAiC,CAAC;AAEtC,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,kBAAkB,CAAC,KAAK,CAAC;QACnC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB;QACpC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB;KAC3C,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview congressgov-mcp-server entry point — Congress.gov API v3 for MCP.
|
|
4
|
+
* @module index
|
|
5
|
+
*/
|
|
6
|
+
import { createApp } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { billAnalysisPrompt } from './mcp-server/prompts/definitions/bill-analysis.prompt.js';
|
|
8
|
+
import { legislativeResearchPrompt } from './mcp-server/prompts/definitions/legislative-research.prompt.js';
|
|
9
|
+
import { billResource } from './mcp-server/resources/definitions/bill.resource.js';
|
|
10
|
+
import { billTypesResource } from './mcp-server/resources/definitions/bill-types.resource.js';
|
|
11
|
+
import { committeeResource } from './mcp-server/resources/definitions/committee.resource.js';
|
|
12
|
+
import { currentCongressResource } from './mcp-server/resources/definitions/current-congress.resource.js';
|
|
13
|
+
import { memberResource } from './mcp-server/resources/definitions/member.resource.js';
|
|
14
|
+
import { billLookupTool } from './mcp-server/tools/definitions/bill-lookup.tool.js';
|
|
15
|
+
import { billSummariesTool } from './mcp-server/tools/definitions/bill-summaries.tool.js';
|
|
16
|
+
import { committeeLookupTool } from './mcp-server/tools/definitions/committee-lookup.tool.js';
|
|
17
|
+
import { committeeReportsTool } from './mcp-server/tools/definitions/committee-reports.tool.js';
|
|
18
|
+
import { crsReportsTool } from './mcp-server/tools/definitions/crs-reports.tool.js';
|
|
19
|
+
import { dailyRecordTool } from './mcp-server/tools/definitions/daily-record.tool.js';
|
|
20
|
+
import { enactedLawsTool } from './mcp-server/tools/definitions/enacted-laws.tool.js';
|
|
21
|
+
import { memberLookupTool } from './mcp-server/tools/definitions/member-lookup.tool.js';
|
|
22
|
+
import { rollVotesTool } from './mcp-server/tools/definitions/roll-votes.tool.js';
|
|
23
|
+
import { senateNominationsTool } from './mcp-server/tools/definitions/senate-nominations.tool.js';
|
|
24
|
+
import { initCongressApi } from './services/congress-api/congress-api-service.js';
|
|
25
|
+
await createApp({
|
|
26
|
+
tools: [
|
|
27
|
+
billLookupTool,
|
|
28
|
+
enactedLawsTool,
|
|
29
|
+
memberLookupTool,
|
|
30
|
+
committeeLookupTool,
|
|
31
|
+
rollVotesTool,
|
|
32
|
+
senateNominationsTool,
|
|
33
|
+
billSummariesTool,
|
|
34
|
+
crsReportsTool,
|
|
35
|
+
committeeReportsTool,
|
|
36
|
+
dailyRecordTool,
|
|
37
|
+
],
|
|
38
|
+
resources: [
|
|
39
|
+
currentCongressResource,
|
|
40
|
+
billTypesResource,
|
|
41
|
+
memberResource,
|
|
42
|
+
billResource,
|
|
43
|
+
committeeResource,
|
|
44
|
+
],
|
|
45
|
+
prompts: [billAnalysisPrompt, legislativeResearchPrompt],
|
|
46
|
+
setup() {
|
|
47
|
+
initCongressApi();
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAC;AAC5G,OAAO,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2DAA2D,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,MAAM,0DAA0D,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,iEAAiE,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,MAAM,uDAAuD,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,oDAAoD,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,MAAM,oDAAoD,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,2DAA2D,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAElF,MAAM,SAAS,CAAC;IACd,KAAK,EAAE;QACL,cAAc;QACd,eAAe;QACf,gBAAgB;QAChB,mBAAmB;QACnB,aAAa;QACb,qBAAqB;QACrB,iBAAiB;QACjB,cAAc;QACd,oBAAoB;QACpB,eAAe;KAChB;IACD,SAAS,EAAE;QACT,uBAAuB;QACvB,iBAAiB;QACjB,cAAc;QACd,YAAY;QACZ,iBAAiB;KAClB;IACD,OAAO,EAAE,CAAC,kBAAkB,EAAE,yBAAyB,CAAC;IACxD,KAAK;QACH,eAAe,EAAE,CAAC;IACpB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Prompt providing a structured framework for analyzing a bill.
|
|
3
|
+
* @module mcp-server/prompts/definitions/bill-analysis
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const billAnalysisPrompt: import("@cyanheads/mcp-ts-core").PromptDefinition<z.ZodObject<{
|
|
7
|
+
congress: z.ZodString;
|
|
8
|
+
billType: z.ZodString;
|
|
9
|
+
billNumber: z.ZodString;
|
|
10
|
+
}, z.core.$strip>>;
|
|
11
|
+
//# sourceMappingURL=bill-analysis.prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bill-analysis.prompt.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/bill-analysis.prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAU,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAO,MAAM,kBAAkB;;;;kBA8B7B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Prompt providing a structured framework for analyzing a bill.
|
|
3
|
+
* @module mcp-server/prompts/definitions/bill-analysis
|
|
4
|
+
*/
|
|
5
|
+
import { prompt, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export const billAnalysisPrompt = prompt('congressgov_bill_analysis', {
|
|
7
|
+
description: 'Structured framework for analyzing a bill: summary, sponsors, committee referrals, action timeline, related legislation, and policy implications.',
|
|
8
|
+
args: z.object({
|
|
9
|
+
congress: z.string().describe('Congress number (e.g., 118).'),
|
|
10
|
+
billType: z.string().describe('Bill type code (e.g., hr, s).'),
|
|
11
|
+
billNumber: z.string().describe('Bill number (e.g., 3076).'),
|
|
12
|
+
}),
|
|
13
|
+
generate: (args) => [
|
|
14
|
+
{
|
|
15
|
+
role: 'user',
|
|
16
|
+
content: {
|
|
17
|
+
type: 'text',
|
|
18
|
+
text: `Analyze bill ${args.billType.toUpperCase()} ${args.billNumber} from the ${args.congress}th Congress. Use the congressgov_bill_lookup tool to gather data, then provide:
|
|
19
|
+
|
|
20
|
+
1. **Summary** — What does this bill do? Use the CRS summary if available, otherwise summarize from the bill text.
|
|
21
|
+
2. **Sponsors & Cosponsors** — Who introduced it? How many cosponsors? Bipartisan support?
|
|
22
|
+
3. **Committee Referrals** — Which committees has it been referred to? Any reported out?
|
|
23
|
+
4. **Action Timeline** — Key legislative actions from introduction to current status.
|
|
24
|
+
5. **Related Legislation** — Companion bills, related bills, or predecessors in prior congresses.
|
|
25
|
+
6. **Policy Implications** — What policy area does this affect? What are the likely impacts?
|
|
26
|
+
7. **Outlook** — Based on committee activity, sponsor influence, and legislative history, what is the realistic path forward?
|
|
27
|
+
|
|
28
|
+
Use these tools as needed:
|
|
29
|
+
- congressgov_bill_lookup (operations: get, actions, cosponsors, committees, summaries, text, related)
|
|
30
|
+
- congressgov_member_lookup (to understand sponsor/cosponsor profiles)
|
|
31
|
+
- congressgov_committee_lookup (to understand committee context)`,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=bill-analysis.prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bill-analysis.prompt.js","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/bill-analysis.prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,2BAA2B,EAAE;IACpE,WAAW,EACT,mJAAmJ;IACrJ,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;QAC7D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;QAC9D,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;KAC7D,CAAC;IACF,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;QAClB;YACE,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,gBAAgB,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,UAAU,aAAa,IAAI,CAAC,QAAQ;;;;;;;;;;;;;iEAarC;aAC1D;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Prompt providing a research framework for investigating a policy area across Congress.
|
|
3
|
+
* @module mcp-server/prompts/definitions/legislative-research
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const legislativeResearchPrompt: import("@cyanheads/mcp-ts-core").PromptDefinition<z.ZodObject<{
|
|
7
|
+
topic: z.ZodString;
|
|
8
|
+
congress: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
//# sourceMappingURL=legislative-research.prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legislative-research.prompt.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/legislative-research.prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAU,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAO,MAAM,yBAAyB;;;kBA0CpC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Prompt providing a research framework for investigating a policy area across Congress.
|
|
3
|
+
* @module mcp-server/prompts/definitions/legislative-research
|
|
4
|
+
*/
|
|
5
|
+
import { prompt, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export const legislativeResearchPrompt = prompt('congressgov_legislative_research', {
|
|
7
|
+
description: 'Research framework for investigating a policy area across Congress: relevant bills, key members, committee activity, CRS reports, and floor activity.',
|
|
8
|
+
args: z.object({
|
|
9
|
+
topic: z
|
|
10
|
+
.string()
|
|
11
|
+
.describe('Policy topic or area to research (e.g., "AI regulation", "immigration reform").'),
|
|
12
|
+
congress: z
|
|
13
|
+
.string()
|
|
14
|
+
.optional()
|
|
15
|
+
.describe('Congress number to focus on. Defaults to current congress.'),
|
|
16
|
+
}),
|
|
17
|
+
generate: (args) => {
|
|
18
|
+
const congressNote = args.congress
|
|
19
|
+
? `Focus on the ${args.congress}th Congress.`
|
|
20
|
+
: 'Start with the current congress (use the congress://current resource to find the number).';
|
|
21
|
+
return [
|
|
22
|
+
{
|
|
23
|
+
role: 'user',
|
|
24
|
+
content: {
|
|
25
|
+
type: 'text',
|
|
26
|
+
text: `Research the topic "${args.topic}" across congressional activity. ${congressNote}
|
|
27
|
+
|
|
28
|
+
Since the Congress.gov API has no keyword search, use these discovery strategies:
|
|
29
|
+
|
|
30
|
+
1. **CRS Reports** — Use congressgov_crs_reports to find nonpartisan policy analyses on this topic.
|
|
31
|
+
2. **Recent Summaries** — Use congressgov_bill_summaries with a broad date range to find recently summarized bills that may relate to this topic.
|
|
32
|
+
3. **Committee Activity** — Identify relevant committees using congressgov_committee_lookup, then check their recent bills and reports.
|
|
33
|
+
4. **Key Members** — Identify members known for this policy area, then check their sponsored legislation via congressgov_member_lookup.
|
|
34
|
+
5. **Floor Activity** — Check congressgov_daily_record for recent floor debate on the topic.
|
|
35
|
+
|
|
36
|
+
Synthesize findings into:
|
|
37
|
+
- **Landscape** — What legislation is active on this topic? What stage are key bills at?
|
|
38
|
+
- **Key Players** — Which members and committees are driving activity?
|
|
39
|
+
- **Policy Analysis** — What do CRS reports say about the issues?
|
|
40
|
+
- **Recent Activity** — What happened in the last 30 days?
|
|
41
|
+
- **Outlook** — What is the likely trajectory for this policy area?`,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=legislative-research.prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legislative-research.prompt.js","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/legislative-research.prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,kCAAkC,EAAE;IAClF,WAAW,EACT,uJAAuJ;IACzJ,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,QAAQ,CAAC,iFAAiF,CAAC;QAC9F,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,4DAA4D,CAAC;KAC1E,CAAC;IACF,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACjB,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ;YAChC,CAAC,CAAC,gBAAgB,IAAI,CAAC,QAAQ,cAAc;YAC7C,CAAC,CAAC,2FAA2F,CAAC;QAEhG,OAAO;YACL;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,uBAAuB,IAAI,CAAC,KAAK,oCAAoC,YAAY;;;;;;;;;;;;;;;oEAe7B;iBAC3D;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Resource providing a reference table of valid bill type codes.
|
|
3
|
+
* @module mcp-server/resources/definitions/bill-types
|
|
4
|
+
*/
|
|
5
|
+
export declare const billTypesResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<import("zod").ZodObject<Readonly<{
|
|
6
|
+
[k: string]: import("zod/v4/core").$ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
7
|
+
}>, import("zod/v4/core").$strip>, undefined>;
|
|
8
|
+
//# sourceMappingURL=bill-types.resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bill-types.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/bill-types.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA8BH,eAAO,MAAM,iBAAiB;;6CAQ5B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Resource providing a reference table of valid bill type codes.
|
|
3
|
+
* @module mcp-server/resources/definitions/bill-types
|
|
4
|
+
*/
|
|
5
|
+
import { resource } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
const BILL_TYPES = [
|
|
7
|
+
{ code: 'hr', description: 'House Bill', chamber: 'House', example: 'H.R. 1234' },
|
|
8
|
+
{ code: 's', description: 'Senate Bill', chamber: 'Senate', example: 'S. 1234' },
|
|
9
|
+
{ code: 'hjres', description: 'House Joint Resolution', chamber: 'House', example: 'H.J.Res. 1' },
|
|
10
|
+
{
|
|
11
|
+
code: 'sjres',
|
|
12
|
+
description: 'Senate Joint Resolution',
|
|
13
|
+
chamber: 'Senate',
|
|
14
|
+
example: 'S.J.Res. 1',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
code: 'hconres',
|
|
18
|
+
description: 'House Concurrent Resolution',
|
|
19
|
+
chamber: 'House',
|
|
20
|
+
example: 'H.Con.Res. 1',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
code: 'sconres',
|
|
24
|
+
description: 'Senate Concurrent Resolution',
|
|
25
|
+
chamber: 'Senate',
|
|
26
|
+
example: 'S.Con.Res. 1',
|
|
27
|
+
},
|
|
28
|
+
{ code: 'hres', description: 'House Simple Resolution', chamber: 'House', example: 'H.Res. 1' },
|
|
29
|
+
{ code: 'sres', description: 'Senate Simple Resolution', chamber: 'Senate', example: 'S.Res. 1' },
|
|
30
|
+
];
|
|
31
|
+
export const billTypesResource = resource('congress://bill-types', {
|
|
32
|
+
name: 'bill-types',
|
|
33
|
+
description: 'Reference table of valid bill type codes (hr, s, hjres, etc.) with descriptions.',
|
|
34
|
+
mimeType: 'application/json',
|
|
35
|
+
handler() {
|
|
36
|
+
return { billTypes: BILL_TYPES };
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=bill-types.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bill-types.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/bill-types.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,MAAM,UAAU,GAAG;IACjB,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE;IACjF,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE;IAChF,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE;IACjG;QACE,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,yBAAyB;QACtC,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,YAAY;KACtB;IACD;QACE,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,6BAA6B;QAC1C,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,cAAc;KACxB;IACD;QACE,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,8BAA8B;QAC3C,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,cAAc;KACxB;IACD,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,yBAAyB,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE;IAC/F,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,0BAA0B,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE;CAClG,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,uBAAuB,EAAE;IACjE,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,kFAAkF;IAC/F,QAAQ,EAAE,kBAAkB;IAE5B,OAAO;QACL,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;IACnC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Resource for fetching bill detail by congress, type, and number.
|
|
3
|
+
* @module mcp-server/resources/definitions/bill
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const billResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
|
|
7
|
+
congress: z.ZodString;
|
|
8
|
+
billType: z.ZodString;
|
|
9
|
+
billNumber: z.ZodString;
|
|
10
|
+
}, z.core.$strip>, undefined>;
|
|
11
|
+
//# sourceMappingURL=bill.resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bill.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/bill.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAIrD,eAAO,MAAM,YAAY;;;;6BAwBvB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Resource for fetching bill detail by congress, type, and number.
|
|
3
|
+
* @module mcp-server/resources/definitions/bill
|
|
4
|
+
*/
|
|
5
|
+
import { resource, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { getCongressApi } from '../../../services/congress-api/congress-api-service.js';
|
|
7
|
+
export const billResource = resource('congress://bill/{congress}/{billType}/{billNumber}', {
|
|
8
|
+
name: 'bill-detail',
|
|
9
|
+
description: 'Bill detail: sponsor, status, policy area, committees, latest action.',
|
|
10
|
+
mimeType: 'application/json',
|
|
11
|
+
params: z.object({
|
|
12
|
+
congress: z.string().describe('Congress number (e.g., 118).'),
|
|
13
|
+
billType: z.string().describe('Bill type code (e.g., hr, s, hjres).'),
|
|
14
|
+
billNumber: z.string().describe('Bill number (e.g., 3076).'),
|
|
15
|
+
}),
|
|
16
|
+
async handler(params, ctx) {
|
|
17
|
+
const api = getCongressApi();
|
|
18
|
+
const result = await api.getBill({
|
|
19
|
+
congress: Number(params.congress),
|
|
20
|
+
billType: params.billType,
|
|
21
|
+
billNumber: Number(params.billNumber),
|
|
22
|
+
});
|
|
23
|
+
ctx.log.info('Bill resource fetched', {
|
|
24
|
+
congress: params.congress,
|
|
25
|
+
billType: params.billType,
|
|
26
|
+
billNumber: params.billNumber,
|
|
27
|
+
});
|
|
28
|
+
return result.bill;
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=bill.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bill.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/bill.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAGjF,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC,oDAAoD,EAAE;IACzF,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,uEAAuE;IACpF,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;QAC7D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;QACrE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;KAC7D,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC;YAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;YACjC,QAAQ,EAAE,MAAM,CAAC,QAAoB;YACrC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;SACtC,CAAC,CAAC;QACH,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,uBAAuB,EAAE;YACpC,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;CACF,CAAC,CAAC"}
|