USAspending MCP Server
Read-only MCP server for exploring US federal spending data via the USAspending.gov API, enabling natural language queries on awards, agencies, recipients, and spending trends.
README
USAspending MCP Server
Read-only Model Context Protocol server for exploring federal spending through the USAspending.gov API.
Use it from Claude Desktop, Codex, Cursor, VS Code, or any MCP-compatible AI tool to ask questions like:
- "Which agencies awarded the most climate-related obligations in FY2025?"
- "Find top recipients for semiconductor-related federal spending."
- "Show spending over time for affordable housing."
- "Get the details behind this USAspending award ID."
- "Search transactions for Department of Energy clean energy awards."
USAspending.gov does not require an API key for these endpoints. This server is intentionally read-only and uses local stdio transport.
Why This Exists
USAspending.gov is powerful, but the API has many endpoints and detailed filter shapes. This MCP server gives AI agents a safer, typed tool layer for common federal-spending workflows:
- agency and recipient lookup
- award and transaction search
- spending aggregation by category, geography, and time
- award profile lookup
- recipient new-award momentum
- safe generic calls for documented
/api/v2/endpoints
It is useful for public-sector market analysis, policy research, impact-investing screens, federal contractor diligence, grant monitoring, and thematic government-spending research.
Tools
| Tool | What it does |
|---|---|
usaspending_list_toptier_agencies |
List federal toptier agencies and summary budgetary fields. |
usaspending_autocomplete_recipient |
Find recipient names, UEIs, and DUNS values. |
usaspending_autocomplete_agency |
Find awarding or funding agency offices. |
usaspending_search_awards |
Search awards/subawards with Advanced Search filters and selected fields. |
usaspending_spending_by_category |
Aggregate spending by agency, recipient, NAICS, PSC, federal account, state, and more. |
usaspending_spending_by_geography |
Aggregate by state, county, district, or country. |
usaspending_spending_over_time |
Aggregate by fiscal year, calendar year, quarter, or month. |
usaspending_new_awards_over_time |
Count new awards for a recipient by fiscal year, quarter, or month. |
usaspending_search_transactions |
Search individual transaction records. |
usaspending_count_transactions |
Count matching transactions by award category. |
usaspending_get_award |
Fetch detailed award profile data. |
usaspending_call_endpoint |
Safely call documented read-only /api/v2/ endpoints not covered by a purpose-built tool. |
The generic endpoint tool blocks job/file-generating download paths, while allowing the read-only /api/v2/download/count/ preflight endpoint.
Requirements
- Node.js 20 or newer
- npm
No USAspending API key is required.
Install From Source
git clone https://github.com/haydentbs/usaspending-mcp-server.git
cd usaspending-mcp-server
npm install
npm run build
Run a live API smoke test:
npm run smoke
Run the MCP regression suite:
npm run test:mcp
Add It To An AI Tool
Build the project first, then point your MCP client at dist/index.js.
Claude Desktop
Add this to your Claude Desktop MCP config:
{
"mcpServers": {
"usaspending": {
"command": "node",
"args": ["/absolute/path/to/usaspending-mcp-server/dist/index.js"]
}
}
}
On macOS, Claude Desktop config is commonly located at:
~/Library/Application Support/Claude/claude_desktop_config.json
Restart Claude Desktop after editing the config.
Codex
Add this to ~/.codex/config.toml:
[mcp_servers.usaspending]
command = "node"
args = ["/absolute/path/to/usaspending-mcp-server/dist/index.js"]
Restart or reload your Codex session so the new MCP namespace is discovered.
Cursor, VS Code, And Other MCP Clients
Most MCP clients use the same server definition shape:
{
"mcpServers": {
"usaspending": {
"command": "node",
"args": ["/absolute/path/to/usaspending-mcp-server/dist/index.js"]
}
}
}
If your tool supports per-project MCP config, place the same server definition there. If it supports global config, add it globally.
Example Prompts
After connecting the MCP server, try:
List the top FY2025 awarding agencies for clean energy spending.
Compare FY2021-FY2025 federal spending over time for semiconductor-related awards.
Find the top recipients for wastewater-related spending in FY2025 and show their NAICS concentration.
Search FY2025 Department of Energy contract awards mentioning hydrogen and return award IDs, recipients, amounts, and descriptions.
Example Filters
USAspending Advanced Search filters are passed through as JSON. Most analysis should include an explicit time_period.
Defense contract awards in FY2025:
{
"filters": {
"time_period": [{ "start_date": "2024-10-01", "end_date": "2025-09-30" }],
"agencies": [{ "type": "awarding", "tier": "toptier", "name": "Department of Defense" }],
"award_type_codes": ["A", "B", "C", "D"]
},
"limit": 10,
"page": 1
}
Spending by NAICS for a keyword:
{
"category": "naics",
"filters": {
"keywords": ["semiconductor"],
"time_period": [{ "start_date": "2024-10-01", "end_date": "2025-09-30" }]
}
}
Recipient new-award trend:
{
"group": "fiscal_year",
"filters": {
"recipient_id": "5ad7895c-192b-21cd-8baf-92c6dce0b593-C",
"time_period": [{ "start_date": "2020-10-01", "end_date": "2025-09-30" }]
}
}
Notes And Limitations
- USAspending values are obligations/outlays from federal reporting, not company revenue.
- Keyword screens are directional. For production research, combine keywords with NAICS, PSC, agency, assistance listing, and award-type filters.
- Some USAspending endpoints enforce award-type group constraints. For example, award search should not mix contracts, grants, loans, direct payments, and IDVs in a single
award_type_codesfilter. - Large federal-spending queries can be slow. The server uses a request timeout, configurable with
USASPENDING_TIMEOUT_MS.
Development
npm install
npm run build
npm run test:mcp
Run the server locally:
npm start
Run against TypeScript source during development:
npm run dev
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。