@pipeworx/mcp-congress 0.1.0 → 0.1.2

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Pipeworx
3
+ Copyright (c) 2026 Mojibake Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,17 +1,63 @@
1
- # mcp-congress
1
+ # US Congress — Bills, Votes, Members (GovTrack)
2
2
 
3
- Congress MCP — US Congress data via GovTrack API (free, no auth required)
3
+ US federal bills (House and Senate), members of Congress and roll-call votes, served from GovTrack's public API (`www.govtrack.us/api/v2`), which mirrors the Library of Congress record from the 93rd Congress (1973) onward. Bill status, who voted what, who sponsors what. Free, no API key.
4
4
 
5
- Part of the [Pipeworx](https://pipeworx.io) open MCP gateway.
5
+ Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1683+ live data sources.
6
6
 
7
- ## Tools
7
+ ## Why this matters for AI agents
8
8
 
9
- | Tool | Description |
10
- |------|-------------|
9
+ For policy research, agents need to know what bills exist, who's sponsoring them, where they are in the legislative process, and how votes broke. Congress.gov is the canonical record. Pair with [Federal Register](/docs/reference/federal-register) (rules implementing legislation) and [USAspending](/docs/reference/usaspending) (where the money goes after authorization).
10
+
11
+ Common flows:
12
+
13
+ - **Bill search.** "What bills are pending on AI regulation?" → search by keyword, filter by Congress and chamber.
14
+ - **Bill detail.** "Status of HR 9876?" → get full bill record with sponsor, cosponsors, committee referrals, recent action.
15
+ - **Member lookup.** "Who represents Colorado's 1st district?" → member by state/district or by name.
16
+ - **Vote tracking.** Recorded votes by bill, member, or session.
17
+
18
+ ## Auth
19
+
20
+ None. GovTrack's API is public and keyless; this pack sends no credential.
21
+
22
+ ## Search ranking (`search_bills`)
23
+
24
+ GovTrack's `q` parameter is a loose keyword match with no relevance ordering — for "Lower Energy Costs Act" it reports ~4,300 matches and puts a 2014 salmon bill first, while H.R. 1 (118th), the bill literally so named, sits 86th inside its own Congress's matches and beyond the 1,000-row offset GovTrack allows. `order_by=relevance` is rejected. So `search_bills` gathers candidates itself and ranks them locally:
25
+
26
+ - **Candidates.** One unfiltered page (100 rows) plus one page for each of the three most recent Congresses. If nothing yet contains the query phrase, it pages deeper into those Congresses (up to 300 rows each), then takes one page from each of the six Congresses before them. Pass `congress` to search a single Congress exhaustively (up to ~1,100 rows) — do this for a bill older than about six years.
27
+ - **Ranking.** Every title a bill has ever carried (display, short, short-partial, official) is scored: exact title, then a title containing the phrase (shorter wins), then all query words present (prefix-tolerant, so "lower" matches "Lowering"), then partial overlap. Ties go to the newer Congress. Each returned bill carries `match` (`exact` / `phrase` / `all_words` / `partial` / `none`) and `matched_title`.
28
+ - **`total`** is GovTrack's loose-match count, not the number of bills about the subject; `total_note` says so in the payload, and `ranking` states that upstream order was not used.
29
+
30
+ ## Congress numbering
31
+
32
+ Congresses are numbered sequentially: 119th Congress = 2025-2027 (started Jan 2025), 118th = 2023-2025, etc. Bills carry their Congress number — `HR1` of the 119th is a different bill than `HR1` of the 118th.
33
+
34
+ ## Bill type prefixes
35
+
36
+ | Prefix | What it is | Chamber |
37
+ |---|---|---|
38
+ | HR | House Bill | House |
39
+ | HRES | House Resolution (procedural) | House |
40
+ | HJRES | House Joint Resolution | House |
41
+ | HCONRES | House Concurrent Resolution | House |
42
+ | S | Senate Bill | Senate |
43
+ | SRES | Senate Resolution | Senate |
44
+ | SJRES | Senate Joint Resolution | Senate |
45
+ | SCONRES | Senate Concurrent Resolution | Senate |
46
+
47
+ For "regular legislation" purposes, HR and S are the meaningful types. Resolutions don't have force of law (HRES, SRES) or are limited (HJRES, SJRES — the latter can amend the Constitution if ratified).
48
+
49
+ ## Common pitfalls
50
+
51
+ - **Bill status nuance.** "Introduced" is the start. "Reported" by committee is meaningful progress. "Engrossed" / "passed chamber" matters. "Enrolled" / "presented to president" is near-final. Most bills die quietly in committee; "introduced" alone is weak signal.
52
+ - **Companion bills.** Identical legislation often introduced in both chambers as paired bills (HR 1234 + S 567). Both must pass. The Congress.gov API has cross-references; use them.
53
+ - **Roll-call votes only.** Many congressional decisions happen by voice vote or unanimous consent. Those don't appear in roll-call records. "No vote against" doesn't mean unanimous support.
54
+ - **Committee referrals.** A bill can be referred to multiple committees (sequential, joint, or split). It must clear all to advance. The committee structure matters more than the introduction.
55
+ - **Member-vote alignment.** Don't equate "voted yes" with "supports." Procedural votes (motion to recommit, cloture) often have substantive meaning that surface text doesn't capture.
56
+ - **Cosponsorship is cheap.** Members cosponsor freely. A 100-cosponsor bill is meaningful; a 5-cosponsor bill in a 435-member House isn't necessarily.
11
57
 
12
58
  ## Quick Start
13
59
 
14
- Add to your MCP client config:
60
+ Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
15
61
 
16
62
  ```json
17
63
  {
@@ -23,12 +69,92 @@ Add to your MCP client config:
23
69
  }
24
70
  ```
25
71
 
26
- Or use the CLI:
72
+ ### What this endpoint actually serves
73
+
74
+ `tools/list` at `https://gateway.pipeworx.io/congress/mcp` returns the tools in the table
75
+ above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
76
+ `discover_tools`, `search_within`, `remember`/`recall` and the rest of the
77
+ gateway-wide set. So the tool count you see is larger than this table: a
78
+ single-pack endpoint currently lists roughly 30 shared tools alongside the
79
+ pack's own. The connection's `initialize` response states its exact scope, and
80
+ is the authoritative answer for a given day.
81
+
82
+ This is deliberate, not multiplexing by accident. The meta-tools are what let a
83
+ scoped connection answer a question this pack does not cover — via
84
+ `ask_pipeworx`, which routes across the whole catalog — without you adding a
85
+ second MCP server. There is currently no way to mount a pack endpoint without
86
+ them; if the extra schemas cost you more context than the routing is worth,
87
+ connect to the full gateway once rather than to several pack endpoints.
88
+
89
+ Or connect to the full Pipeworx gateway to get every pack's tools listed
90
+ directly, instead of just this one's:
91
+
92
+ ```json
93
+ {
94
+ "mcpServers": {
95
+ "pipeworx": {
96
+ "url": "https://gateway.pipeworx.io/mcp"
97
+ }
98
+ }
99
+ }
100
+ ```
101
+
102
+ Both URLs reach the same gateway and the same 1683+ data sources. The
103
+ only difference is which pack's tools are listed **directly**; `ask_pipeworx`
104
+ reaches all of them from either one.
105
+
106
+ ## No MCP client? Call it over HTTP
107
+
108
+ ```bash
109
+ curl -X POST https://gateway.pipeworx.io/v1/tools/congress_search_bills \
110
+ -H 'Content-Type: application/json' \
111
+ -d '{"query":"Lower Energy Costs Act","limit":10}'
112
+ ```
113
+
114
+ No account needed for the first calls. Inspect any tool: `GET https://gateway.pipeworx.io/v1/tools/congress_search_bills`. Find one: `POST https://gateway.pipeworx.io/v1/tools/search_packs` with `{"query":"..."}`.
115
+
116
+ ## Standalone (no gateway account)
117
+
118
+ This package also runs as a local stdio MCP server — no Pipeworx account, no
119
+ gateway round-trip:
120
+
121
+ ```json
122
+ {
123
+ "mcpServers": {
124
+ "congress": {
125
+ "command": "npx",
126
+ "args": ["-y", "@pipeworx/mcp-congress"]
127
+ }
128
+ }
129
+ }
130
+ ```
131
+
132
+ Or run it directly to confirm it starts:
27
133
 
28
134
  ```bash
29
- npx pipeworx use congress
135
+ npx -y @pipeworx/mcp-congress
30
136
  ```
31
137
 
138
+ It speaks MCP over stdin/stdout and answers `initialize`/`tools/list`/`tools/call`
139
+ for **only** this pack's tools — none of the shared meta-tools the gateway
140
+ connection above adds. Same source, same tools, no ask_pipeworx routing.
141
+
142
+ ## Using with ask_pipeworx
143
+
144
+ Instead of calling tools directly, you can ask questions in plain English —
145
+ this works on the pack endpoint above as well as on the full gateway:
146
+
147
+ ```
148
+ ask_pipeworx({ question: "your question about Congress data" })
149
+ ```
150
+
151
+ The gateway picks the right tool and fills the arguments automatically.
152
+
153
+ ## More
154
+
155
+ - [Docs and guides](https://pipeworx.io/docs)
156
+ - [pipeworx.io](https://pipeworx.io)
157
+
32
158
  ## License
33
159
 
34
160
  MIT
package/bin/cli.js ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ //
3
+ // Entry point for `npx @pipeworx/mcp-<slug>`.
4
+ //
5
+ // Packs ship as raw TypeScript (no build step — see publish-pack.sh for why:
6
+ // tsx sidesteps every extensionless-import / bare-JSON-import edge case a
7
+ // per-pack tsc build would have to solve one pack at a time). This file
8
+ // registers tsx's ESM loader programmatically, then hands off to src/server.ts,
9
+ // which wraps the pack's {tools, callTool} export in a stdio MCP server.
10
+ //
11
+ // Copied verbatim into every published pack repo by scripts/publish-pack.sh —
12
+ // edit this file, not a per-pack copy.
13
+ import { register } from 'tsx/esm/api';
14
+
15
+ register();
16
+
17
+ await import('../src/server.ts');
package/package.json CHANGED
@@ -1,20 +1,32 @@
1
1
  {
2
2
  "name": "@pipeworx/mcp-congress",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Congress MCP — US Congress data via GovTrack API (free, no auth required)",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
7
7
  "types": "src/index.ts",
8
+ "bin": {
9
+ "mcp-congress": "bin/cli.js"
10
+ },
8
11
  "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "congress"],
9
12
  "license": "MIT",
10
13
  "repository": {
11
14
  "type": "git",
12
- "url": "https://github.com/pipeworx-io/mcp-congress"
15
+ "url": "git+https://github.com/pipeworx-io/mcp-congress.git"
13
16
  },
14
17
  "scripts": {
15
18
  "typecheck": "tsc --noEmit"
16
19
  },
20
+ "dependencies": {
21
+ "@modelcontextprotocol/sdk": "^1.30.0",
22
+ "tsx": "^4.19.0"
23
+ },
17
24
  "devDependencies": {
18
- "typescript": "^5.7.0"
25
+ "typescript": "^5.9.3",
26
+ "@cloudflare/workers-types": "^4.20260405.1"
27
+ },
28
+ "pipeworx": {
29
+ "sourceHash": "v1-aa80fab12f1c5470ad5097592064581debd177b8964b1d677ad7dbb8ded010e1",
30
+ "sourceCommit": "5b29c2b0c11e1fcd954969a245b474e6e9475116"
19
31
  }
20
32
  }
package/server.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
3
  "name": "io.github.pipeworx-io/congress",
4
- "title": "congress",
4
+ "title": "Congress",
5
5
  "description": "Congress MCP — US Congress data via GovTrack API (free, no auth required)",
6
- "version": "0.1.0",
6
+ "version": "0.1.2",
7
7
  "websiteUrl": "https://pipeworx.io/packs/congress",
8
8
  "repository": {
9
9
  "url": "https://github.com/pipeworx-io/mcp-congress",