Wraps the Open States v3 API to give Claude direct access to legislative data across all 50 states, DC, and Puerto Rico. You get 10 tools covering bill search with full-text queries and subject filters, legislator lookups by name or geolocation, committee rosters, and legislative events. The bill search returns inline sponsorships, actions, votes, and text versions when you set the include parameter, cutting down on follow-up calls. Useful for constituent research, policy tracking, and district-level analysis. Runs over stdio or streamable HTTP, and there's a public hosted instance if you want to skip local setup. Committee and event data is experimental since not all states publish it yet.
Search bills, legislators, committees, and events across all 50 US states, DC, and Puerto Rico via MCP. STDIO or Streamable HTTP.
10 tools covering the full Open States v3 API surface — bills, legislators, committees, events, and jurisdictions:
| Tool | Description |
|---|---|
openstates_search_bills | Search state legislative bills across all covered US jurisdictions with full-text search, jurisdiction/session filtering, subject tags, and sponsor lookups |
openstates_get_bill | Fetch full detail for a specific bill by OCD ID or three-part path (jurisdiction + session + bill_id) |
openstates_search_people | Search state legislators and officials by name, jurisdiction, chamber, district, or party |
openstates_get_legislators_by_location | Find all legislators representing a geographic coordinate (latitude/longitude) |
openstates_search_committees | List committees for a jurisdiction (experimental — not all states have coverage) |
openstates_get_committee | Fetch committee detail by OCD organization ID, with optional membership roster |
openstates_search_events | Search hearings, floor sessions, and committee meetings (experimental) |
openstates_get_event | Fetch full event detail including agenda, participants, and media links |
openstates_list_jurisdictions | List all 52 jurisdictions covered by Open States with session identifiers and coverage metadata |
openstates_get_jurisdiction | Fetch full metadata for a specific jurisdiction including all legislative sessions and their identifiers |
openstates_search_billsSearch state legislative bills with rich filtering and inline related data.
q)sort=latest_action_desc for bills currently moving through the legislatureinclude parameter requests sponsorships, actions, votes, abstracts, versions, and related bills inline — eliminates follow-up openstates_get_bill calls for most research workflowsaction_since and updated_since date filters for change-trackingopenstates_get_billFetch complete bill detail by OCD ID or path lookup.
openstates_id (OCD bill ID from search results, preferred) or the three-part path jurisdiction + session + bill_idHB 1000, SB 42)include=votes returns full vote tallies and per-legislator positionsinclude=versions,documents provides links to bill text and fiscal notesopenstates_search_peopleSearch legislators and officials by name, jurisdiction, chamber, or district.
org_classification targets a specific chamber: upper (Senate), lower (House/Assembly), legislature (all), executive (governors and executive officials)include=offices returns phone, fax, and mailing addressinclude=links returns website and social media linksjurisdiction — omitting it returns legislators across all statesopenstates_get_legislators_by_locationFind all state legislators representing a geographic coordinate.
openstates_list_jurisdictions and openstates_get_jurisdictionDiscover and look up jurisdiction coverage metadata.
openstates_list_jurisdictions returns all 52 jurisdictions (50 states + DC + Puerto Rico) in a single call with per_page=52 (the default)include=legislative_sessions returns all historical and current session identifiers — required before filtering bill searches by session, since formats vary widely by state (e.g., 2025, 2025-2026, 2025rs, 2025s1)openstates_get_jurisdiction fetches one jurisdiction by OCD-ID, state name, or two-letter abbreviationopenstates_search_committees, openstates_get_committee, openstates_search_events, and openstates_get_event are experimental — Open States is actively working to restore committee support and most states do not publish event data. Empty results may indicate the state lacks data, not that no committees or events exist. All four tools include a coverage_note in their output documenting this limitation.
| Type | Name | Description |
|---|---|---|
| Resource | openstates://jurisdiction/{jurisdiction_id} | Jurisdiction metadata including current sessions, coverage dates, and bill/people update timestamps |
| Prompt | openstates_bill_research | Structured framework for analyzing a state bill: summary, sponsors, committee referrals, action timeline, vote record, and related legislation |
| Prompt | openstates_legislator_profile | Research framework for profiling a legislator: sponsored bills, committee assignments, voting record, and contact details |
All resource data is also reachable via tools. Use openstates_get_jurisdiction for programmatic jurisdiction lookups; the resource is useful for injecting jurisdiction context as stable reference material.
Built on @cyanheads/mcp-ts-core:
none, jwt, oauthin-memory, filesystem, Supabase, Cloudflare KV/R2/D1Open States-specific:
include parameter strategy before any tool callsAgent-friendly output:
include parameter pattern across all search and get tools — avoids N+1 follow-up calls for common research workflows (e.g., include=sponsorships,actions on openstates_search_bills)Requires an Open States API key — register free at open.pluralpolicy.com.
Add the following to your MCP client configuration file:
{
"mcpServers": {
"openstates-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/openstates-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"OPENSTATES_API_KEY": "your-api-key"
}
}
}
}
Or with npx (no Bun required):
{
"mcpServers": {
"openstates-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/openstates-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"OPENSTATES_API_KEY": "your-api-key"
}
}
}
}
Or with Docker:
{
"mcpServers": {
"openstates-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"-e", "OPENSTATES_API_KEY=your-api-key",
"ghcr.io/cyanheads/openstates-mcp-server:latest"
]
}
}
}
For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 OPENSTATES_API_KEY=your-key bun run start:http
# Server listens at http://localhost:3010/mcp
git clone https://github.com/cyanheads/openstates-mcp-server.git
cd openstates-mcp-server
bun install
cp .env.example .env
# edit .env and set OPENSTATES_API_KEY
All configuration is validated at startup via Zod schemas in src/config/server-config.ts. Key environment variables:
| Variable | Description | Default |
|---|---|---|
OPENSTATES_API_KEY | Required. Open States API key from open.pluralpolicy.com. | — |
OPENSTATES_API_BASE_URL | Open States API base URL. | https://v3.openstates.org |
MCP_TRANSPORT_TYPE | Transport: stdio or http. | stdio |
MCP_HTTP_PORT | HTTP server port. | 3010 |
MCP_HTTP_ENDPOINT_PATH | HTTP endpoint path. | /mcp |
MCP_PUBLIC_URL | Public origin override for TLS-terminating reverse-proxy deployments. | none |
MCP_AUTH_MODE | Auth mode: none, jwt, or oauth. | none |
MCP_LOG_LEVEL | Log level (debug, info, notice, warning, error). | info |
MCP_GC_PRESSURE_INTERVAL_MS | Opt-in Bun-only forced-GC interval (ms). Try 60000 if heap grows under sustained HTTP load. | 0 (disabled) |
LOGS_DIR | Directory for log files (Node.js only). | <project-root>/logs |
STORAGE_PROVIDER_TYPE | Storage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1. | in-memory |
OTEL_ENABLED | Enable OpenTelemetry instrumentation. | false |
See .env.example for the full list of optional overrides.
Build and run the production version:
# One-time build
bun run rebuild
# Run the built server
bun run start:stdio
# or
bun run start:http
Run checks and tests:
bun run devcheck # Lint, format, typecheck, security
bun run test # Vitest test suite
bun run lint:mcp # Validate MCP definitions against spec
docker build -t openstates-mcp-server .
docker run --rm -e OPENSTATES_API_KEY=your-key -e MCP_TRANSPORT_TYPE=http -p 3010:3010 openstates-mcp-server
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/openstates-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
| Directory | Purpose |
|---|---|
src/index.ts | createApp() entry point — registers tools, resources, prompts, and inits the Open States service. |
src/config | Server-specific environment variable parsing and validation with Zod. |
src/mcp-server/tools | Tool definitions (*.tool.ts). Ten tools across bills, people, committees, events, and jurisdictions. |
src/mcp-server/resources | Resource definitions. Jurisdiction metadata resource. |
src/mcp-server/prompts | Prompt definitions. Bill research and legislator profile prompts. |
src/services/openstates | Open States API v3 service layer — HTTP client, request handling, domain types. |
tests/ | Unit and integration tests mirroring src/. |
See CLAUDE.md for development guidelines and architectural rules. The short version:
try/catch in tool logicctx.log for request-scoped logging, ctx.state for tenant-scoped storagesrc/index.tsIssues and pull requests are welcome. Run checks and tests before submitting:
bun run devcheck
bun run test
Apache-2.0 — see LICENSE for details.
OPENSTATES_API_KEY*Open States API key from open.pluralpolicy.com. Required to make any API requests.
MCP_LOG_LEVELdefault: infoSets the minimum log level for output (e.g., 'debug', 'info', 'warn').
MCP_HTTP_HOSTdefault: 127.0.0.1The hostname for the HTTP server.
MCP_HTTP_PORTdefault: 3010The port to run the HTTP server on.
MCP_HTTP_ENDPOINT_PATHdefault: /mcpThe endpoint path for the MCP server.
MCP_AUTH_MODEdefault: noneAuthentication mode to use: 'none', 'jwt', or 'oauth'.
com.mcparmory/google-search
io.github.pipeworx-io/brave-search
marcopesani/mcp-server-serper
brave/brave-search-mcp-server
com.mcparmory/google-search-console
acamolese/google-search-console-mcp