Skip to main content
Glama

us-gov-data-mcp

An MCP server for US government data. Ask your AI assistant which federal contracts are expiring, or which public companies had the most revenue last year — and get answers you can verify against the government's own records.

Built on the US Treasury's USAspending API and the SEC's EDGAR XBRL data. No scraping, no API key, no account, no personal data.


Why this exists

Both of these sources publish everything and let you query almost none of it.

usaspending.gov cannot search by contract end date. But when a federal contract's period of performance ends, the work usually has to be re-competed — and those recompetes are the highest-probability opportunities in government contracting, visible in public data months before any solicitation appears.

sec.gov serves filings one company at a time. There is no way on the site to ask which public companies had revenue over $100 billion, or which hold the most cash. The SEC's frames API can answer that across all ~5,800 filers in one call, if you already know the XBRL tag and the period format.

This server answers the questions those sites can't.

Related MCP server: sec-edgar-mcp

Four tools

find_expiring_contracts — recompetes

Federal contracts coming up for re-bid, with the incumbent and days remaining. expiring_after_days sets your bid lead time, because a contract ending next week is useless to prepare for.

{
  "days_until_expiry": 120,
  "recipient": "PERATON ENTERPRISE SOLUTIONS LLC",
  "amount_usd": 682369225.00,
  "awarding_agency": "General Services Administration",
  "verify_url": "https://www.usaspending.gov/award/..."
}

search_federal_contracts

Awarded contracts by agency, keyword, date, or dollar amount. Who is winning federal work, what an agency spends, a competitor's history.

screen_public_companies

Rank every US public company by any reported financial metric.

"Which companies had revenue over $200 billion in 2023?"

{ "company": "Walmart Inc.", "value": 648125000000, "unit": "USD",
  "period_end": "2023-12-31", "period_type": "annual",
  "verify_url": "https://www.sec.gov/Archives/edgar/data/104169/..." }

company_financial_history

One company's reported history of a metric — revenue, net income, assets, cash flow — deduplicated, with the form type and filing date on each record.

Everything is verifiable

Each record carries a verify_url to the government filing it came from. Open it and compare.

That matters most with an AI in the loop: when an assistant reports a dollar figure, you should be able to check it against the source rather than trust the chain. If a value ever disagrees with the official record, that is a bug — please open an issue.

Three traps this handles for you

Raw SEC data misleads in three specific ways, each silent — you get a plausible wrong number, not an error.

  1. A 10-Q reports the quarter and the year-to-date with the same end date. Comparing net income across filings silently mixes a three-month figure with a nine-month one. Every record carries period_type, and you can filter on it.

  2. The same fact recurs across filings with different values. This year's 10-K restates last year's figures. Deduplicated to one record per period, most recent filing winning — the SEC's own treatment of restatements.

  3. Companies switch XBRL tags over time. Microsoft filed Revenues until 2010 and a different tag afterwards. Taking the first tag that returns data yields a stale partial history; this merges across all of them.

Install

uvx --from git+https://github.com/groundtruthtools/us-gov-data-mcp us-gov-data-mcp

Claude Desktop — add to claude_desktop_config.json:

{
  "mcpServers": {
    "us-gov-data": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/groundtruthtools/us-gov-data-mcp",
        "us-gov-data-mcp"
      ],
      "env": { "SEC_USER_AGENT": "Your Name your@email.com" }
    }
  }
}

Works with any MCP client: Claude Desktop, Claude Code, Cursor, VS Code.

SEC_USER_AGENT is worth setting. SEC's fair-access policy requires a User-Agent containing a contact address, and requests without one get a 403. A default is included so the tools work out of the box, but identifying yourself is the polite thing and keeps you off a shared identity.

One quirk, learned the hard way: do not put a URL in that string. SEC returns 403 for any User-Agent containing one. Your Name your@email.com works; adding github.com/... does not.

Not on PyPI yet, so install from the repository. When it lands there this becomes a plain uvx us-gov-data-mcp.

Honest limits

  • Contracts: awarded, not open solicitations. For published bids, use SAM.gov.

  • Contracts: federal only, no data before fiscal year 2008.

  • Recompete search covers contracts with activity in the past year, because USAspending caps how deep results can be paged. A long-dormant contract may not appear, and an over-broad search says so rather than returning a confidently empty list.

  • SEC: XBRL coverage starts around 2009, and only covers concepts companies actually tagged. Smaller filers tag less.

  • It reports; it does not compute. No ratios, growth rates, or derived metrics — those would be our arithmetic rather than the filing, and you could not verify them against the source.

  • Not investment advice. It is a data-reformatting tool.

Also on Apify

The same logic runs as hosted tools, no install required:

Data sources and licence

Contracts: USAspending.gov, US Department of the Treasury, published under the DATA Act. Financials: SEC EDGAR, US Securities and Exchange Commission. Both public domain. Code: MIT.

Available Tools

4 tools
company_financial_historyA

One company's reported history of a financial metric.

Deduplicated to one record per period, taking the most recent filing -- this year's 10-K restates last year's figures, so raw SEC data repeats periods with different values.

Every record carries the form type, filing date, and a verify_url.

Inputs: company (required), limit, metric, period_type.

find_expiring_contractsA

Find federal contracts expiring soon -- recompete opportunities.

When a federal contract's period of performance ends, the work usually has to be re-competed, and the incumbent is beatable. These are the highest-probability opportunities in government contracting, visible in public data months before any solicitation is published.

Each result includes days_until_expiry and the current incumbent.

Note: usaspending.gov itself cannot filter by end date. This walks the end-date-sorted results to find the window, so it takes a few seconds.

Inputs: limit, keyword, agencies, min_amount, +2 more.

screen_public_companiesA

Rank every US public company by a financial metric.

Answers questions sec.gov structurally cannot: which companies had revenue over $100 billion last year, which hold the most cash, which reported the largest losses. EDGAR serves filings one company at a time; this compares all of them at once.

Every record carries a verify_url to the filing the figure came from.

Inputs: limit, order, metric, period, +3 more.

search_federal_contractsA

Search awarded US federal government contracts.

Returns contracts the government has already awarded, largest dollar value first. Use this to see who is winning federal work, what an agency spends, or a specific company's contract history.

For contracts coming up for re-bid, use find_expiring_contracts instead.

Inputs: limit, keyword, agencies, end_date, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: search_federal_contracts finds awarded contracts, find_expiring_contracts identifies expiring ones, screen_public_companies ranks companies by metrics, and company_financial_history retrieves a single company's historical financials. No overlapping functionality exists between the four tools.

    Naming Consistency2/5

    The naming pattern is inconsistent. The first three tools use a verb-noun structure (search_, find_, screen_), but the fourth uses a noun-noun structure (company_financial_history). Additionally, the verbs 'search', 'find', and 'screen' are near-synonyms, which could confuse users about their exact purposes. The pattern is not uniform across the set.

    Tool Count4/5

    With only 4 tools, the server is reasonably scoped for its niche of government contracts and public company financials. It is slightly on the low end but within the acceptable 3–15 range, and each tool serves a distinct query need without unnecessary bloat.

    Completeness4/5

    The tool surface covers the primary queries for the domain: searching awarded contracts, finding expiring ones, screening companies by financial metrics, and retrieving a company's financial history. There are minor gaps (e.g., no tool for detailed contract metadata or company fundamentals beyond history), but agents can accomplish core tasks without dead ends.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      B
      maintenance
      MCP server for accessing SEC EDGAR filings. Connects AI assistants to company filings, financial statements, and insider trading data with exact numeric precision.
      21
      664 PyPI
      386
      AGPL 3.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Hosted MCP server that gives AI agents real-time access to SEC EDGAR filings search, 10-K/8-K reading, XBRL financial facts, and insider-trade (Form 4) alerts.
      9 npm
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that gives AI agents access to US business entity data, enabling searches across 9 state registries, SEC EDGAR filings, federal contracts, and lobbying disclosures.
      6
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Read-only MCP server for exploring US federal spending data via the USAspending.gov API, enabling natural language queries on awards, agencies, recipients, and spending trends.
      12
      MIT