Skip to main content
Glama
Washington State Legislature MCP Server

Washington State Legislature MCP Server

by awalcutt

Washington State Legislature MCP Server

A Model Context Protocol (MCP) server that provides AI assistants with access to Washington State Legislature data, enabling civic engagement through conversational interfaces.

Overview

This MCP server connects AI assistants to the Washington State Legislative Web Services (WSLWS), providing tools for:

  • Bill tracking and information retrieval

  • Committee meeting schedules and agendas

  • Legislator lookup and sponsor information

  • Bill status and history tracking

  • Legislative document access

Related MCP server: OpenDiscourse MCP

Features

Core Tools

  • getBillInfo - Retrieve detailed information about specific bills

  • searchBills - Search for bills using keywords and optional filtering

  • getBillsByYear - Retrieve all bills from a specific year with filtering options

  • getCommitteeMeetings - Get committee meeting schedules and agendas

  • findLegislator - Find legislators by district or lookup sponsors

  • getBillStatus - Get current status and history of a bill

  • getBillDocuments - Retrieve bill document metadata with links

  • getBillContent - Retrieve the actual content of a bill in AI-friendly format

MCP Resources

  • bill://xml/{biennium}/{chamber}/{bill_number} - Access bill documents in structured XML format

  • bill://htm/{biennium}/{chamber}/{bill_number} - Access bill documents in HTML format

  • bill://pdf/{biennium}/{chamber}/{bill_number} - Get URLs for bill PDF documents

  • bill://document/{format}/{biennium}/{chamber}/{bill_number} - Generic format for accessing bill documents

Installation

Prerequisites

  • Python 3.10+

  • pip package manager

Development Installation

pip install -e ".[dev]"

Production Installation

pip install .

Quick Start

Local Development

# Test with MCP Inspector
mcp dev src/wa_leg_mcp/server.py

# Run with stdio transport
python src/wa_leg_mcp/server.py

Remote Deployment

For cloud deployment on AWS Lambda, you can use the mcp-remote adapter to enable Claude Desktop connectivity:

{
  "mcpServers": {
    "wa-leg": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://your-api-gateway-url/sse"
      ]
    }
  }
}

Basic Configuration

Create a .env file:

WSL_API_TIMEOUT=30
WSL_CACHE_TTL=300
LOG_LEVEL=INFO
SERVER_NAME="Washington State Legislature MCP Server"

Repository Structure

wa-leg-mcp/
├── src/
│   ├── wa_leg_mcp/
│   │   ├── __init__.py
│   │   ├── server.py           # Main MCP server implementation
│   │   ├── tools/              # Tool implementations
│   │   │   ├── __init__.py
│   │   │   ├── bill_tools.py
│   │   │   ├── committee_tools.py
│   │   │   └── legislator_tools.py
│   │   ├── resources/          # MCP resource implementations
│   │   │   ├── __init__.py
│   │   │   └── bill_resources.py # Bill document resources
│   │   ├── clients/            # API clients
│   │   │   ├── __init__.py
│   │   │   └── wsl_client.py   # WA State Legislature API client
│   │   └── utils/              # Utility functions
│   │       ├── __init__.py
│   │       └── formatters.py
├── tests/                      # Test suite
│   ├── __init__.py
│   ├── test_bill_tools.py
│   ├── test_bill_resources.py  # Tests for bill resources
│   ├── test_committee_tools.py
│   ├── test_legislator_tools.py
│   ├── test_server.py
│   ├── test_utils_formatters.py
│   └── test_wsl_client.py
├── pyproject.toml              # Project configuration and dependencies
├── Makefile                    # Development workflow commands
├── README.md
└── LICENSE

Development

Setting Up Development Environment

  1. Clone the repository:

git clone https://github.com/awalcutt/wa-leg-mcp.git
cd wa-leg-mcp
  1. Create virtual environment:

python -m venv venv
source venv/bin/activate  # Or `venv\Scripts\activate` on Windows
  1. Install development dependencies:

