@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.
Files changed (94) hide show
  1. package/CLAUDE.md +270 -0
  2. package/Dockerfile +99 -0
  3. package/LICENSE +191 -0
  4. package/README.md +296 -0
  5. package/dist/config/server-config.d.ts +13 -0
  6. package/dist/config/server-config.d.ts.map +1 -0
  7. package/dist/config/server-config.js +22 -0
  8. package/dist/config/server-config.js.map +1 -0
  9. package/dist/index.d.ts +7 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +50 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/mcp-server/prompts/definitions/bill-analysis.prompt.d.ts +11 -0
  14. package/dist/mcp-server/prompts/definitions/bill-analysis.prompt.d.ts.map +1 -0
  15. package/dist/mcp-server/prompts/definitions/bill-analysis.prompt.js +36 -0
  16. package/dist/mcp-server/prompts/definitions/bill-analysis.prompt.js.map +1 -0
  17. package/dist/mcp-server/prompts/definitions/legislative-research.prompt.d.ts +10 -0
  18. package/dist/mcp-server/prompts/definitions/legislative-research.prompt.d.ts.map +1 -0
  19. package/dist/mcp-server/prompts/definitions/legislative-research.prompt.js +47 -0
  20. package/dist/mcp-server/prompts/definitions/legislative-research.prompt.js.map +1 -0
  21. package/dist/mcp-server/resources/definitions/bill-types.resource.d.ts +8 -0
  22. package/dist/mcp-server/resources/definitions/bill-types.resource.d.ts.map +1 -0
  23. package/dist/mcp-server/resources/definitions/bill-types.resource.js +39 -0
  24. package/dist/mcp-server/resources/definitions/bill-types.resource.js.map +1 -0
  25. package/dist/mcp-server/resources/definitions/bill.resource.d.ts +11 -0
  26. package/dist/mcp-server/resources/definitions/bill.resource.d.ts.map +1 -0
  27. package/dist/mcp-server/resources/definitions/bill.resource.js +31 -0
  28. package/dist/mcp-server/resources/definitions/bill.resource.js.map +1 -0
  29. package/dist/mcp-server/resources/definitions/committee.resource.d.ts +9 -0
  30. package/dist/mcp-server/resources/definitions/committee.resource.d.ts.map +1 -0
  31. package/dist/mcp-server/resources/definitions/committee.resource.js +26 -0
  32. package/dist/mcp-server/resources/definitions/committee.resource.js.map +1 -0
  33. package/dist/mcp-server/resources/definitions/current-congress.resource.d.ts +8 -0
  34. package/dist/mcp-server/resources/definitions/current-congress.resource.d.ts.map +1 -0
  35. package/dist/mcp-server/resources/definitions/current-congress.resource.js +18 -0
  36. package/dist/mcp-server/resources/definitions/current-congress.resource.js.map +1 -0
  37. package/dist/mcp-server/resources/definitions/member.resource.d.ts +9 -0
  38. package/dist/mcp-server/resources/definitions/member.resource.d.ts.map +1 -0
  39. package/dist/mcp-server/resources/definitions/member.resource.js +21 -0
  40. package/dist/mcp-server/resources/definitions/member.resource.js.map +1 -0
  41. package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts +37 -0
  42. package/dist/mcp-server/tools/definitions/bill-lookup.tool.d.ts.map +1 -0
  43. package/dist/mcp-server/tools/definitions/bill-lookup.tool.js +105 -0
  44. package/dist/mcp-server/tools/definitions/bill-lookup.tool.js.map +1 -0
  45. package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts +23 -0
  46. package/dist/mcp-server/tools/definitions/bill-summaries.tool.d.ts.map +1 -0
  47. package/dist/mcp-server/tools/definitions/bill-summaries.tool.js +57 -0
  48. package/dist/mcp-server/tools/definitions/bill-summaries.tool.js.map +1 -0
  49. package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts +24 -0
  50. package/dist/mcp-server/tools/definitions/committee-lookup.tool.d.ts.map +1 -0
  51. package/dist/mcp-server/tools/definitions/committee-lookup.tool.js +70 -0
  52. package/dist/mcp-server/tools/definitions/committee-lookup.tool.js.map +1 -0
  53. package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts +22 -0
  54. package/dist/mcp-server/tools/definitions/committee-reports.tool.d.ts.map +1 -0
  55. package/dist/mcp-server/tools/definitions/committee-reports.tool.js +80 -0
  56. package/dist/mcp-server/tools/definitions/committee-reports.tool.js.map +1 -0
  57. package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts +15 -0
  58. package/dist/mcp-server/tools/definitions/crs-reports.tool.d.ts.map +1 -0
  59. package/dist/mcp-server/tools/definitions/crs-reports.tool.js +41 -0
  60. package/dist/mcp-server/tools/definitions/crs-reports.tool.js.map +1 -0
  61. package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts +17 -0
  62. package/dist/mcp-server/tools/definitions/daily-record.tool.d.ts.map +1 -0
  63. package/dist/mcp-server/tools/definitions/daily-record.tool.js +67 -0
  64. package/dist/mcp-server/tools/definitions/daily-record.tool.js.map +1 -0
  65. package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts +20 -0
  66. package/dist/mcp-server/tools/definitions/enacted-laws.tool.d.ts.map +1 -0
  67. package/dist/mcp-server/tools/definitions/enacted-laws.tool.js +55 -0
  68. package/dist/mcp-server/tools/definitions/enacted-laws.tool.js.map +1 -0
  69. package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts +21 -0
  70. package/dist/mcp-server/tools/definitions/member-lookup.tool.d.ts.map +1 -0
  71. package/dist/mcp-server/tools/definitions/member-lookup.tool.js +86 -0
  72. package/dist/mcp-server/tools/definitions/member-lookup.tool.js.map +1 -0
  73. package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts +18 -0
  74. package/dist/mcp-server/tools/definitions/roll-votes.tool.d.ts.map +1 -0
  75. package/dist/mcp-server/tools/definitions/roll-votes.tool.js +65 -0
  76. package/dist/mcp-server/tools/definitions/roll-votes.tool.js.map +1 -0
  77. package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts +21 -0
  78. package/dist/mcp-server/tools/definitions/senate-nominations.tool.d.ts.map +1 -0
  79. package/dist/mcp-server/tools/definitions/senate-nominations.tool.js +90 -0
  80. package/dist/mcp-server/tools/definitions/senate-nominations.tool.js.map +1 -0
  81. package/dist/mcp-server/tools/format-helpers.d.ts +12 -0
  82. package/dist/mcp-server/tools/format-helpers.d.ts.map +1 -0
  83. package/dist/mcp-server/tools/format-helpers.js +72 -0
  84. package/dist/mcp-server/tools/format-helpers.js.map +1 -0
  85. package/dist/services/congress-api/congress-api-service.d.ts +75 -0
  86. package/dist/services/congress-api/congress-api-service.d.ts.map +1 -0
  87. package/dist/services/congress-api/congress-api-service.js +292 -0
  88. package/dist/services/congress-api/congress-api-service.js.map +1 -0
  89. package/dist/services/congress-api/types.d.ts +122 -0
  90. package/dist/services/congress-api/types.d.ts.map +1 -0
  91. package/dist/services/congress-api/types.js +6 -0
  92. package/dist/services/congress-api/types.js.map +1 -0
  93. package/package.json +71 -0
  94. package/server.json +111 -0
