Get the FREE Ultimate OpenClaw Setup Guide →

mcp-congress_gov_server

This is a Model Context Protocol (MCP) server designed to provide access to the official Congress.gov API (v3) using a hybrid approach.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio bsmi021-mcp-congress_gov_server node dist/server.js \
  --env CONGRESS_GOV_API_KEY="YOUR_API_KEY_HERE"

How to use

The Congress.gov MCP Server exposes core Congress.gov data through MCP resources and a pair of MCP tools designed for discovery and data retrieval. You can directly query standard resources like bills, members, Congress numbers, committees, and general info using the access_mcp_resource workflow. When you need more complex data, use the two MCP tools congress_search to locate items by keywords or filters, and congress_getSubResource to fetch related data for a given entity (for example actions for a bill or sponsored legislation for a member). This two-step approach—search to identify an entity, then fetch related data with a sub-resource—is essential for reliably assembling complete information from the Congress.gov API.

To use resources, connect your MCP client to the running server and issue access_mcp_resource calls with URIs such as congress-gov://bill/117/hr/3076, congress-gov://member/P000197, congress-gov://congress/118, or congress-gov://info/overview. For example, to retrieve a bill’s core data, request the congress-gov://bill/117/hr/3076 resource. For deeper insights, employ congress_search to locate an entity (e.g., a member or bill) and then supply its identifier to congress_getSubResource with an appropriate subResource (such as actions for a bill or sponsored-legislation for a member). The tool workflow emphasizes obtaining a precise identifier first and then requesting related data using a properly scoped sub-resource.

How to install

Prerequisites:

Steps:

  1. Install dependencies
npm install
  1. Create configuration file or ensure environment variable is available. Add your Congress.gov API key in a .env file at project root (not committed):
CONGRESS_GOV_API_KEY=YOUR_API_KEY_HERE
  1. Build the server (TypeScript to JavaScript):
npm run build
  1. Run the server locally:
npm start

Optional development mode

If you want hot-reloading during development, you can use:

npm run dev

This uses ts-node and nodemon to restart on changes.

Notes:

  • Ensure the CONGRESS_GOV_API_KEY is set in your environment when running the server.
  • The server binds to the configured host/port (check environment or defaults in config) and should be reachable by MCP clients once running.

Additional notes

Tips and common considerations:

  • You must provide a valid Congress.gov API key to access data; without it, requests will fail.
  • The MCP tool workflow requires a two-step process: use congress_search to locate an entity and obtain its identifier, then use congress_getSubResource with the correct parentUri and a valid subResource for detailed data.
  • When performing searches, be aware that filtering by congress in a general congress_search call may not be supported by the underlying API for all collections; use specific endpoints or precise queries as described in the tool documentation.
  • Ensure the correct parentUri is constructed (e.g., congress-gov://member/K000393 or congress-gov://bill/117/hr/3076) when calling congress_getSubResource.
  • Debugging tip: check server logs for API key errors, invalid URIs, or invalid subResource combinations; the tool will fail fast with clear error messages.
  • If you modify code, run npm run build to reflect changes in dist/server.js before restarting the server.

Related MCP Servers

Sponsor this space

Reach thousands of developers