pip install -e ".[dev]"
  1. Run tests:

make test

Adding New Tools

  1. Create a new file in src/wa_leg_mcp/tools/

  2. Implement tool using the MCP decorator:

from mcp.server.fastmcp import Tool

@Tool("toolName", description="Tool description")
def tool_function(param1: str, param2: str = None):
    # Implementation
    return {"result": data}
  1. Register tool in server.py by adding it to the get_default_tools() function

  2. Add tests in tests/

Deployment Options

Local Deployment

  • Run directly with Python

  • Use with MCP Inspector for development

Cloud Deployment

  • AWS Lambda with API Gateway (supports remote connections via mcp-remote adapter)

  • Google Cloud Functions

  • Azure Functions

Environment Variables

Variable

Description

Default

WSL_API_TIMEOUT

API request timeout (seconds)

30

WSL_CACHE_TTL

Cache time-to-live (seconds)

300

LOG_LEVEL

Logging level

INFO

SERVER_NAME

Custom server name

Washington State Legislature MCP Server

Usage Examples

With Claude Desktop

Add to Claude Desktop configuration:

{
  "mcpServers": {
    "wa-leg": {
      "command": "python",
      "args": ["path/to/src/wa_leg_mcp/server.py"],
      "env": {
        "WSL_CACHE_TTL": "600"
      }
    }
  }
}

With Other AI Clients

# Example client integration
from mcp.client import ClientSession
import asyncio

async def connect_to_legislature_mcp():
    async with ClientSession(server_command=["python", "src/wa_leg_mcp/server.py"]) as session:
        # List available tools
        tools = await session.list_tools()
        
        # Call a tool
        result = await session.call_tool("getBillInfo", {
            "bill_number": "HB1234",
            "biennium": "2025-26"
        })
        
        print(result)
        
        # Access a resource
        bill_xml = await session.read_resource(
            "bill://xml/2025-26/House/1234"
        )
        
        print(f"Bill XML content length: {len(bill_xml)}")

asyncio.run(connect_to_legislature_mcp())

API Documentation

Tools

getBillInfo

Retrieves detailed information about a specific bill using the GetLegislation API.

Parameters:

  • bill_number (string, required): Bill number (e.g., "HB1234", "SB5678")

  • biennium (string, required): Legislative biennium in format "2025-26"

Returns: Bill details including description, sponsor, status, fiscal notes, and companions

searchBills

Searches for bills using keywords and optional filtering via the WSL Search API.

Parameters:

  • query (string, required): Search query text (e.g., "climate change", "transportation")

  • bienniums (array, optional): List of bienniums to search (format: "YYYY-YY"), defaults to current

  • agency (string, optional): Filter by originating agency ("House", "Senate", or "Both")

  • max_results (integer, optional): Maximum number of total results to return (max 100)

Returns: List of bills matching the search criteria

getBillsByYear

Retrieves all bills from a specific year with optional filtering using the GetLegislationByYear API.

Parameters:

  • year (string, optional): Year in format "YYYY" (e.g., "2025"), defaults to current

  • agency (string, optional): Filter by originating agency ("House" or "Senate")

  • active_only (boolean, optional): If True, only return active bills

Returns: List of bills matching the criteria

getCommitteeMeetings

Retrieves committee meetings and agendas using the GetCommitteeMeetings API.

Parameters:

  • start_date (string, required): Start date in YYYY-MM-DD format

  • end_date (string, required): End date in YYYY-MM-DD format

  • committee (string, optional): Filter by specific committee

Returns: List of committee meetings with dates, times, locations, and agenda items

findLegislator

Finds legislators using the GetSponsors API.

Parameters:

  • biennium (string, required): Legislative biennium in format "2025-26"

  • chamber (string, optional): "house" or "senate"

Returns: List of legislators with ID, name, party, and contact information

getBillStatus

Gets current status and history using the GetCurrentStatus API.

Parameters:

  • bill_number (string, required): Bill number (e.g., "HB1234")

  • biennium (string, required): Legislative biennium in format "2025-26"

