想知道美国国会正在做什么吗?厌倦了通过阅读新闻来了解吗?自己询问美国国会API吧。
非官方的Congress.gov API MCP服务器
要通过Smithery自动安装congress_gov_mcp到Claude Desktop:
npx -y @smithery/cli install @AshwinSundar/congress_gov_mcp --client claude
安装uv。在macOS和Linux上最简单的方法是:
curl -LsSf https://astral.sh/uv/install.sh | sh
获取一个Congress.gov API密钥。
安装Claude Desktop,Claude Code或其他支持MCP集成的客户端。
完成先决条件
克隆此仓库,并进入目录:
git clone http://github.com/AshwinSundar/congress_gov_mcp
cd congress_gov_mcp
安装依赖项:
uv sync
从模板创建一个.env文件:
cp .env.template .env
将您的Congress.gov API密钥添加到.env文件中:
<u>congress_gov_mcp/.env</u>
CONGRESS_GOV_API_KEY="your-api-key-here"
完成先决条件
复制您的uv安装的绝对路径:
which uv
在Claude Desktop配置文件中的mcpServers块内添加以下内容:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"congress_gov_mcp": {
"command": "/absolute_path/to/uv",
"args": [
"run",
"/absolute_path_to/congress_gov_mcp/server.py"
]
}
}
}
完成先决条件
在您运行Claude Code的目录中的.mcp.json文件内的mcpServers块中添加以下内容:
{
"mcpServers": {
"congress_gov_mcp": {
"command": "uv",
"args": [
"run",
"/absolute_path_to/congress_gov_mcp/server.py"
]
}
}
}