Skip to main content

MCP server for USASpending.gov federal contract and award data

Project description

usaspending-gov-mcp

MCP server for the USASpending.gov federal contract and award data API.

No API key required. Works with any MCP-compatible client (Claude Desktop, Claude Code, Cursor, Cline, Continue, Zed, etc.).

Tested and hardened through four rounds of integration testing against the live USASpending.gov API. 62 regression tests covering 10 P1 silent-wrong-data bugs and 5 P2 validation gaps fixed. See TESTING.md for the full testing record.

What it does

Exposes the USASpending.gov REST API as 17 MCP tools covering:

Search and aggregation

  • search_awards - Primary search for contracts, IDVs, grants, loans, direct payments
  • get_award_count - Dimensional counts across award categories
  • spending_over_time - Time series aggregation (fiscal year, quarter, month)
  • spending_by_category - Top N breakdowns by agency, vendor, NAICS, PSC, state, etc.

Award detail

  • get_award_detail - Full record for a single award
  • get_transactions - Full modification history for an award
  • get_award_funding - File C funding data (Treasury account, object class, program activity)
  • get_idv_children - Task/delivery orders under an IDV

Workflow convenience

  • lookup_piid - Auto-detects contract vs IDV and returns the matching award

Autocomplete

  • autocomplete_psc - Product/Service Code lookup
  • autocomplete_naics - NAICS code lookup

Reference data

  • list_toptier_agencies - All federal agencies
  • get_agency_overview - Agency summary by toptier code and fiscal year
  • get_agency_awards - Agency award totals by category
  • get_naics_details - NAICS code details (2-6 digit)
  • get_psc_filter_tree - PSC hierarchy, drillable
  • get_state_profile - State-level spending profile by FIPS code

Installation

Via pip

pip install usaspending-gov-mcp

Via uvx (recommended, no venv needed)

uvx usaspending-gov-mcp

From source

git clone https://github.com/1102tools/federal-contracting-mcps.git
cd federal-contracting-mcps/servers/usaspending-gov-mcp
pip install -e .

Claude Desktop configuration

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "usaspending": {
      "command": "uvx",
      "args": ["usaspending-gov-mcp"]
    }
  }
}

If you installed via pip install -e . or a regular pip install:

{
  "mcpServers": {
    "usaspending": {
      "command": "python",
      "args": ["-m", "usaspending_gov_mcp.server"]
    }
  }
}

Restart Claude Desktop. The server should appear in the MCP tools panel.

Claude Code configuration

Add to ~/.claude.json or your project's .claude.json:

{
  "mcpServers": {
    "usaspending": {
      "command": "uvx",
      "args": ["usaspending-gov-mcp"]
    }
  }
}

Example prompts

Once configured, try:

  • "Show me the top 10 NAVSEA contracts awarded in FY2025 by dollar value."
  • "Find all software development contracts at NASA with sole-source justifications in the last year."
  • "How much has Leidos received in federal awards since 2020? Group by fiscal year."
  • "What are the top 15 recipients of HUBZone set-aside contracts at DoD?"
  • "Pull the full modification history for PIID N00024-24-C-0085."
  • "Compare FFP vs T&M award counts for IT services at Air Force in FY2024."

Design notes

  • No authentication required. USASpending.gov is a free, public API.
  • Award type groups cannot be mixed. The award_type parameter takes one of: contracts, idvs, grants, loans, direct_payments, other. Use separate calls for separate categories.
  • Actionable error messages. Common API errors (422 mixed award types, 400 sort field missing, 400 empty keywords) are translated into guidance for the calling LLM.
  • Sort field auto-handling. The USASpending API requires the sort field to appear in the fields array; this server adds it automatically.
  • Sensible defaults. Search limits default to 25 (API max 100). Default fields cover the most common columns for each award category.
  • Flat filter parameters. Most common filters are surfaced as named parameters (keywords, awarding_agency, naics_codes, etc.) rather than a nested filter dict, for better LLM tool discovery.

Data source

All data is sourced from USASpending.gov, which aggregates FPDS-NG contract data, FAADC assistance data, and agency DATA Act submissions. Data freshness varies by agency: non-DoD contract data is typically available within 5 business days, DoD and USACE procurement data has a 90-day reporting delay in FPDS, and financial assistance data is available within 2 days of submission.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

usaspending_gov_mcp-0.2.4.tar.gz (86.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

usaspending_gov_mcp-0.2.4-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file usaspending_gov_mcp-0.2.4.tar.gz.

File metadata

  • Download URL: usaspending_gov_mcp-0.2.4.tar.gz
  • Upload date:
  • Size: 86.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for usaspending_gov_mcp-0.2.4.tar.gz
Algorithm Hash digest
SHA256 f519260ebcaefa18bd2c29aedba8f2d0a44038e8e9321ca954b9f1c88cb670b4
MD5 35ff00d4ef478fe637a4a83a99fd470d
BLAKE2b-256 8b56b2f351c5e8c90578c16b7286bc56e718c145ee4365a6e5d5d38148505dbe

See more details on using hashes here.

Provenance

The following attestation bundles were made for usaspending_gov_mcp-0.2.4.tar.gz:

Publisher: publish-pypi.yml on 1102tools/federal-contracting-mcps

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file usaspending_gov_mcp-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for usaspending_gov_mcp-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2ebb02684470d1d8c8d04334ca25aa51e79b6b032bf349c05a33f09855f7355f
MD5 f51cd9664dda2da627589657cf61e885
BLAKE2b-256 0e4a6d933ad192d1efe6b154e796bedbabe794b9e32ff8367cb121617cf55ec2

See more details on using hashes here.

Provenance

The following attestation bundles were made for usaspending_gov_mcp-0.2.4-py3-none-any.whl:

Publisher: publish-pypi.yml on 1102tools/federal-contracting-mcps

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page