Returns: Current status, history, action dates, and status descriptions

getBillDocuments

Retrieves bill documents metadata (functionality based on Document service endpoints).

Parameters:

  • bill_number (string, required): Bill number

  • biennium (string, required): Legislative biennium in format "2025-26"

  • document_type (string, optional): "bill", "amendment", "report"

Returns: Document metadata with links to HTML and PDF versions

getBillContent

Retrieves the actual content of a bill in an AI-friendly format.

Parameters:

  • bill_number (integer, required): Bill number as an integer (e.g., 1234 for HB1234)

  • biennium (string, optional): Legislative biennium in format "2025-26" (defaults to current)

  • chamber (string, optional): Chamber name - "House" or "Senate" (optional if bill_number is unique across chambers)

  • bill_format (string, optional): Document format - "xml" (default), "htm", or "pdf"

Returns: For XML and HTM formats: Dict containing the document content and metadata. For PDF format: Dict containing the URL to access the PDF and metadata.

Resources

Bill Document Resources

The MCP server provides direct access to bill documents through URI templates:

bill://xml/{biennium}/{chamber}/{bill_number}

Access bill documents in structured XML format (recommended for AI processing).

Parameters:

  • biennium (string): Legislative biennium in format "YYYY-YY" (e.g., "2025-26")

  • chamber (string): Chamber name - must be exactly "House" or "Senate"

  • bill_number (string): Bill number as numeric string (e.g., "1234")

Returns: XML content of the bill document

bill://htm/{biennium}/{chamber}/{bill_number}

Access bill documents in HTML format with hyperlinks to referenced laws.

Parameters:

  • biennium (string): Legislative biennium in format "YYYY-YY"

  • chamber (string): "House" or "Senate"

  • bill_number (string): Bill number

Returns: HTML content of the bill document

bill://pdf/{biennium}/{chamber}/{bill_number}

Get URLs for bill PDF documents (content not fetched).

Parameters:

  • biennium (string): Legislative biennium in format "YYYY-YY"

  • chamber (string): "House" or "Senate"

  • bill_number (string): Bill number

Returns: Dictionary with URL to access the PDF document

bill://document/{format}/{biennium}/{chamber}/{bill_number}

Generic format for accessing bill documents in any supported format.

Parameters:

  • format (string): Document format - "xml", "htm", or "pdf"

  • biennium (string): Legislative biennium in format "YYYY-YY"

  • chamber (string): "House" or "Senate"

  • bill_number (string): Bill number

Returns: Document content or URL based on format

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Available Tools

9 tools
find_legislatorA

Find legislators (sponsors) for a specific biennium, optionally filtered by chamber and/or district.

Args: biennium: Legislative biennium in format "2025-26" (optional, defaults to current) chamber: Filter by chamber ("house" or "senate") (optional) district: Filter by legislative district number (optional)

Returns: Dict containing list of legislators matching the criteria

Inputs: biennium, chamber, district. Returns: result

get_bill_contentA

Retrieve the content of a bill in an AI-friendly format.

This tool fetches the actual content of a bill document, defaulting to XML format which is most suitable for AI processing due to its structured nature. It can also return HTML content or a link to the PDF version.

Args: bill_number: Bill number as an integer (e.g., 1234 for HB1234, 5678 for SB5678) biennium: Legislative biennium in format "YYYY-YY" (e.g., "2025-26") (optional, defaults to current) chamber: Chamber name - "House" or "Senate" (optional if bill_number is unique across chambers) bill_format: Document format - "xml" (default), "htm", or "pdf"

Returns: For XML and HTM formats: Dict containing the document content and metadata For PDF format: Dict containing the URL to access the PDF and metadata

Note: This tool complements the get_bill_documents tool, which provides metadata about available documents. This tool provides the actual content of the bill.

When citing bill content in responses, consider including a link to the PDF version
using the format: https://lawfilesext.leg.wa.gov/biennium/{biennium}/Pdf/Bills/{chamber}%20Bills/{bill_number}.pdf

