Skip to main content

usaspending-gov-mcp

MCP server for the USASpending.gov federal contract, award, subaward, recipient, agency, and federal account API.

No API key required. Standalone MCP use is an advanced, self-supported path; packaged agents are the maintained beginner path.

Tested and hardened through ten rounds of integration testing against the live USASpending.gov API. 2,151 regression tests (1,783 offline, 368 live-gated); round 10 fixed 25 verified findings across both tool families, including filters that could never match and a tool that had never once succeeded. See testing.md for the full testing record.

What it does

Exposes the USASpending.gov REST API as 55 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.
  • spending_by_transaction - Modification-level transaction search
  • spending_by_geography - State, county, or congressional district breakdown
  • new_awards_over_time - Pipeline trend for a recipient

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_award_funding_rollup - Single-line funding summary
  • get_award_subaward_count, get_award_federal_account_count, get_award_transaction_count
  • get_idv_children - Task/delivery orders under an IDV
  • awards_last_updated - Data freshness check

Subawards (FFATA)

  • search_subawards - Subawards under a single prime
  • spending_by_subaward_grouped - Subaward search with full filter set

Recipients

  • search_recipients - Search recipients by keyword
  • get_recipient_profile - Full recipient record
  • get_recipient_children - Subsidiaries of a parent recipient
  • autocomplete_recipient - Find recipient hashes by partial name
  • list_states - All states with FIPS codes

Agency depth

  • list_toptier_agencies, get_agency_overview, get_agency_awards
  • get_agency_budgetary_resources - Budget resources by FY
  • get_agency_sub_agencies - Subordinate orgs with obligations
  • get_agency_federal_accounts - Funding sources (TAS)
  • get_agency_object_classes - Spending categories (OMB)
  • get_agency_program_activities - Program-level breakdown
  • get_agency_obligations_by_award_category - Contract vs grant mix

IDV depth

  • get_idv_amounts - Top-line IDV rollup
  • get_idv_funding, get_idv_funding_rollup - File C for IDV
  • get_idv_activity - Child orders under an IDV

Federal accounts (Treasury)

  • list_federal_accounts - Search TAS
  • get_federal_account_detail, get_federal_account_object_classes, get_federal_account_program_activities, get_federal_account_fy_snapshot

Autocomplete

  • autocomplete_psc, autocomplete_naics
  • autocomplete_awarding_agency, autocomplete_funding_agency
  • autocomplete_cfda (grants), autocomplete_glossary, autocomplete_recipient

Reference data

  • get_naics_details, get_psc_filter_tree
  • get_award_types_reference - All award type codes (A=BPA Call etc.)
  • get_def_codes_reference - Disaster Emergency Fund codes (COVID, IIJA, IRA)
  • get_glossary - Acquisition/spending vocabulary
  • get_submission_periods - Agency reporting period coverage
  • get_state_profile - State-level spending profile

Workflow convenience

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

Installation

Via pip

pip install usaspending-gov-mcp

Via uvx (recommended, no venv needed)

uvx --from usaspending-gov-mcp usaspending-mcp

The --from is required for this server and only this server. The PyPI package is usaspending-gov-mcp but the console script it installs is usaspending-mcp, so a bare uvx usaspending-gov-mcp fails with "An executable named usaspending-gov-mcp is not provided by package usaspending-gov-mcp".

Do not run uvx usaspending-mcp either. usaspending-mcp is an unrelated third-party package on PyPI, not this project.

From source

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

Configuration

MCP is an open standard, and compatible clients can run this server. The maintained 1102tools Agent Setup Guide covers packaged agents in Codex and Claude Code, not standalone server configuration. Use the block below as the server definition and adapt its placement to your client.

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

The --refresh-package flag tells uv to check PyPI for a newer release each time your client launches the server, so fixes arrive automatically; without it, uv keeps serving whatever version it first cached. It adds a moment of network time at startup, so raise your platform's MCP startup timeout if it enforces a short one.

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

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

Restart the client and the tools appear.

Tool profiles

Standalone use defaults to USASPENDING_TOOL_PROFILE=full, which exposes all 55 tools. Packaged acquisition agents set USASPENDING_TOOL_PROFILE=acquisition-agent to expose a stable 20-tool subset covering core award search, spending, agency, recipient, NAICS, PSC, transaction, and subaward operations. An unknown profile stops startup with a clear error instead of silently changing the catalog.

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.

Request pacing

Every upstream request uses a provisional 3-second cross-process anti-burst interval by default. USASpending does not publish a numeric limit, so this is a 1102tools safeguard rather than a provider requirement. Override with FEDERAL_API_MIN_INTERVAL_SECONDS, use 0 to deliberately disable it, and use FEDERAL_API_PACING_DIR to relocate local pacing state.

License

MIT

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-1.0.5.tar.gz (192.6 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-1.0.5-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: usaspending_gov_mcp-1.0.5.tar.gz
  • Upload date:
  • Size: 192.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for usaspending_gov_mcp-1.0.5.tar.gz
Algorithm Hash digest
SHA256 97d87833ca53133a7ec6cf6f1e8ecaf93ca02f16dd6776c3ee3a947687f5c266
MD5 dfd22f6b8cfd8e9c86a59344132ab15e
BLAKE2b-256 c7b8f92c53fa38c91947c1548bb23ba446d88d443ee4e52722185b97e84b1e42

See more details on using hashes here.

Provenance

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

Publisher: publish-pypi.yml on 1102tools-dev/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-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for usaspending_gov_mcp-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c646a527739a9972a240afe1cfc8a0211ac4ef8eaa3f2b42ade23a710791941e
MD5 d7a73ada4aa910094e85c9fd5ab73a07
BLAKE2b-256 b17e00d919f494edadba1f399738f0c6a2e9f8dcdba766913981eaa0e8552b33

See more details on using hashes here.

Provenance

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

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

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

Release history Release notifications | RSS feed

This release

1.0.5 This release

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.10

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page