Skip to main content

usaspending-gov-mcp

price: free license: MIT tools: 55 regression tests: 2,303

Free, open-source MCP server for the USAspending.gov federal contract, award, subaward, recipient, agency, and federal account API.

No API key required, locally or hosted. See Local or hosted.

The 1.0.16 source validation collected 2,303 regression cases: 1,924 passed and 379 live-gated cases were skipped. The focused content suite covers fiscal defaults, annual new-award fiscal grouping, exact PIID lookup, date modes, pagination, DoD lag, recipient/File C caveats and aggregation filters. See testing.md for the testing record and publication verification status.

Local or hosted

Local (desktop) Claude (hosted) ChatGPT (hosted)
Local setup Install Install
  • Local runs it on your computer, inside the Claude or ChatGPT desktop app or another AI app. You get your own full rate limits, and it relies only on the government service. You don't have to set it up by hand: give your AI this page's link and ask it to set it up or walk you through it.
  • Hosted is the convenient option: one click, no keys, and it works in Claude or ChatGPT anywhere.

Compare local and hosted · Matching prompts

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 names by partial name
  • list_states - All states with FIPS codes

For a recipient workflow, take a name from autocomplete_recipient to search_recipients. Use the returned id hash for profiles and new-award trends. To retrieve subsidiaries, pass the parent (-P) row’s uei (or legacy duns) to get_recipient_children; that tool accepts UEI/DUNS.

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
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

Use the configuration below as the server definition and adapt its placement to your compatible MCP client. For practical requests using this source, see the prompt library.

{
  "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.
  • Fiscal time groups. Fiscal years run October through September; quarter 1 is October–December and month 1 is October. new_awards_over_time combines the source’s fiscal-quarter counts for annual fiscal-year results. A date window that covers only part of a fiscal year returns counts for that requested portion, not the entire year. Quarter and month results retain the source counts.
  • 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

Regression tests

Run PYTHONPATH=src uv run --python 3.12 python -m pytest -q from this package directory. The default lane passes 1,924 cases and skips 379 live cases. Set USASPENDING_LIVE_TESTS=1 to enable public API checks. Counts below include parametrized and live-gated cases collected for 1.0.16.

Test file Cases Coverage
test_v0_3_features.py 1,244 Tool shapes, filters and expanded API surface
test_density_r5.py 415 Boundary and semantic regression density
test_live_audit_r6.py 157 Live endpoint audit
test_live_audit_r7.py 104 Live parameter and pagination audit
test_content_fixes_1013.py 75 October content fixes; 71 offline, 4 live
test_round_8.py 69 Property and validation checks
test_entity_family_fixes.py 63 Agency, recipient and award semantics
test_validation.py 62 Input validation
test_search_family_fixes.py 37 Search and aggregation semantics
test_response_cache_hosted.py 10 Hosted cache behavior
test_audit_r11.py 9 Paced audit anchors
test_throughput.py 9 Request throughput and pacing
test_tool_profiles.py 3 Tool profile selection
test_http.py 2 HTTP handling
test_content_e2e_1014.py 36 Full end-to-end audit guidance regressions
test_published_scope_1015.py 2 Published tool-selection scope guidance
test_new_awards_fiscal_year_1016.py 6 Captured annual fiscal-year correction and unchanged quarter/month samples
Total 2,303 1,924 offline; 379 live-gated

Metadata

Release files for usaspending-gov-mcp 1.0.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for usaspending-gov-mcp 1.0.16
File Size Uploaded
usaspending_gov_mcp-1.0.16.tar.gz 226.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for usaspending-gov-mcp 1.0.16
File Interpreter ABI Platform
usaspending_gov_mcp-1.0.16-py3-none-any.whl Python 3 none any Details

Total release size: 277.4 kB

Release files / usaspending_gov_mcp-1.0.16.tar.gz

Download URL usaspending_gov_mcp-1.0.16.tar.gz
Size 226.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b6c8c92e22aa7def8bcb2c75c842901ae38a17bcd66566f328d9eaab588c737c
BLAKE2b-256 checksum
How to use checksums
facf5bcd07e319090622524879a47549be596b182726c67d58f04feb8f4fd985
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / usaspending_gov_mcp-1.0.16-py3-none-any.whl

Download URL usaspending_gov_mcp-1.0.16-py3-none-any.whl
Size 51.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e2a9b622ab8f278a8127df18cb587475f6b9cabe03dc77bfa84e076f91de95cf
BLAKE2b-256 checksum
How to use checksums
a2289ee122f15a4faecd7f5a2239ae147f0c40958128edbca38b0a7038180c2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.26

2 release files

1.0.25

2 release files

1.0.24

2 release files

1.0.23

2 release files

1.0.22

2 release files

1.0.21

2 release files

1.0.20

2 release files

1.0.19

2 release files

1.0.17

2 release files

This release

1.0.16 This release

2 release files

1.0.15

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release 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