USA Spending API

v1.0.0APIsstable

Test MCP Server for USA Spending API

usa-spending-mcp-server-demomcpai-integration
Share:
10
Stars
0
Downloads
0
Weekly
0/5

What is USA Spending API?

USA Spending API is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to test mcp server for usa spending api

Test MCP Server for USA Spending API

This server falls under the APIs and Analytics categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Test MCP Server for USA Spending API

Use Cases

Query government spending data via USA Spending API.
GSA-TTS

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedApr 8, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx usa-spending-mcp-server-demo

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use USA Spending API

The USA Spending MCP Server provides AI assistants with structured access to USASpending.gov, the official open-data portal for US federal government expenditures. It runs locally over stdio for Claude Desktop or as an HTTP server for cloud deployments, and requires no API key for basic read-only queries of federal spending data.

Prerequisites

  • Python 3.11 or higher
  • The uv package manager (https://docs.astral.sh/uv/)
  • Git for cloning the repository
  • Claude Desktop or another MCP-compatible client for local use
  • Optional: login.gov OIDC credentials if deploying the authenticated HTTP mode
1

Install uv

The project uses uv for dependency management and running tasks. Install it with the official script.

curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.bashrc  # or ~/.zshrc
2

Install the server via uv tool

Install the usa-spending-mcp-server directly from GitHub. This makes the command available globally.

uv tool install git+https://github.com/GSA-TTS/usa-spending-mcp-server
3

Verify the installation

Confirm the binary was installed and is reachable from your PATH.

usa-spending-mcp-server --help
4

Configure Claude Desktop

Add the server to your Claude Desktop configuration. On macOS the file is at ~/Library/Application Support/Claude/claude_desktop_config.json.

{
  "mcpServers": {
    "usa-spending": {
      "command": "usa-spending-mcp-server"
    }
  }
}
5

Optional: clone for development or HTTP deployment

If you want to run tests, lint, or deploy the HTTP server variant, clone the repo and use uv sync.

git clone https://github.com/GSA-TTS/usa-spending-mcp-server
cd usa-spending-mcp-server
uv sync --dev
uv run task dev   # HTTP server without auth
uv run task test  # run test suite

USA Spending API Examples

Client configuration

Minimal Claude Desktop config for local stdio mode—no environment variables required for public data access.

{
  "mcpServers": {
    "usa-spending": {
      "command": "usa-spending-mcp-server"
    }
  }
}

HTTP server with authentication (optional)

Environment variables needed when running the HTTP variant with login.gov OIDC authentication.

{
  "mcpServers": {
    "usa-spending-http": {
      "command": "usa-spending-mcp-server-http",
      "env": {
        "REQUIRE_AUTH": "true",
        "BASE_URL": "https://your-server.example.com",
        "LOGINGOV_CLIENT_ID": "your-oidc-client-id",
        "JWT_SIGNING_KEY": "your-32-byte-hex-secret",
        "LOGINGOV_CONFIG_URL": "https://idp.int.identitysandbox.gov/.well-known/openid-configuration",
        "PORT": "8080"
      }
    }
  }
}

Prompts to try

Sample prompts to query federal spending data through the MCP server.

- "How much did the Department of Defense spend in fiscal year 2023?"
- "List the top 10 federal contractors by total contract awards in 2022"
- "Show me grants awarded to universities in California last fiscal year"
- "What agencies had the highest spending on IT contracts in 2023?"
- "Find all federal contracts awarded to small businesses in Texas in Q1 2023"

Troubleshooting USA Spending API

usa-spending-mcp-server command not found after installation

Run `uv tool update-shell` to ensure uv's tool bin directory is on your PATH, then restart your terminal. Alternatively, find the binary with `uv tool dir` and add it to PATH manually.

API requests return rate limit or timeout errors

USASpending.gov enforces rate limits on its public API. Space out large queries, reduce date ranges, or add pagination parameters to your requests. The public API does not require an API key but still throttles high-frequency calls.

HTTP mode fails to start with authentication errors

Generate a fresh JWT signing key with `python -c "import secrets; print(secrets.token_hex(32))"` and verify your LOGINGOV_CLIENT_ID matches exactly what is registered in the login.gov partner portal. The redirect URI must be set to {BASE_URL}/auth/callback.

Frequently Asked Questions about USA Spending API

What is USA Spending API?

USA Spending API is a Model Context Protocol (MCP) server that test mcp server for usa spending api It connects AI assistants to external tools and data sources through a standardized interface.

How do I install USA Spending API?

Follow the installation instructions on the USA Spending API GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with USA Spending API?

USA Spending API works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is USA Spending API free to use?

Yes, USA Spending API is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More APIs MCP Servers

Explore all apis servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "usa-spending-mcp-server-demo": { "command": "npx", "args": ["-y", "usa-spending-mcp-server-demo"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use USA Spending API?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides