LegiScan MCP Server
LegiScan MCP 서버
터미널 에이전트가 미국 50개 주 및 의회의 입법 데이터를 위해 LegiScan API에 구조화된 방식으로 액세스할 수 있도록 하는 MCP(Model Context Protocol) 서버입니다.
에이전트(Codex, Claude Code, Claude Desktop 등)에게 법안 이력, 발의자 맥락, 투표 기록을 신속하게 수집하도록 지시하는 연구 워크플로우를 위해 구축되었습니다.
기능
입법 연구 워크플로우에 최적화된 10개의 간소화된 MCP 도구
다단계 연구 워크플로우를 단일 MCP 도구 호출로 압축하는 복합 도구
반복적인 법안 및 호명 투표 조회를 위한 요청별 배치 처리 및 조회 캐싱
모든 API 응답에 대한 완전한 TypeScript 타입 정의
법안 번호 정규화 (AB 858, AB858, AB-858 형식 처리)
주 코드, 의원 이름 쿼리 및 대규모 법안 배치를 위한 입력 검증 가드레일
Related MCP server: civic-awareness-mcp
설치
npm 사용 (권장)
npm install -g legiscan-mcp-server소스에서 설치
git clone https://github.com/sh-patterson/legiscan-mcp.git
cd legiscan-mcp
npm install
npm run build설정
1. LegiScan API 키 받기
LegiScan에서 무료 계정을 만듭니다.
https://legiscan.com/legiscan 에서 API 액세스를 등록합니다.
API 키를 복사합니다.
2. MCP 지원 에이전트에 추가
터미널 에이전트가 사용하는 모든 MCP 호스트에 이 서버를 추가하십시오.
Claude Desktop 설정 경로:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
다른 MCP 클라이언트(Codex CLI, Claude Code 등)의 경우, 해당 클라이언트의 MCP 설정 파일에 동일한 mcpServers.legiscan 항목을 추가하십시오.
npx 사용 (권장)
{
"mcpServers": {
"legiscan": {
"command": "npx",
"args": ["-y", "legiscan-mcp-server"],
"env": {
"LEGISCAN_API_KEY": "your_api_key_here"
}
}
}
}로컬 설치 사용
{
"mcpServers": {
"legiscan": {
"command": "node",
"args": ["/path/to/legiscan-mcp-server/dist/index.js"],
"env": {
"LEGISCAN_API_KEY": "your_api_key_here"
}
}
}
}사용 가능한 도구
복합 도구 (고수준 연구)
도구 | 설명 |
| 이름으로 의원의 people_id를 찾습니다. 부분 일치를 지원합니다. |
| 한 번의 호출로 여러 법안에 대한 의원의 투표 결과를 가져옵니다. |
| 의원이 공동 발의자가 아닌 주 발의자인 법안만 가져옵니다. |
법안
도구 | 설명 |
| 상세 법안 정보(발의자, 이력, 투표, 텍스트)를 가져옵니다. |
| 번호로 법안을 찾습니다(AB 858, AB858, AB-858, A.B. 858 처리). 정확한 법안 조회에 가장 좋습니다. |
| 개별 의원 투표가 포함된 투표 상세 정보를 가져옵니다. |
인물
도구 | 설명 |
| 타사 ID(VoteSmart, OpenSecrets 등)가 포함된 의원 정보를 가져옵니다. |
| 회기 중 활동 중인 모든 의원을 가져옵니다. |
검색
도구 | 설명 |
| 입법 전반에 걸친 전문 검색입니다. AB858과 같은 법안 번호 변형을 허용하지만, 정확한 일치를 위해서는 |
회기
도구 | 설명 |
| 주별로 사용 가능한 입법 회기 목록을 나열합니다. |
연구 워크플로우 (터미널 에이전트)
1. 범위가 지정된 요청으로 시작
에이전트에게 목표, 주, 기간 및 출력 형식을 제공하십시오.
예시 프롬프트:
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. 에이전트에게 도구 시퀀스를 따르도록 요청
고품질 결과를 얻으려면 에이전트에게 다음 순서로 수행하도록 지시하십시오:
legiscan_get_session_list를 사용하여 올바른 회기를 식별합니다.legiscan_search또는legiscan_find_bill_by_number를 사용하여 대상 법안을 찾습니다.legiscan_get_bill을 사용하여 발의자/이력/투표 참조를 확인합니다.legiscan_get_roll_call을 사용하여 개별 투표 상세 정보를 확인합니다.의원 보강이 필요할 때만
legiscan_get_person을 사용합니다.
legiscan_find_legislator로 시작하는 경우, 반환된 session.session_id 또는 동일한 state를 후속 발의 워크플로우에 계속 전달하여 결과가 의도한 입법부 및 기간 내에 유지되도록 하십시오.
3. 분석가 워크플로우를 위해 복합 도구 재사용
이 도구들은 도구 호출 횟수를 줄이고 에이전트에 대한 지침을 단순화합니다:
legiscan_find_legislator: 이름 쿼리에서people_id를 가져옵니다.legiscan_get_primary_authored: 주 발의 법안과 공동 발의 법안을 분리합니다.legiscan_get_legislator_votes: 한 번의 요청으로 여러 법안에 걸친 투표 입장을 가져옵니다.
프롬프트 템플릿
A) 한 의원에 대한 반대 연구
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) 이슈 영역에 대한 법안 추적 브리핑
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) 스코어카드 지원 워크플로우
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.워크플로우 단순화
복합 도구는 일반적인 워크플로우에 대해 에이전트와 도구 간의 왕복 횟수를 획기적으로 줄여줍니다:
워크플로우 | 수동 MCP 단계 | 복합 도구 사용 시 |
10개 법안에 대한 1명 의원의 투표 가져오기 | 의원 찾기 → 법안 검색/해결 → 각 법안 검사 → 각 호명 투표 검사 |
|
150개 발의 법안에서 주 발의 법안 필터링 | 발의 목록 → 각 법안 가져오기 → 발의자 검사 | 도구 호출 1회 (선택적으로 |
이름으로 의원 찾기 | 회기 발견 → 회기 인물 조회 → 수동 매칭 | 도구 호출 1회 |
연구 팁
주 코드는 2글자 문자열로 검증되며 자동으로 대문자로 변환됩니다(
ca→CA).ZZ와 같은 잘못된 코드는 로컬 검증은 통과하지만 LegiScan에서 API 오류를 반환합니다.모호한 결과를 줄이기 위해 프롬프트에 항상 주와 회기를 고정하십시오.
추적 가능성을 감사할 수 있도록 에이전트에게 중간 출력에
bill_id,roll_call_id및people_id를 표시하도록 요청하십시오.의원 검색의 경우 최소한 이름과 성을 제공하십시오(이름 입력은 최소 2자 이상이어야 함).
legiscan_get_primary_authored는 사용 가능한 모든 회기를 반환할 수 있지만,state또는session_id를 전달하면 결과가 의도한 입법부 및 기간에 맞춰 유지됩니다.legiscan_get_legislator_votes는 요청당 최대 100개의bill_ids를 허용합니다. 더 큰 작업은 청크로 나누십시오.legiscan_search는AB858과 같은 간결한 법안 번호 쿼리를 표준 공백 형식으로 재시도합니다. 정확한 법안 해결을 위해서는legiscan_find_bill_by_number를 선호하십시오.다운스트림 분석을 계획 중이라면 최종 출력을 표/CSV 준비 형식으로 요청하십시오.
개발
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 real-world workflow tests (skips cleanly without 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 Prettier테스트 모드
npm test/npm run test:unit: 모의 네트워크 호출을 사용한 빠른 결정론적 테스트.npm run test:e2e: 실제 입법 분석 작업을 기반으로 한 연구 워크플로우 테스트.LEGISCAN_API_KEY를 사용할 수 없는 경우 건너뜁니다.npm run test:live: 실제 LegiScan API 통합 테스트.LEGISCAN_API_KEY가 필요합니다.
API 제한
무료 공개 API 키는 월 30,000회 쿼리 제한이 있습니다.
복합 도구는 요청을 배치 처리(최대 10개 동시)하고 단일 요청 내에서 반복된 조회를 캐시하여 불필요한 중복을 방지합니다.
복합 도구는 MCP 워크플로우 마찰을 줄여주지만, LegiScan API 사용량은 여전히 검사하는 개별 법안 및 호명 투표 수에 비례하여 확장됩니다.
Docker
로컬에서 컨테이너 이미지 빌드:
docker build -t legiscan-mcp .런타임에 API 키를 제공하여 실행:
docker run --rm -i \
-e LEGISCAN_API_KEY=your-api-key-here \
legiscan-mcp릴리스
Glama 검사는 GitHub 릴리스를 기대합니다. 다음 저장소 변경 사항을 병합한 후 GitHub에서 또는 다음 명령으로 v1.0.0과 같은 태그를 생성하고 게시하십시오:
git tag v1.0.0
git push origin v1.0.0Docker
로컬에서 컨테이너 이미지 빌드:
docker build -t legiscan-mcp .런타임에 API 키를 제공하여 실행:
docker run --rm -i \
-e LEGISCAN_API_KEY=your-api-key-here \
legiscan-mcp릴리스
Glama 검사는 GitHub 릴리스를 기대합니다. 변경 사항을 푸시한 후 v1.0.0과 같은 태그를 생성하고 게시하십시오.
라이선스
MIT - 자세한 내용은 LICENSE를 참조하십시오.
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.
Unofficial LegiScan MCP — wraps the LegiScan API (api.legiscan.com)
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.
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.129 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables querying legislative data from the LegiScan API, including bills and votes, via natural language through an MCP gateway.260 npmMIT