@cyanheads/openstates-mcp-server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@cyanheads/openstates-mcp-serverfind bills about education in California"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Public Hosted Server: https://openstates.caseyjhand.com/mcp
Tools
10 tools covering the full Open States v3 API surface — bills, legislators, committees, events, and jurisdictions:
Tool | Description |
| Search state legislative bills across all covered US jurisdictions with full-text search, jurisdiction/session filtering, subject tags, and sponsor lookups |
| Fetch full detail for a specific bill by OCD ID or three-part path (jurisdiction + session + bill_id) |
| Search state legislators and officials within a jurisdiction by name, chamber, district, or party |
| Find all legislators representing a geographic coordinate (latitude/longitude) |
| List committees for a jurisdiction (experimental — not all states have coverage) |
| Fetch committee detail by OCD organization ID, with optional membership roster |
| Search hearings, floor sessions, and committee meetings (experimental) |
| Fetch full event detail including agenda, participants, and media links |
| List all 56 jurisdictions (50 states, DC, and 5 US territories) covered by Open States with session identifiers and coverage metadata |
| Fetch full metadata for a specific jurisdiction including all legislative sessions and their identifiers |
openstates_search_bills
Search state legislative bills with rich filtering and inline related data.
Full-text search across bill titles, abstracts, and text (
q)Filter by jurisdiction (state name, two-letter abbreviation, or OCD-ID), session, chamber, classification, subject tags, and sponsor
Sort by latest action, first action, or update time — use
sort=latest_action_descfor bills currently moving through the legislatureincludeparameter requests sponsorships, actions, votes, abstracts, versions, and related bills inline — eliminates follow-upopenstates_get_billcalls for most research workflowsSponsors carry linked person records (OCD person ID + name) when available, so a sponsor chains onward by ID rather than by name match
Every result carries
openstates_url(citable page) andupdated_at(the field the defaultsort=updated_descorders by)action_since,updated_since, andcreated_sincedate filters for change-trackingPagination up to 20 results per page
Empty-result recovery: echoes applied filters and suggests how to broaden
openstates_get_bill
Fetch complete bill detail by OCD ID or path lookup.
Two lookup modes:
openstates_id(OCD bill ID from search results, preferred) or the three-part pathjurisdiction + session + bill_idAccepts bill identifiers in legislature format (e.g.,
HB 1000,SB 42)include=votesreturns full vote tallies and per-legislator positionsinclude=versions,documentsprovides links to bill text and fiscal notesSponsors carry linked person records (OCD person ID + name) when available
openstates_search_people
Search legislators and officials within one jurisdiction by name, chamber, or district.
jurisdictionis required — a search spanning all 56 jurisdictions exceeds the upstream timeout, name-only searches included, so an omittedjurisdictionis rejected before any request is issued. Useopenstates_list_jurisdictionsto pick one, oropenstates_get_legislators_by_locationwhen you have coordinates but no stateCase-insensitive substring matching on name
org_classificationtargets a role type:upper(Senate),lower(House/Assembly),executive(governors and executive officials),legislature(every legislator — both chambers merged into one paginated set, all upper members then all lower)Omitting
org_classificationis not equivalent tolegislature— it returns every officeholder, executive officials includedinclude=officesreturns phone, fax, and mailing addressinclude=linksreturns website and social media linksEvery result carries the member's official headshot URL (
image) when published, and the OCD division their district maps to (current_role.division_id)
openstates_get_legislators_by_location
Find all state legislators representing a geographic coordinate.
Pass decimal-degree latitude/longitude to get state senators and representatives for that location
Useful for constituent-to-representative matching, address-based policy research, and electoral boundary analysis
Does not geocode addresses — the caller must provide coordinates
Returns a coverage note when no legislators are found (e.g., coordinates outside US boundaries)
openstates_list_jurisdictions and openstates_get_jurisdiction
Discover and look up jurisdiction coverage metadata.
openstates_list_jurisdictionsreturns all 56 jurisdictions (50 states, DC, and 5 US territories) in a single default call — the pages are merged server-side, since the upstreamper_pageceiling of 52 no longer covers the full setinclude=legislative_sessionsreturns 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_jurisdictionfetches one jurisdiction by OCD-ID, state name, or two-letter abbreviation
Committee and event tools (experimental)
openstates_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. The two search tools (openstates_search_committees and openstates_search_events) include a coverageNote field in their output documenting this limitation, and both require a jurisdiction — a request spanning all 56 exceeds the upstream timeout, so an omitted one is rejected before any request is issued.
Related MCP server: LegiScan MCP Server
Resources and prompts
Type | Name | Description |
Resource |
| Jurisdiction metadata including current sessions, coverage dates, and bill/people update timestamps |
Prompt |
| Structured framework for analyzing a state bill: summary, sponsors, committee referrals, action timeline, vote record, and related legislation |
Prompt |
| 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.
Features
Built on @cyanheads/mcp-ts-core:
Declarative tool, resource, and prompt definitions — single file per primitive, framework handles registration and validation
Unified error handling — handlers throw, framework catches, classifies, and formats
Pluggable auth:
none,jwt,oauthSwappable storage backends:
in-memory,filesystem,Supabase,Cloudflare KV/R2/D1Structured logging with optional OpenTelemetry tracing
STDIO and Streamable HTTP transports
Open States-specific:
Full Open States v3 API coverage: bills, people, committees, events, and jurisdictions
Dual lookup modes on bill and committee fetchers (OCD ID or structured path)
Geo-based legislator lookup via the Open States people-by-geo endpoint
Server-level instructions prime the agent with session discovery workflow and
includeparameter strategy before any tool calls
Agent-friendly output:
Empty-result recovery: tools echo the applied filters and suggest how to broaden when no results are returned
Experimental coverage notes on committee and event tools — agents can surface these to users rather than returning silent empty results
includeparameter pattern across all search and get tools — avoids N+1 follow-up calls for common research workflows (e.g.,include=sponsorships,actionsonopenstates_search_bills)
Getting started
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/mcpPrerequisites
Bun v1.3.0 or higher (or Node.js v24+).
An Open States API key — register free at open.pluralpolicy.com.
Installation
Clone the repository:
git clone https://github.com/cyanheads/openstates-mcp-server.gitNavigate into the directory:
cd openstates-mcp-serverInstall dependencies:
bun installConfigure environment:
cp .env.example .env
# edit .env and set OPENSTATES_API_KEYConfiguration
All configuration is validated at startup via Zod schemas in src/config/server-config.ts. Key environment variables:
Variable | Description | Default |
| Required. Open States API key from open.pluralpolicy.com. | — |
| Open States API base URL. |
|
| Maximum upstream requests per rolling 24 hours. Once spent, calls are rejected before the request is issued, so an over-budget call costs nothing upstream. The default matches the v3 free-tier daily cap — raise it if your key's tier allows more. |
|
| Per-attempt upstream deadline in milliseconds (minimum |
|
| Transport: |
|
| HTTP server port. |
|
| HTTP endpoint path. |
|
| Public origin override for TLS-terminating reverse-proxy deployments. | none |
| Auth mode: |
|
| Log level ( |
|
| Opt-in Bun-only forced-GC interval (ms). Try |
|
| Directory for log files (Node.js only). |
|
| Storage backend: |
|
| Enable OpenTelemetry instrumentation. |
|
See .env.example for the full list of optional overrides.
Running the server
Local development
Build and run the production version:
# One-time build bun run rebuild # Run the built server bun run start:stdio # or bun run start:httpRun 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
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-serverThe 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.
Project structure
Directory | Purpose |
|
|
| Server-specific environment variable parsing and validation with Zod. |
| Tool definitions ( |
| Resource definitions. Jurisdiction metadata resource. |
| Prompt definitions. Bill research and legislator profile prompts. |
| Open States API v3 service layer — HTTP client, request handling, domain types. |
| Unit and integration tests mirroring |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storageRegister new tools and resources via the arrays in
src/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues and pull requests are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
Apache-2.0 — see LICENSE for details.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceThis MCP server enables interaction with the Open States API, allowing users to access legislative data from US state governments through natural language commands.Last updated
- AlicenseAqualityBmaintenanceProvides access to legislative data from all 50 US states through the LegiScan API, enabling comprehensive search and retrieval of bills, votes, legislators, and legislative session information.Last updated10289MIT
- AlicenseAqualityCmaintenanceSearch bills and speaker-attributed hearing transcripts across all 50 US state legislatures.Last updated71MIT
- Alicense-qualityDmaintenanceEnables querying U.S. legislative data from Congress.gov API using MCP resources for direct lookups and tools for searching and retrieving related data.Last updated8MIT
Related MCP Connectors
Search bills and speaker-attributed hearing transcripts across all 50 US state legislatures.
OpenStates MCP — bills, legislators, votes in all 50 US states
LegiScan MCP — wraps the LegiScan API (api.legiscan.com)
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyanheads/openstates-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server