MCP.so
登录
服务器

Congress.gov API MCP Server

@bsmi021

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

概览

What is Congress.gov API MCP Server?

Congress.gov API MCP Server is a Model Context Protocol (MCP) server that provides access to the official Congress.gov API (v3). It uses MCP Resources for direct lookups of core legislative entities (Bills, Members, Congresses, Committees, general Info) via standardized URIs, and MCP Tools for complex searches and retrieving related data lists. It is designed for MCP clients like AI assistants or development tools needing U.S. legislative data.

How to use Congress.gov API MCP Server?

Install dependencies with npm install, add your Congress.gov API key to a .env file as CONGRESS_GOV_API_KEY, build with npm run build, and run with npm start. Connect an MCP client via stdio to the running server. Access resources using access_mcp_resource with URIs like congress-gov://bill/117/hr/3076. Use tools congress_search and congress_getSubResource in a required two-step process: first find an entity ID via search, then fetch related data using that ID.

Key features of Congress.gov API MCP Server

  • Direct lookups of bills, members, congresses, committees via MCP Resources
  • Full-text search across legislative collections (bills, members, etc.)
  • Retrieval of related data (actions, sponsors, text) using entity IDs
  • Uses standard MCP protocol, compatible with any MCP client
  • Built with TypeScript for type safety and reliability
  • Implements rate limiting and error handling for the Congress.gov API

Use cases of Congress.gov API MCP Server

  • AI assistants answering questions about current or past legislation
  • Research tools pulling detailed bill actions or member sponsorship lists
  • Automated monitoring of new bills or committee updates
  • Integration with knowledge bases to enrich legislative content
  • Educational applications teaching the U.S. legislative process

FAQ from Congress.gov API MCP Server

What do I need to run this server?

You need a Congress.gov API key (obtained from https://api.data.gov/signup/), Node.js, and npm. The key is stored in a .env file.

How does the two-step search workflow work?

First, use congress_search to find an entity (e.g., a member) and get its ID. Second, use congress_getSubResource with that ID to retrieve related data like sponsored legislation. This is mandatory because related data requires a valid parent URI.

Can I filter search results by congress?

No. The Congress.gov API does not support filtering general searches (e.g., for bills or members) by congress using the filters parameter. Congress-specific filtering requires API paths that congress_search does not construct.

What happens if I use an invalid subResource?

The server will return an error. You must use a subResource string that is strictly valid for the parentUri type (e.g., 'sponsored-legislation' for members, 'actions' for bills).

Are there any limits on API calls?

The server includes a rate limit service (likely respecting the Congress.gov API’s own limits). The README does not specify a hard limit, but the server is designed to handle rate limiting gracefully.

标签

来自「开发工具」的更多内容