# USAspending.gov MCP Server (`rl1987/usaspending-mcp`) Actor

MCP server exposing USAspending.gov agency, award search, keyword search, federal account, state, and recipient data via the public USAspending API.

- **URL**: https://apify.com/rl1987/usaspending-mcp.md
- **Developed by:** [R.L.](https://apify.com/rl1987) (community)
- **Categories:** MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 price for completing a tool calls

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### USAspending.gov MCP Server

Ten USAspending.gov search tools, zero manual browsing: **USAspending.gov MCP Server** turns the [Agency Profile](https://www.usaspending.gov/agency), [Advanced Search](https://www.usaspending.gov/search), [Keyword Search](https://www.usaspending.gov/keyword_search), [Federal Account](https://www.usaspending.gov/federal_account), [State Profile](https://www.usaspending.gov/state), and [Recipient Profile](https://www.usaspending.gov/recipient) pages into MCP tools any AI agent can call directly. Ask for "who won federal contracts for ambulance services in Texas in 2023" or "how much did the Department of Defense obligate this fiscal year" in plain language and get back real, structured results — not a screen-scrape of a form you have to fill in yourself.

Each tool wraps the real JSON API behind the page (`api.usaspending.gov`), which is public and requires no authentication — so lookups are fast, cheap, and always current with the live federal spending data.

Because it runs on Apify in [Standby mode](https://docs.apify.com/platform/actors/development/programming-interface/standby), it behaves like a normal always-on HTTP MCP endpoint — no cold start per query — plus you get Apify's monitoring, scheduling, and proxy infrastructure for free if you need it.

#### Why use USAspending.gov MCP Server?

- **One connection, six USAspending.gov search surfaces.** Skip six different forms and URL query formats — point an agent at a single MCP endpoint instead.
- **Government contracting and grants research.** Find who's winning awards from a given agency, in a given state, or matching a keyword, without leaving your agent workflow.
- **Due diligence and vendor research.** Pull a recipient's full award history and business-type profile before doing business with them.
- **Budget and policy analysis.** Pull agency-level or federal-account-level budget authority, outlays, and obligations for a fiscal year.

#### How to use USAspending.gov MCP Server

1. Add it to your MCP client as an HTTP/Streamable-HTTP server:

   ```
   claude mcp add --transport http usaspending \
     https://rl1987--usaspending-mcp.apify.actor/mcp \
     --header "Authorization: Bearer $APIFY_TOKEN"
   ```

   The token is your own [Apify API token](https://console.apify.com/account/integrations) (Console → Settings → Integrations), not the Actor owner's — export it as `$APIFY_TOKEN` in your shell, or substitute your own.

2. Verify the connection and tool count:

   ```
   claude mcp list
   # or, inside a Claude Code session:
   /mcp
   ```

3. Ask your agent to search, e.g. "Use usaspending to find contract awards to Raytheon in 2023" or "Look up California's total federal spending via get\_state\_spending."

A team can commit a `.mcp.json` with just the URL (no token) to a shared repo; each teammate runs `claude mcp add --scope local` once with their own token.

#### Tools

| Tool | Source page | Covers |
| --- | --- | --- |
| `search_agencies` | [/agency](https://www.usaspending.gov/agency) | agency name/abbreviation search across all top-tier federal agencies |
| `get_agency_overview` | [/agency](https://www.usaspending.gov/agency) | budget authority, outlays, obligations, mission for one agency by fiscal year |
| `search_awards` | [/search](https://www.usaspending.gov/search) | full advanced award search — keywords, award type, date range, agency, recipient |
| `keyword_search` | [/keyword\_search](https://www.usaspending.gov/keyword_search) | simple single-keyword contract award search |
| `list_federal_accounts` | [/federal\_account](https://www.usaspending.gov/federal_account) | federal account search by keyword/agency identifier |
| `get_federal_account` | [/federal\_account](https://www.usaspending.gov/federal_account) | one federal account's budgetary resources, outlays, obligations, child TAS accounts |
| `list_state_spending` | [/state](https://www.usaspending.gov/state) | spending totals for every U.S. state/territory |
| `get_state_spending` | [/state](https://www.usaspending.gov/state) | one state's population, income, and federal award totals |
| `search_recipients` | [/recipient](https://www.usaspending.gov/recipient) | recipient name/UEI/DUNS search |
| `get_recipient` | [/recipient](https://www.usaspending.gov/recipient) | one recipient's full profile — alternate names, business types, location, parent org |

Every tool returns JSON straight from `api.usaspending.gov` — no PDFs or bulk archives are pre-downloaded on your behalf.

#### Example output (`keyword_search`, abbreviated)

```json
{
  "results": [
    {
      "Award ID": "W56HZV23C0024",
      "Recipient Name": "BAE SYSTEMS LAND & ARMAMENTS L.P.",
      "Award Amount": 2479580090.0,
      "Awarding Agency": "Department of Defense",
      "Description": "EARLY ORDER MATERIAL IN SUPPORT OF THE FUTURE..."
    }
  ],
  "page_metadata": { "page": 1, "hasNext": true }
}
```

#### Pricing / cost

This Actor uses Apify's [Pay Per Event](https://docs.apify.com/platform/actors/publishing/monetize#pay-per-event-pricing-model) model — see [`.actor/pay_per_event.json`](.actor/pay_per_event.json) for the configured `tool-call` price. You're charged once per completed tool call, not per underlying HTTP request the tool makes internally, and never for a failed call.

#### Tips

- `search_awards` and `keyword_search` require `award_type_codes` from a single group only (e.g. all contract codes, or all grant codes) — mixing contracts and grants in one call errors. `keyword_search` defaults to contract codes.
- `search_awards`'s earliest supported `start_date` is 2007-10-01; USAspending's Custom Award Download covers further back but isn't exposed here.
- `get_state_spending` and `get_federal_account` take the code/number shown in `list_state_spending`/`list_federal_accounts` results — look those up first if you don't already have it.

#### FAQ, disclaimers, and support

All data comes directly from the public, unauthenticated `api.usaspending.gov` API — the same backend that powers usaspending.gov itself. That API is undocumented in places and can change without notice; if a tool starts failing, please open an issue. This is an unofficial, independently built integration and is not affiliated with or endorsed by the U.S. Treasury or USAspending.gov.

### Documentation reference

- [Apify SDK for Python documentation](https://docs.apify.com/sdk/python)
- [Apify Platform documentation](https://docs.apify.com/platform)
- [FastMCP documentation](https://gofastmcp.com/getting-started/welcome)
- [Apify MCP server documentation](https://docs.apify.com/platform/integrations/mcp)

# Actor input Schema

## Actor input object example

```json
{}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("rl1987/usaspending-mcp").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("rl1987/usaspending-mcp").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call rl1987/usaspending-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rl1987/usaspending-mcp"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/GhLZEZME5ZyAdLaUF/builds/Kgz4zRe3J6IGsBlw9/openapi.json
