USA Spending MCP Server
OfficialClick on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@USA Spending MCP Servershow me total spending by NASA in fiscal year 2024"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
USA Spending MCP Server
⚠️ DISCLAIMER: This is a proof of concept and is not intended for production use.
An MCP server for interacting with the USAspending.gov API, with optional login.gov authentication for cloud deployment.
Requirements
Python 3.11+
Installation
Quick Install
uv tool install git+https://github.com/GSA-TTS/usa-spending-mcp-serverDevelopment Setup
git clone https://github.com/GSA-TTS/usa-spending-mcp-server
cd usa-spending-mcp-server
uv sync --devRunning Modes
The server supports two modes:
Mode | Command | Use Case |
stdio |
| Local use with Claude Desktop |
HTTP |
| Cloud deployment with login.gov auth |
Local Setup (Claude Desktop)
Get the installed tool path:
which usa-spending-mcp-serverAdd to your Claude MCP config (
~/.claude/claude_desktop_config.json):{ "mcpServers": { "usa-spending": { "command": "/path/to/usa-spending-mcp-server" } } }
HTTP Server with Login.gov Authentication
The HTTP server uses login.gov OIDC with PKCE for authentication, suitable for cloud.gov deployment.
Environment Variables
Variable | Required | Description |
| No | Set to |
| If auth enabled | Public URL of the server (e.g., |
| If auth enabled | Your login.gov application client ID |
| If auth enabled | Secret key for signing JWTs (generate with |
| No | OIDC discovery URL (defaults to login.gov sandbox) |
| No | Server port (default: |
Login.gov Setup
Register at partners.login.gov
Create a new OIDC application:
Protocol: OpenID Connect with PKCE (public client)
Redirect URI:
{BASE_URL}/auth/callback
Note your client ID for
LOGINGOV_CLIENT_ID
Running Locally
Without authentication (development):
uv run task devWith authentication:
export BASE_URL=http://localhost:8080
export LOGINGOV_CLIENT_ID=your-client-id
export JWT_SIGNING_KEY=$(python -c "import secrets; print(secrets.token_hex(32))")
uv run task dev-authCloud.gov Deployment
Set environment variables:
cf set-env usa-spending-mcp-server BASE_URL https://usa-spending-mcp.app.cloud.gov cf set-env usa-spending-mcp-server LOGINGOV_CLIENT_ID your-client-id cf set-env usa-spending-mcp-server JWT_SIGNING_KEY your-signing-keyDeploy:
cf push
Development
Available Tasks
uv run task dev # Run HTTP server without auth
uv run task dev-auth # Run HTTP server with auth
uv run task lint # Check code with ruff
uv run task lint-fix # Fix linting issues
uv run task format # Format code with ruff
uv run task test # Run tests
uv run task test-cov # Run tests with coverage
uv run task ci # Run all CI checksCode Quality
This project uses ruff for linting and formatting.
LLM-Based Evals (Optional)
For local testing of tool behavior using mcp-evals:
cd evals
npm install
ANTHROPIC_API_KEY=your-key npm run evalSee evals/README.md for details.
Project Structure
src/
usa_spending_mcp_server/
server.py # stdio MCP server (Claude Desktop)
server_http.py # HTTP server with auth (cloud.gov)
auth.py # login.gov OIDC authentication
tests/ # Python unit tests
evals/ # LLM-based evals (optional)
manifest.yml # cloud.gov deployment config
pyproject.tomlResources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/GSA-TTS/usa-spending-mcp-server-DEMO'
If you have feedback or need assistance with the MCP directory API, please join our Discord server