Inputs: bill_number (required), biennium, chamber, bill_format. Returns: result

get_bill_documentsA

Retrieve bill documents including bill text and amendments.

Args: bill_number: Bill number as an integer (e.g., 1234 for HB1234, 5678 for SB5678) biennium: Legislative biennium in format "YYYY-YY" (e.g., "2025-26") (optional, defaults to current) document_type: Filter by type - "bill", "amendment", "report" (optional)

Returns: Dict containing document metadata with links to HTML and PDF versions

Note: This tool returns metadata about available documents. To get the actual content of a bill in AI-friendly format, use the get_bill_content tool.

Inputs: bill_number (required), biennium, document_type. Returns: result

get_bill_infoA

Retrieve detailed information about a specific bill.

Args: bill_number: Bill number as an integer (e.g., 1234 for HB1234, 5678 for SB5678) biennium: Legislative biennium in format "YYYY-YY" (e.g., "2025-26") (optional, defaults to current)

Returns: Dict containing bill details including description, sponsor, status, etc.

Inputs: bill_number (required), biennium. Returns: result

get_bills_by_yearA

Retrieve all bills from a specific year with optional filtering.

This function retrieves all legislation for a year and allows filtering by agency (House or Senate) and active status.

Args: year: Year in format "YYYY" (e.g., "2025") (optional, defaults to current) agency: Filter by originating agency ("House" or "Senate") (optional) active_only: If True, only return active bills

Returns: Dict containing list of bills matching the criteria

Inputs: year, agency, active_only. Returns: result

get_bill_statusA

Get the current status and history of a specific bill.

Args: bill_number: Bill number as an integer (e.g., 1234 for HB1234, 5678 for SB5678) biennium: Legislative biennium in format "YYYY-YY" (e.g., "2025-26") (optional, defaults to current)

Returns: Dict containing current status and history

Inputs: bill_number (required), biennium. Returns: result

get_committee_meetingsA

Retrieve committee meetings and agendas.

Args: start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format committee: Filter by specific committee (optional)

Returns: Dict containing list of committee meetings

Inputs: start_date (required), end_date (required), committee. Returns: result

pingA

Simple health check to verify the server is running.

Inputs: no named parameters. Returns: result

search_billsA

Search for bills using keywords and optional filtering.

This function uses the WSL Search API to find bills matching the provided query with optional filtering by biennium and agency.

Args: query: Search query text (e.g., "climate change", "transportation") bienniums: List of bienniums to search (format: "YYYY-YY") (optional, defaults to current) agency: Filter by originating agency ("House", "Senate", or "Both") (optional, defaults to "Both") max_results: Maximum number of total results to return (max 100)

Returns: Dict containing list of bills matching the search criteria

Inputs: query (required), bienniums, agency, max_results. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

    TDQS

    A4/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool targets a distinct aspect of legislative data: legislators, bill content, bill metadata, bill details, bill status, committee meetings, search, and health check. Descriptions clearly differentiate purposes with no overlap.

    Naming Consistency4/5

    Tools consistently use snake_case with verb_noun pattern (e.g., get_bill_content, search_bills), except for 'ping' which is a standard health check but deviates. Overall pattern is clear.

    Tool Count5/5

    9 tools are well-scoped for a legislative information server, covering search, retrieval of details, documents, status, legislators, and committee meetings without being bloated or sparse.

    Completeness4/5

    The set covers core legislative needs such as bills, legislators, committees, and search. Missing advanced features like committee member lists or law code retrieval, but sufficient for typical use.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides offline access to Washington State's Revised Code of Washington (RCW) and Washington Administrative Code (WAC) for AI agents. Enables fast retrieval, full-text search, and navigation of all Washington state laws through natural language queries.
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables access to comprehensive U.S. legislative and governmental data from GovInfo.gov and Congress.gov APIs, including bills, Congressional records, Federal Register documents, member information, and committee activities.
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Provides 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.
      10
      10 npm
      12
      MIT