LegiScan MCP Server
This server gives terminal agents structured access to LegiScan legislative data via MCP tools, enabling bill research, legislator lookups, vote tracking, and session discovery across all 50 US states and Congress.
Find legislators by partial name and state, returning people_id for follow-up queries.
Get legislator vote positions across up to 100 bills in one call, with roll-call details and chamber filtering.
List primary-authored bills while filtering out co-sponsored legislation, optionally scoped by state or session.
Retrieve full bill details including sponsors, history, votes, texts, amendments, and supplements.
Look up bills by number with flexible format handling (e.g., AB 858, AB858, AB-858).
Fetch roll-call votes with individual legislator voting records.
Get legislator profiles with party, role, district, and third-party IDs (VoteSmart, OpenSecrets, Ballotpedia, FollowTheMoney).
List all legislators in a session with roles, parties, and districts.
Full-text search legislation across states or nationwide, with pagination and year/session filters.
List legislative sessions by state or for all states, providing session_id for scoped lookups.
Click on "Deploy 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., "@LegiScan MCP Server find recent climate change bills 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.
LegiScan MCP Server
A Model Context Protocol (MCP) server that gives terminal agents structured access to the LegiScan API for legislative data from all 50 US states and Congress.
Built for research workflows where you direct an agent (Codex, Claude Code, Claude Desktop, etc.) to gather bill history, sponsor context, and voting records quickly.
Features
10 Streamlined MCP Tools optimized for legislative research workflows
Composite tools that collapse multi-step research workflows into single MCP tool calls
Per-request batching and lookup caching for repeated bill and roll-call lookups
Full TypeScript type definitions for all API responses
Bill number normalization (handles AB 858, AB858, AB-858 formats)
Input validation guardrails for state codes, legislator name queries, and large bill batches
Related MCP server: civic-awareness-mcp
Installation
From npm (Recommended)
npm install -g legiscan-mcp-serverFrom Source
git clone https://github.com/sh-patterson/legiscan-mcp.git
cd legiscan-mcp
npm install
npm run buildSetup
1. Get a LegiScan API Key
Create a free account at LegiScan
Register for API access at https://legiscan.com/legiscan
Copy your API key
2. Add to Your MCP-Capable Agent
Add this server to whatever MCP host your terminal agent uses.
Claude Desktop config paths:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
For other MCP clients (Codex CLI, Claude Code, etc.), add the same mcpServers.legiscan entry in that client's MCP config file.
Using npx (Recommended)
{
"mcpServers": {
"legiscan": {
"command": "npx",
"args": ["-y", "legiscan-mcp-server"],
"env": {
"LEGISCAN_API_KEY": "your_api_key_here"
}
}
}
}Using local installation
{
"mcpServers": {
"legiscan": {
"command": "node",
"args": ["/path/to/legiscan-mcp-server/dist/index.js"],
"env": {
"LEGISCAN_API_KEY": "your_api_key_here"
}
}
}
}Available Tools
Composite Tools (High-Level Research)
Tool | Description |
| Find a legislator's people_id by name. Supports partial matching. |
| Get how a legislator voted on multiple bills in one call. |
| Get only bills where legislator is primary author (not co-sponsor). |
Bills
Tool | Description |
| Get detailed bill info (sponsors, history, votes, texts) |
| Find bill by number (handles AB 858, AB858, AB-858, A.B. 858). Best for exact bill lookup. |
| Get vote details with individual legislator votes |
People
Tool | Description |
| Get legislator info with third-party IDs (VoteSmart, OpenSecrets, etc.) |
| Get all legislators active in a session |
Search
Tool | Description |
| Full-text search across legislation. Accepts bill-number variants like AB858, but use |
Sessions
Tool | Description |
| List available legislative sessions by state |
Researcher Workflow (Terminal Agent)
1. Start with a scoped request
Give your agent a goal, state, timeframe, and output format.
Example prompt:
Use the LegiScan MCP tools to find major California housing bills in the current session.
Return: bill number, title, latest action date, top sponsors, and whether there was a close roll-call vote (margin <= 5).2. Ask the agent to follow a tool sequence
For high-quality results, tell the agent to do this order:
legiscan_get_session_listto identify the correct session.legiscan_searchorlegiscan_find_bill_by_numberto locate target bills.legiscan_get_billfor sponsor/history/vote references.legiscan_get_roll_callfor individual vote details.legiscan_get_persononly when legislator enrichment is needed.
If you start with legiscan_find_legislator, keep passing the returned session.session_id or the same state into follow-up authoring workflows so results stay in the intended legislature and timeframe.
3. Reuse composite tools for analyst workflows
These cut tool-call volume and simplify instructions to your agent:
legiscan_find_legislator: getpeople_idfrom a name query.legiscan_get_primary_authored: separate primary-authored from co-sponsored bills.legiscan_get_legislator_votes: pull vote positions across many bills in one request.
Both composite tools cap API lookups per call. In legiscan_get_legislator_votes, check each bill's roll_call_coverage: selected is the number of roll-call references inspected on that page, and next_offset means older roll calls remain. Call again with that bill ID and roll_call_offset: next_offset before treating an empty vote list as complete. In legiscan_get_primary_authored, pass offset: next_offset with the same people_id and session or state until next_offset is absent. Results can change between pages if LegiScan updates its lists.
Prompt Templates
A) Opposition research on one legislator
Use LegiScan MCP for Texas.
1) Find legislator "Jane Smith".
2) List all primary-authored bills in the current session.
3) For these bills, summarize topic area and latest status.
4) Then check votes on SB 12, HB 301, and SB 455, and show how the legislator voted.B) Bill tracking brief for an issue area
Use LegiScan MCP to track "climate resilience" bills in New York.
Focus on current session only.
Return top 15 bills by relevance with bill number, title, last action, sponsor party, and any recorded roll calls.C) Scorecard support workflow
For California session 2172, resolve bill numbers AB 858, SB 525, SB 616, SB 399.
For each bill, fetch details and any roll calls.
Then report vote positions for people_id values 21719, 23214, and 25359.
Output as a table suitable for CSV export.Workflow Simplification
The composite tools dramatically reduce agent-to-tool round trips for common workflows:
Workflow | Manual MCP Steps | With Composites |
Get votes for 1 legislator on 10 bills | Find legislator → search/resolve bills → inspect each bill → inspect each roll call | 1 tool call once you have |
Filter primary authored from 150 sponsored bills | Sponsored list → fetch each bill → inspect sponsors | 1 tool call with |
Find legislator by name | Session discovery → session people lookup → manual matching | 1 tool call |
Research Tips
State codes are validated as two-letter strings and uppercased automatically (
ca→CA). Invalid codes likeZZpass local validation but return an API error from LegiScan.Always pin state and session in your prompt to reduce ambiguous results.
Ask the agent to show
bill_id,roll_call_id, andpeople_idin intermediate output so you can audit traceability.For legislator search, provide at least a first and last name (name input must be at least 2 characters).
legiscan_get_primary_authoredcan return all available sessions, but passingstateorsession_idkeeps results aligned to the intended legislature and timeframe.legiscan_get_legislator_votesaccepts up to 100bill_idsper request; split larger jobs into chunks.legiscan_searchretries compact bill-number queries likeAB858using a canonical spaced format. For exact bill resolution, preferlegiscan_find_bill_by_number.Ask for final outputs in a table/CSV-ready shape if you plan downstream analysis.
Development
npm run build # Compile TypeScript
npm run typecheck # Type-check src + tests
npm test # Run deterministic unit tests (no API key)
npm run test:e2e # Run offline MCP/HTTP workflows; also run live scenarios with an API key
npm run test:live # Run live API integration tests (requires API key)
npm run test:coverage # Run unit tests with coverage
npm run lint # Check for lint errors
npm run format # Format code with PrettierTesting Modes
npm test/npm run test:unit: Fast deterministic tests with mocked network calls.npm run test:e2e: Runs provider-free MCP-to-HTTP workflow tests. Its real LegiScan scenarios run only whenLEGISCAN_API_KEYis available.npm run test:live: Real LegiScan API integration tests. RequiresLEGISCAN_API_KEY.
API Limits
Free public API keys have a 30,000 queries per month limit
Composite tools batch requests (10 concurrent max) and cache repeated lookups inside a single request to avoid unnecessary duplication
Composite tools reduce MCP workflow friction, but LegiScan API usage still scales with the number of distinct bills and roll calls you inspect
Docker
Build the container image locally:
docker build -t legiscan-mcp .Run it with your API key provided at runtime:
docker run --rm -i \
-e LEGISCAN_API_KEY=your-api-key-here \
legiscan-mcpReleases
Glama checks expect a GitHub release. After merging your next repo changes, create and publish a tag such as v1.0.0 from GitHub or with:
git tag v1.0.0
git push origin v1.0.0License
MIT - see LICENSE for details.
Available Tools
10 toolslegiscan_find_bill_by_numberA
Find a bill by its number within a state's current session or specific session. Handles format variations (AB 858, AB858, AB-858). Returns bill summary if found, null if not.
Inputs: bill_number (required), state, session_id.
legiscan_find_legislatorA
Find a legislator's people_id by searching their name. Useful as a first step before other queries. Supports partial name matching.
Inputs: name (required), state (required), session_id.
legiscan_get_billA
Get detailed bill information including sponsors, full history, votes, texts, amendments, and supplements. This is the primary tool for bill research.
Inputs: bill_id (required).
legiscan_get_legislator_votesA
Get how a legislator voted on specific bills. Use find_legislator first to get people_id from a name. Returns vote positions (Yea/Nay/NV/Absent) for each bill with roll call details.
Inputs: bill_ids (required), people_id (required), chamber.
legiscan_get_personA
Get legislator information including party, role, district, and third-party IDs (VoteSmart, OpenSecrets, Ballotpedia, FollowTheMoney).
Inputs: people_id (required).
legiscan_get_primary_authoredA
Get only bills where a legislator is the PRIMARY author, not co-sponsor. Use find_legislator first to get people_id from a name. Filters out co-sponsored bills automatically.
Inputs: people_id (required), state, session_id.
legiscan_get_roll_callA
Get roll call vote details including individual legislator votes. Get roll_call_id by calling get_bill first.
Inputs: roll_call_id (required).
legiscan_get_session_listA
Get list of available legislative sessions. Returns sessions with session_id, years, and state info. Use session_id for subsequent bill lookups.
Inputs: state.
legiscan_get_session_peopleA
Get all legislators active in a legislative session. Returns list of people with their roles, parties, and districts.
Inputs: session_id (required).
legiscan_searchA
Full-text search across bill texts. Returns 50 results per page with relevance scores, bill summaries, and URLs. Use for interactive searches.
Inputs: query (required), page, year, state, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct resource or action (bills, legislators, sessions, votes, search) with clear boundaries. Even related tools like get_legislator_votes and get_roll_call serve different purposes (individual legislator vs. specific roll call).
All tool names follow a consistent 'legiscan_verb_noun' pattern using lowercase with underscores. Verbs are limited to 'find', 'get', and 'search', making the set predictable.
10 tools is well-scoped for a legislative tracking server. Each tool addresses a core need without unnecessary duplication or omission.
The tool surface covers the primary lifecycle for legislative data: discovering sessions, searching bills, retrieving details, and accessing legislator info and votes. No obvious gaps for a read-only MCP server.
Maintenance
Related MCP Connectors
Federal and 50-state legislative data for AI: bills, text, votes, members, and committees.
Search bills and speaker-attributed hearing transcripts across all 50 US state legislatures.
Bills, hearings, votes and legislators for all 50 US states, DC and Congress, from official sources.
Search bills, legislators, committees, and events across all 50 US states, DC, and 5 US territories.
Related MCP Servers
- AlicenseAqualityCmaintenanceSearch bills and speaker-attributed hearing transcripts across all 50 US state legislatures.71MIT
- AlicenseAqualityDmaintenanceProvides tools to search and retrieve US federal and state legislative data, including bills, votes, campaign contributions, and legislator information, with provenance tracking.81MIT
- AlicenseNot gradedqualityBmaintenanceAccess U.S. state legislative data including bills, legislators, and votes across all 50 states via the OpenStates API.321 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables querying legislative data from the LegiScan API, including bills and votes, via natural language through an MCP gateway.137 npmMIT