package/CLAUDE.md ADDED
@@ -0,0 +1,270 @@
1
+ # Agent Protocol
2
+
3
+ **Server:** congressgov-mcp-server
4
+ **Version:** 0.3.3
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
6
+
7
+ > **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
8
+
9
+ ---
10
+
11
+ ## Overview
12
+
13
+ MCP server wrapping the [Congress.gov API v3](https://api.congress.gov/) — the official machine-readable interface to U.S. legislative data maintained by the Library of Congress. All tools are **read-only** and **idempotent**. The API has **no keyword search** — discovery happens via browse/filter on congress number, bill type, date range, chamber, state, and district.
14
+
15
+ ---
16
+
17
+ ## What's Next?
18
+
19
+ When the user asks what to do next, what's left, or needs direction, suggest relevant options based on the current project state:
20
+
21
+ 1. **Re-run the `setup` skill** — ensures CLAUDE.md, skills, structure, and metadata are populated and up to date with the current codebase
22
+ 2. **Run the `design-mcp-server` skill** — if the tool/resource surface hasn't been mapped yet, work through domain design
23
+ 3. **Add tools/resources/prompts** — scaffold new definitions using the `add-tool`, `add-resource`, `add-prompt` skills
24
+ 4. **Add services** — scaffold domain service integrations using the `add-service` skill
25
+ 5. **Add tests** — scaffold tests for existing definitions using the `add-test` skill
26
+ 6. **Field-test definitions** — exercise tools/resources/prompts with real inputs using the `field-test` skill, get a report of issues and pain points
27
+ 7. **Run `devcheck`** — lint, format, typecheck, and security audit
28
+ 8. **Run the `polish-docs-meta` skill** — finalize README, CHANGELOG, metadata, and agent protocol for shipping
29
+ 9. **Run the `maintenance` skill** — sync skills and dependencies after framework updates
30
+
31
+ Tailor suggestions to what's actually missing or stale — don't recite the full list every time.
32
+
33
+ ---
34
+
35
+ ## Config
36
+
37
+ | Env Var | Required | Description |
38
+ |:--------|:---------|:------------|
39
+ | `CONGRESS_API_KEY` | Yes | API key from [api.data.gov](https://api.data.gov/signup/) (free, 5,000 req/hr) |
40
+ | `CONGRESS_API_BASE_URL` | No | Defaults to `https://api.congress.gov/v3` |
41
+
42
+ ---
43
+
44
+ ## Core Rules
45
+
46
+ - **Logic throws, framework catches.** Tool/resource handlers are pure — throw on failure, no `try/catch`. Plain `Error` is fine; the framework catches, classifies, and formats. Use error factories (`notFound()`, `validationError()`, etc.) when the error code matters.
47
+ - **Use `ctx.log`** for request-scoped logging. No `console` calls.
48
+ - **Use `ctx.state`** for tenant-scoped storage. Never access persistence directly.
49
+ - **Check `ctx.elicit` / `ctx.sample`** for presence before calling.
50
+ - **Secrets in env vars only** — never hardcoded.
51
+ - **All tools are read-only.** Every tool gets `annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true }`.
52
+ - **API key stays out of logs.** The service appends `api_key` as a query param — never log full URLs.
53
+
54
+ ---
55
+
56
+ ## MCP Surface
57
+
58
+ ### Tools (10)
59
+
60
+ | Name | Description |
61
+ |:-----|:------------|
62
+ | `congressgov_bill_lookup` | Browse, filter, and retrieve bill data (actions, sponsors, summaries, text, related bills) |
63
+ | `congressgov_enacted_laws` | Browse enacted public and private laws by congress |
64
+ | `congressgov_member_lookup` | Discover members by state/district/congress, retrieve legislative portfolios |
65
+ | `congressgov_committee_lookup` | Browse committees and retrieve legislation, reports, nominations |
66
+ | `congressgov_roll_votes` | Retrieve House roll call votes and member voting positions |
67
+ | `congressgov_senate_nominations` | Browse presidential nominations, track Senate confirmation pipeline |
68
+ | `congressgov_bill_summaries` | Browse recent CRS bill summaries — the "what's happening" feed |
69
+ | `congressgov_crs_reports` | Browse and retrieve nonpartisan CRS policy analysis reports |
70
+ | `congressgov_committee_reports` | Browse and retrieve committee reports accompanying legislation |
71
+ | `congressgov_daily_record` | Browse daily Congressional Record — floor speeches, debates, proceedings |
72
+
73
+ ### Resources (5)
74
+
75
+ | URI Template | Description |
76
+ |:-------------|:------------|
77
+ | `congress://current` | Current congress number, session dates, chamber info |
78
+ | `congress://bill-types` | Reference table of valid bill type codes |
79
+ | `congress://member/{bioguideId}` | Member profile |
80
+ | `congress://bill/{congress}/{billType}/{billNumber}` | Bill detail |
81
+ | `congress://committee/{committeeCode}` | Committee detail |
82
+
83
+ ### Prompts (2)
84
+
85
+ | Name | Description |
86
+ |:-----|:------------|
87
+ | `congressgov_bill_analysis` | Structured framework for analyzing a bill |
88
+ | `congressgov_legislative_research` | Research framework for a policy area across Congress |
89
+
90
+ ---
91
+
92
+ ## Structure
93
+
94
+ ```text
95
+ src/
96
+ index.ts # createApp() entry point
97
+ config/
98
+ server-config.ts # CONGRESS_API_KEY, base URL (Zod schema)
99
+ services/
100
+ congress-api/
101
+ congress-api-service.ts # API client — auth, pagination, rate limiting
102
+ types.ts # API response types
103
+ mcp-server/
104
+ tools/definitions/
105
+ bill-lookup.tool.ts # congressgov_bill_lookup
106
+ enacted-laws.tool.ts # congressgov_enacted_laws
107
+ member-lookup.tool.ts # congressgov_member_lookup
108
+ committee-lookup.tool.ts # congressgov_committee_lookup
109
+ roll-votes.tool.ts # congressgov_roll_votes
110
+ senate-nominations.tool.ts # congressgov_senate_nominations
111
+ bill-summaries.tool.ts # congressgov_bill_summaries
112
+ crs-reports.tool.ts # congressgov_crs_reports
113
+ committee-reports.tool.ts # congressgov_committee_reports
114
+ daily-record.tool.ts # congressgov_daily_record
115
+ resources/definitions/
116
+ current-congress.resource.ts # congress://current
117
+ bill-types.resource.ts # congress://bill-types
118
+ member.resource.ts # congress://member/{bioguideId}
119
+ bill.resource.ts # congress://bill/{congress}/{billType}/{billNumber}
120
+ committee.resource.ts # congress://committee/{committeeCode}
121
+ prompts/definitions/
122
+ bill-analysis.prompt.ts # congressgov_bill_analysis
123
+ legislative-research.prompt.ts # congressgov_legislative_research
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Service
129
+
130
+ Single service: `CongressApiService`. Wraps the Congress.gov REST API v3.
131
+
132
+ **Key concerns:**
133
+ - API key via `?api_key=` query param (never logged)
134
+ - Pagination: `offset` + `limit` query params, max 250 per request
135
+ - Rate limiting: 5,000 requests/hour per key
136
+ - Response normalization: request `format=json`, return typed data
137
+ - Native `fetch` — no SDK dependency
138
+
139
+ **Usage in tools:**
140
+ ```ts
141
+ import { getCongressApi } from '@/services/congress-api/congress-api-service.js';
142
+
143
+ async handler(input, ctx) {
144
+ const api = getCongressApi();
145
+ const bills = await api.listBills({ congress: input.congress, limit: input.limit });
146
+ ctx.log.info('Bills fetched', { congress: input.congress, count: bills.bills.length });
147
+ return bills;
148
+ }
149
+ ```
150
+
151
+ ---
152
+
153
+ ## Error Patterns
154
+
155
+ All tools share these patterns. The service layer handles them uniformly:
156
+
157
+ | Condition | Error |
158
+ |:----------|:------|
159
+ | Rate limit hit | `rateLimited('Congress.gov API rate limit reached (5,000 requests/hour).')` |
160
+ | API unavailable (5xx) | `serviceUnavailable('Congress.gov API returned HTTP {status}.')` |
161
+ | Entity not found (404) | `notFound('{entity} not found', { ...identifiers })` |
162
+ | Invalid params | `validationError('...', { field })` |
163
+ | Network error | `serviceUnavailable('Unable to reach the Congress.gov API.')` |
164
+
165
+ ---
166
+
167
+ ## Naming
168
+
169
+ | What | Convention | Example |
170
+ |:-----|:-----------|:--------|
171
+ | Files | kebab-case with suffix | `bill-lookup.tool.ts` |
172
+ | Tool/resource/prompt names | snake_case with `congressgov_` prefix | `congressgov_bill_lookup` |
173
+ | Directories | kebab-case | `src/services/congress-api/` |
174
+ | Descriptions | Single string or template literal, no `+` concatenation | `'Browse and retrieve bill data.'` |
175
+
176
+ ---
177
+
178
+ ## Imports
179
+
180
+ ```ts
181
+ // Framework — z is re-exported, no separate zod import needed
182
+ import { tool, z } from '@cyanheads/mcp-ts-core';
183
+ import { notFound, serviceUnavailable, rateLimited } from '@cyanheads/mcp-ts-core/errors';
184
+
185
+ // Server's own code — via path alias
186
+ import { getCongressApi } from '@/services/congress-api/congress-api-service.js';
187
+ import { getServerConfig } from '@/config/server-config.js';
188
+ ```
189
+
190
+ ---
191
+
192
+ ## Skills
193
+
194
+ Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool.
195
+
196
+ **Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). This makes skills available as context without needing to reference `skills/` paths manually. After framework updates, re-copy to pick up changes.
197
+
198
+ Available skills:
199
+
200
+ | Skill | Purpose |
201
+ |:------|:--------|
202
+ | `setup` | Post-init project orientation |
203
+ | `design-mcp-server` | Design tool surface, resources, and services for a new server |
204
+ | `add-tool` | Scaffold a new tool definition |
205
+ | `add-resource` | Scaffold a new resource definition |
206
+ | `add-prompt` | Scaffold a new prompt definition |
207
+ | `add-service` | Scaffold a new service integration |
208
+ | `add-test` | Scaffold test file for a tool, resource, or service |
209
+ | `field-test` | Exercise tools/resources/prompts with real inputs, verify behavior, report issues |
210
+ | `devcheck` | Lint, format, typecheck, audit |
211
+ | `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
212
+ | `maintenance` | Sync skills and dependencies after updates |
213
+ | `api-auth` | Auth modes, scopes, JWT/OAuth |
214
+ | `api-config` | AppConfig, parseConfig, env vars |
215
+ | `api-context` | Context interface, logger, state, progress |
216
+ | `api-errors` | McpError, JsonRpcErrorCode, error patterns |
217
+ | `api-services` | LLM, Speech, Graph services |
218
+ | `api-testing` | createMockContext, test patterns |
219
+ | `api-utils` | Formatting, parsing, security, pagination, scheduling |
220
+ | `api-workers` | Cloudflare Workers runtime |
221
+
222
+ When you complete a skill's checklist, check the boxes and add a completion timestamp at the end (e.g., `Completed: 2026-03-11`).
223
+
224
+ ---
225
+
226
+ ## Commands
227
+
228
+ | Command | Purpose |
229
+ |:--------|:--------|
230
+ | `bun run build` | Compile TypeScript |
231
+ | `bun run rebuild` | Clean + build |
232
+ | `bun run clean` | Remove build artifacts |
233
+ | `bun run devcheck` | Lint + format + typecheck + security |
234
+ | `bun run tree` | Generate directory structure doc |
235
+ | `bun run format` | Auto-fix formatting |
236
+ | `bun run lint:mcp` | Validate MCP tool/resource/prompt definitions |
237
+ | `bun test` | Run tests |
238
+ | `bun run dev:stdio` | Dev mode (stdio) |
239
+ | `bun run dev:http` | Dev mode (HTTP) |
240
+ | `bun run start:stdio` | Production mode (stdio) |
241
+ | `bun run start:http` | Production mode (HTTP) |
242
+
243
+ ---
244
+
245
+ ## Publishing
246
+
247
+ After a version bump and final commit, publish to both npm and GHCR:
248
+
249
+ ```bash
250
+ bun publish --access public
251
+
252
+ docker buildx build --platform linux/amd64,linux/arm64 \
253
+ -t ghcr.io/cyanheads/congressgov-mcp-server:<version> \
254
+ -t ghcr.io/cyanheads/congressgov-mcp-server:latest \
255
+ --push .
256
+ ```
257
+
258
+ Remind the user to run these after completing a release flow.
259
+
260
+ ---
261
+
262
+ ## Checklist
263
+
264
+ - [ ] Zod schemas: all fields have `.describe()`, only JSON-Schema-serializable types (no `z.custom()`, `z.date()`, `z.transform()`, etc.)
265
+ - [ ] JSDoc `@fileoverview` + `@module` on every file
266
+ - [ ] `ctx.log` for logging, `ctx.state` for storage
267
+ - [ ] Handlers throw on failure — error factories or plain `Error`, no try/catch
268
+ - [ ] Registered in `createApp()` arrays (directly or via barrel exports)
269
+ - [ ] Tests use `createMockContext()` from `@cyanheads/mcp-ts-core/testing`
270
+ - [ ] `bun run devcheck` passes
package/Dockerfile ADDED
@@ -0,0 +1,99 @@
1
+ # ==============================================================================
2
+ # Build Stage
3
+ #
4
+ # This stage installs all dependencies (including dev), builds the TypeScript
5
+ # source code into JavaScript, and prepares the production assets.
6
+ # ==============================================================================
7
+ FROM oven/bun:1 AS build
8
+
9
+ WORKDIR /usr/src/app
10
+
11
+ # Copy dependency manifests for optimized layer caching
12
+ COPY package.json bun.lock ./
13
+
14
+ # Install all dependencies (including dev dependencies for building)
15
+ RUN bun install --frozen-lockfile
16
+
17
+ # Copy the rest of the source code
18
+ COPY . .
19
+
20
+ # Build the application
21
+ RUN bun run build
22
+
23
+
24
+ # ==============================================================================
25
+ # Production Stage
26
+ #
27
+ # This stage creates a minimal, optimized, and secure image for running the
28
+ # application. It uses a slim base image and only includes production
29
+ # dependencies and build artifacts.
30
+ # ==============================================================================
31
+ FROM oven/bun:1-slim AS production
32
+
33
+ WORKDIR /usr/src/app
34
+
35
+ # Set the environment to production for performance and to ensure only
36
+ # production dependencies are installed.
37
+ ENV NODE_ENV=production
38
+
39
+ # OCI image metadata (https://github.com/opencontainers/image-spec/blob/main/annotations.md)
40
+ LABEL org.opencontainers.image.title="congressgov-mcp-server"
41
+ LABEL org.opencontainers.image.description="Access U.S. congressional data - bills, votes, members, committees - through MCP. STDIO & Streamable HTTP."
42
+ LABEL org.opencontainers.image.source="https://github.com/cyanheads/congressgov-mcp-server"
43
+ LABEL org.opencontainers.image.licenses="Apache-2.0"
44
+
45
+ # Copy dependency manifests
46
+ COPY package.json bun.lock ./
47
+
48
+ # Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
49
+ # that are not needed in the final production image.
50
+ RUN bun install --production --frozen-lockfile --ignore-scripts
51
+
52
+ # Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
53
+ # These are not bundled by default to keep the base image lean. Enable at build time
54
+ # with: docker build --build-arg OTEL_ENABLED=true
55
+ ARG OTEL_ENABLED=true
56
+ RUN if [ "$OTEL_ENABLED" = "true" ]; then \
57
+ bun add @hono/otel \
58
+ @opentelemetry/instrumentation-http \
59
+ @opentelemetry/exporter-metrics-otlp-http \
60
+ @opentelemetry/exporter-trace-otlp-http \
61
+ @opentelemetry/instrumentation-pino \
62
+ @opentelemetry/resources \
63
+ @opentelemetry/sdk-metrics \
64
+ @opentelemetry/sdk-node \
65
+ @opentelemetry/sdk-trace-node \
66
+ @opentelemetry/semantic-conventions; \
67
+ fi
68
+
69
+ # Copy the compiled application code from the build stage
70
+ COPY --from=build /usr/src/app/dist ./dist
71
+
72
+ # The 'oven/bun' image already provides a non-root user named 'bun'.
73
+ # We will use this existing user for enhanced security.
74
+
75
+ # Create and set permissions for the log directory, assigning ownership to the 'bun' user.
76
+ RUN mkdir -p /var/log/congressgov-mcp-server && chown -R bun:bun /var/log/congressgov-mcp-server
77
+
78
+ # Switch to the non-root user
79
+ USER bun
80
+
81
+ # Define an argument for the port, allowing it to be overridden at build time.
82
+ # The `PORT` variable is often injected by cloud environments at runtime.
83
+ ARG PORT
84
+
85
+ # Set runtime environment variables
86
+ # Note: PORT is an automatic variable in many cloud environments (e.g., Cloud Run)
87
+ ENV MCP_HTTP_PORT=${PORT:-3010}
88
+ ENV MCP_HTTP_HOST="0.0.0.0"
89
+ ENV MCP_TRANSPORT_TYPE="http"
90
+ ENV MCP_SESSION_MODE="stateless"
91
+ ENV MCP_LOG_LEVEL="info"
92
+ ENV LOGS_DIR="/var/log/congressgov-mcp-server"
93
+ ENV MCP_FORCE_CONSOLE_LOGGING="true"
94
+
95
+ # Expose the port the server listens on
96
+ EXPOSE ${MCP_HTTP_PORT}
97
+
98
+ # The command to start the server
99
+ CMD ["bun", "run", "dist/index.js"]
package/LICENSE ADDED
@@ -0,0 +1,191 @@
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 the 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 the 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 any 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
+ Copyright 2026 Casey Hand (cyanheads)
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.