streamable-httpApache-2.0updated 13d ago
Bill Commons is a public, open-source legislative search platform covering the current session/biennium for all 50 U.S. states plus DC. It provides a web search UI, a REST API, an MCP (Model Context Protocol) server, and a public status/coverage page. Public infrastructure first: no paywall on ordinary search or reasonable API use β anonymous callers get a generous daily cap (2,000 requests/day per IP, 5,000/day per /24 subnet); a free API key raises that further, and only high-volume/bulk use is paid. See /docs/bulk for API keys and full-corpus snapshots.
What can you do with bill commons?
Bill Commons
Bill Commons is a public, open-source legislative search platform covering the
current session/biennium for all 50 U.S. states plus DC. It provides a web
search UI, a REST API, an MCP (Model Context Protocol) server, and a public
status/coverage page. Public infrastructure first: no paywall on ordinary
search or reasonable API use β anonymous callers get a generous daily cap
(2,000 requests/day per IP, 5,000/day per /24 subnet); a free API key raises
that further, and only high-volume/bulk use is paid. See
/docs/bulk for API keys and
full-corpus snapshots.
See docs/architecture/ARCHITECTURE.md
for the locked architecture and data model.
Production
- Web: https://billcommons.org (search UI + public status/coverage page at https://status.billcommons.org)
- API: https://api.billcommons.org/api/v1 β interactive OpenAPI docs at https://api.billcommons.org/docs
- MCP (Streamable HTTP): https://mcp.billcommons.org/mcp
Hosted on Railway (project billcommons: api, mcp, worker services +
managed Postgres) and Vercel (project billcommons-web). See
docs/operations/deployment-runbook.md
for the full deploy/rollback procedure.
Use with Claude (or any MCP client)
The hosted MCP server gives AI assistants direct access to all 209k+ bills β no API key, no setup beyond one command:
claude mcp add bill-commons --transport http https://mcp.billcommons.org/mcp
Claude Desktop: Settings β Connectors β Add custom connector with URL
https://mcp.billcommons.org/mcp. Cursor and other clients: add the same URL
as a Streamable HTTP server in mcp.json.
Ten tools including search_legislation, get_bill_record,
compare_bill_versions, and trace_legislative_history. Full walkthrough
(including REST recipes for agents without MCP):
https://billcommons.org/docs/agents
Architecture at a glance
βββββββββββββββ
users ββββββββββΆ β apps/web β Next.js, billcommons.org
β (Vercel) β status.billcommons.org (rewrite β /coverage)
ββββββββ¬βββββββ
β HTTPS (NEXT_PUBLIC_API_BASE)
βΌ
βββββββββββββββ ββββββββββββββββ
β apps/api βββββββββΆβ apps/mcp β Streamable HTTP
β FastAPI β β 10 MCP toolsβ mcp.billcommons.org
β /api/v1 β ββββββββββββββββ
β api.billcommons.org
ββββββββ¬βββββββ
β reads (SQLAlchemy)
βΌ
βββββββββββββββββββββββββββββββ
β Postgres 16 (Railway) β
β jurisdictions, sessions, β
β bills, actions, sponsorships,β
β votes, ingest_jobs, coverage β
ββββββββββββββββ²βββββββββββββββ
β writes (idempotent upserts)
ββββββββββββββββ΄βββββββββββββββ
β workers/ingest (worker svc) β
β autoboot: seed β bootstrap ββ
β schedule-refresh β job loop β
β sources: Open States bulk CSVβ
β (T2 bootstrap) + v3 API (T2 β
β incremental, OPENSTATES_API_ β
β KEY) + full-text fetcher β
ββββββββββββββββ¬βββββββββββββββ
βΌ
RawStore (filesystem, RAWSTORE_ROOT
volume in prod) β sha256-addressed
raw payload archive
packages/schema (SQLAlchemy models + Alembic) is the single source of
truth every other package/app imports from β no service owns its own copy
of the data model.
Monorepo layout
apps/web Next.js 15 (App Router, TS) β search UI + status page
apps/api FastAPI β REST API (/api/v1)
apps/mcp MCP server (Streamable HTTP, mounted at /mcp)
workers/ingest Ingestion workers, job queue, per-source adapters
packages/schema SQLAlchemy models + Alembic migrations (single source of truth)
packages/shared Shared Python utils: bill-number normalization, rawstore, http client
packages/source-registry Per-jurisdiction source registry (data + loader)
packages/search Search SQL builders / query parsing
infra/docker Dockerfiles + docker-compose.yml (local stack)
infra/deployment Railway/Vercel configs, DNS runbook
docs/ Architecture, API, sources, operations, state-coverage docs
data/registry Machine-readable registry (sessions, sources)
Local development setup
Prerequisites
- Python 3.12
- PostgreSQL 16 (with
pg_trgm,unaccent,pgcryptoextensions available) - Node.js 20+ (for
apps/web)
Python environment
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
This installs packages/schema and packages/shared as editable installs
(single source of truth for the data model + shared utils), plus the
worker package: .venv/bin/pip install -e workers/ingest. Install the API
package too if you're working on it: .venv/bin/pip install -e apps/api.
Database
Set DATABASE_URL in your environment (or in ~/.config/billcommons/.env,
which is read as a fallback and is never committed):
DATABASE_URL=postgresql://user:password@host:port/dbname
Requires Postgres 16 with the pg_trgm and unaccent extensions available
(created by migration 0001). Run migrations:
cd packages/schema
../../.venv/bin/alembic upgrade head
Seeding data locally
# Seed all 51 jurisdictions/sessions/coverage rows from the registry:
.venv/bin/python -m billcommons_ingest seed-registry
# Download a state's Open States bulk-CSV zip and ingest it (see
# docs/operations/ingestion-runbook.md for the full command reference):
python3 workers/ingest/download_bulk.py --only NC
.venv/bin/python -m billcommons_ingest bootstrap --state NC --zip data/bulkzips/NC_2025.zip
.venv/bin/python -m billcommons_ingest recompute-coverage
Running the apps locally
# API (FastAPI, http://localhost:8000, docs at /docs)
.venv/bin/uvicorn main:app --app-dir apps/api --reload --port 8000
# MCP server (Streamable HTTP, http://localhost:8400/mcp by default)
.venv/bin/python apps/mcp/server.py
# Ingestion worker (long-running queue loop; runs schedule-refresh
# periodically inside the same process)
.venv/bin/python -m billcommons_ingest worker
# Web app (Next.js β separate from the Python stack)
cd apps/web
npm install
NEXT_PUBLIC_API_BASE=http://localhost:8000 npm run dev
Tests
.venv/bin/pytest packages/shared/tests
.venv/bin/pytest workers/ingest/tests
.venv/bin/pytest apps/api/tests
Running the stack locally with Docker
cd infra/docker
docker compose up --build
This brings up Postgres, the API, the ingestion worker, and the MCP server.
The web app (apps/web) is run separately via npm run dev during local
development (see infra/docker/docker-compose.yml for the placeholder
service definition).
Documentation
docs/architecture/ARCHITECTURE.mdβ locked architecture + data modeldocs/SPEC.mdβ requirements digest / acceptance gatedocs/operations/deployment-runbook.mdβ Railway/Vercel deploy, rollback, smoke checklistdocs/operations/ingestion-runbook.mdβ CLI reference, job queue, refresh cadencedocs/operations/source-failure-runbook.mdβ stale zips, 401/429, robots blocksdocs/operations/backup-restore.mdβ pg_dump/restore, raw-data re-fetchdocs/operations/add-a-jurisdiction.mdβ onboarding a new territory/statedocs/state-coverage/methodology.mdβ coverage state machine, GREEN criteriadocs/api/examples.mdβ curl/Python/JavaScript examples against the live APIdocs/sources/openstates-csv.mdβ Open States bulk CSV column mapping
License
Apache-2.0. See LICENSE and NOTICE for data attribution (Open States / Plural Policy, public-domain legislative data).
Contributing
See CONTRIBUTING.md. This project follows the Contributor Covenant.
Security
See SECURITY.md for responsible disclosure.
Install
Add bill commons to your client. Pick the one you use.
claude mcp add --transport http bill-commons https://mcp.billcommons.org/mcpcodex mcp add bill-commons --url https://mcp.billcommons.org/mcp{
"mcpServers": {
"bill-commons": {
"url": "https://mcp.billcommons.org/mcp"
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
{
"servers": {
"bill-commons": {
"type": "http",
"url": "https://mcp.billcommons.org/mcp"
}
}
}Add to `.vscode/mcp.json` in your workspace.
{
"mcpServers": {
"bill-commons": {
"url": "https://mcp.billcommons.org/mcp"
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"bill-commons": {
"serverUrl": "https://mcp.billcommons.org/mcp"
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
Score
39 / 100
Incomplete
- Documentation25/25
- Maintenance19/25
- Trust13/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 6 days ago
- Has a release history
- Repository is not archived
- Licensed Apache-2.0
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 6 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint β no local install
Version history
| Versions | Published |
|---|---|
| 1.0.0Latest | Jul 28, 2026 |