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.
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:
- Node.js and npm installed
- Access to Congress.gov API key (signed up via https://api.data.gov/signup/)
Steps:
- Install dependencies
npm install
- 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
- Build the server (TypeScript to JavaScript):
npm run build
- 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
fastapi_mcp
Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth!
MCP-Bridge
A middleware to provide an openAI compatible endpoint that can call MCP tools
easy
Absurdly easy Model Context Protocol Servers in Typescript
server-google-news
【Star-crossed coders unite!⭐️】Model Context Protocol (MCP) server implementation providing Google News search capabilities via SerpAPI, with automatic news categorization and multi-language support.
awesome-remote s
A curated list of Hosted & Managed Model Context Protocol (MCP) Servers accessible via a simple URL endpoint.
ContextPods
Model Context Protocol management suite/factory. An MCP that can generate and manage other local MCPs in multiple languages. Uses the official SDKs for code gen.