Bill Commons

org.billcommons由 billcommons.org 發布官方發布者v1.0.0更新於 Oct 24, 2026

Search 209k+ US state bills, all 50 states + DC: full text, sponsors, votes, status. Free.

已驗證Streamable HTTP可網頁執行網頁搜尋與抓取知識與記憶

概覽

AI 產生的概覽

遠端 MCP 伺服器,可檢索並分析涵蓋全美 50 州及華盛頓特區的 20.9 萬+ 州法案,含全文、提案人、表決與進程。

可以做什麼
  • 跨轄區檢索法案全文、標題與描述,支援引號片語、OR 與排除語法
  • 依 ID 或轄區加法案編號取得完整紀錄,含提案人、主題、行動與版本
  • 比較同一法案兩個版本的文本差異,並跨轄區找出標題相似的法案
  • 取得含議員層級紀錄的表決事件,並梳理法案的立法進程時間軸
  • 產出可直接引用的證據包,並查詢轄區涵蓋情況與目前會期
  • 列出跨州主題追蹤清單,如人工智慧、資料隱私、網路安全等
適用情境
適合研究美國州級立法時使用:跨州追蹤某議題的法案、查核提案人與表決、比較法案版本,或整理可引用的立法證據,而不必自行爬取各州網站。
執行需求
需要一個遠端 Streamable HTTP 端點;一般使用不需 API 金鑰或本機安裝。匿名呼叫依 IP 每日上限 2,000 次、依 /24 子網每日上限 5,000 次;免費 API 金鑰可提高上限。
安裝前請注意
工具為唯讀研究用途,但部分結果由服務端計算並標示為「衍生」而非官方文件,引用前應核對官方來源。高流量或批次使用需付費,匿名使用受依 IP 與子網的速率限制。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Bill Commons,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/org.billcommons%2Fbill-commons/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "bill-commons": {
      "type": "http",
      "url": "https://mcp.billcommons.org/mcp"
    }
  }
}

README

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

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:

bash
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 pageapps/api        FastAPI — REST API (/api/v1)apps/mcp        MCP server (Streamable HTTP, mounted at /mcp)workers/ingest  Ingestion workers, job queue, per-source adapterspackages/schema SQLAlchemy models + Alembic migrations (single source of truth)packages/shared Shared Python utils: bill-number normalization, rawstore, http clientpackages/source-registry  Per-jurisdiction source registry (data + loader)packages/search Search SQL builders / query parsinginfra/docker    Dockerfiles + docker-compose.yml (local stack)infra/deployment Railway/Vercel configs, DNS runbookdocs/           Architecture, API, sources, operations, state-coverage docsdata/registry   Machine-readable registry (sessions, sources)

Local development setup

Prerequisites

  • Python 3.12
  • PostgreSQL 16 (with pg_trgm, unaccent, pgcrypto extensions available)
  • Node.js 20+ (for apps/web)

Python environment

bash
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:

bash
cd packages/schema../../.venv/bin/alembic upgrade head

Seeding data locally

bash
# 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

bash
# 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/webnpm installNEXT_PUBLIC_API_BASE=http://localhost:8000 npm run dev

Tests

bash
.venv/bin/pytest packages/shared/tests.venv/bin/pytest workers/ingest/tests.venv/bin/pytest apps/api/tests

Running the stack locally with Docker

bash
cd infra/dockerdocker 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

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.

來源:README.md,提交 43b1cf3

工具

10

search_legislation

Search FULL BILL TEXT -- not just known-bill-number lookup. `q` is matched against titles, descriptions, AND ingested document text via Postgres websearch_to_tsquery (supports "quoted phrases", OR, and -exclusion, same syntax as a search engine), with a fuzzy pg_trgm title-similarity fallback when the exact query has no hits. `q` can ALSO be a bill number ("HB 123", "H.B. 123", "hb123" all match) and that fast path is tried first. Optionally filter by jurisdiction (two-letter state code or name), chamber, and status. For a curated cross-state slice of a subject (e.g. "every AI bill in the country") rather than an ad-hoc keyword search, call list_topics first -- its membership rules also match on structured subject tags this full-text search does not see.

輸入參數q必填limitstatuschamberjurisdiction

get_bill_record

Fetch the full record for one bill: metadata, sponsors, subjects, actions, versions, and vote-event summaries. Look up by canonical bill_id (UUID), or by jurisdiction + identifier (+ optional session to disambiguate). For a human bill number like HB 123, use jurisdiction="NC", identifier="HB 123"; bill_id is for UUIDs.

輸入參數bill_idsessionidentifierjurisdictioninclude_full_text

compare_bill_versions

Deterministic diff (unified + structured) between two versions of a bill's extracted text. Defaults to earliest vs. latest texted version if version ids are omitted. Errors if fewer than 2 versions have extracted text. Result is labeled 'derived' (computed by Bill Commons, not an official document).

輸入參數bill_id必填version_id_aversion_id_b

find_similar_bills

Find bills with similar titles via deterministic trigram similarity, across jurisdictions. Labeled 'derived' -- not an official cross-reference or companion-bill designation.

輸入參數limitbill_id必填

get_vote_details

Fetch vote event(s) with member-level (yes/no/other/absent) vote records. Provide vote_event_id for one vote, or bill_id for all recorded votes on that bill.

輸入參數bill_idvote_event_id

trace_legislative_history

Full chronological legislative history for a bill: merged timeline of actions, version publications, and votes, plus related-bill links.

輸入參數bill_id必填

build_legislative_evidence_packet

Compile a citation-ready evidence packet for a bill: full official record, legislative history timeline, votes with member-level detail, and hearings -- each explicitly labeled official vs. derived with source URLs. Returns a `how_to_cite` block with a one-line `cite_as` sentence, a human `permalink`, a JSON `download_url`, and a `snapshot_id` that changes if and only if a cited fact about the bill changes -- so a reader can check later whether the citation still holds. Snapshots are NOT archived; the id is a change detector, not a way to retrieve an older packet. Pass `question` to record what the packet was assembled to answer; it is echoed into the artifact so a filed packet carries its own scope.

輸入參數bill_id必填questioninclude_full_text

get_jurisdiction_coverage

Return the jurisdiction_coverage state-machine status for one state (abbreviation or name), or the full stored coverage matrix if state is omitted. Public-registry and unlisted row counts are explicit. Includes bounded retained official-source observation health and evidence links. Coverage status measures stored bill/text availability; local coverage timestamps can advance on count recomputation. Statewide semantic freshness remains unverified, including for GREEN coverage.

輸入參數state

get_active_sessions

List legislative sessions currently flagged active, optionally filtered by jurisdiction (two-letter state code or name).

輸入參數jurisdiction

list_topics

List Bill Commons' curated cross-state topic trackers (e.g. artificial intelligence, youth online safety, platform accountability, cybersecurity, cryptocurrency, data privacy, local government & preemption) -- the entry point for "what subjects does Bill Commons track across all 50 states + DC" and "how do I get every bill in one". Each topic is a title/subject membership rule tuned for precision over recall, with a live bill_count and how_to_fetch_bills. This tool does not itself return bill rows -- pair it with search_legislation or the REST API's /topics/{slug} for the bills.

無需輸入參數。

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分