DEV Community

Cover image for How to give Claude a US federal contract-opportunity finder with the Apify MCP server
Michael
Michael

Posted on • Originally published at scrapers.lat

How to give Claude a US federal contract-opportunity finder with the Apify MCP server

Ask Claude "what federal contracts should my company bid on this week?" and you will get a thoughtful-sounding answer built on nothing. The model has no idea what is posted on SAM.gov today, which notices are still active, which ones carry a set-aside you actually qualify for, or when responses are due. For business development and capture teams, a plausible answer to that question is worse than no answer, because a missed deadline or a misread set-aside is a lost bid.

In this guide we close that gap. We connect Claude to the official Apify MCP server, expose a single Actor that reads live opportunity notices from SAM.gov (the U.S. government's system for federal contract opportunities), and turn "what should we bid on?" from a guess into a real-time query against the source of record. By the end you will have a working opportunity-finder tool that Claude, Cursor, or any MCP client can call mid-conversation, and you will know exactly where in the run the tool fires and what it returns.

Everything below is a real setup with real output. No mocked responses.

What is the Apify MCP server?

Model Context Protocol (MCP) is an open standard that lets AI clients call external tools. The Apify MCP server (https://mcp.apify.com) implements that standard on top of the Apify platform, which means every one of the thousands of Actors in the Apify Store becomes a tool an agent can invoke.

Why route an Actor through MCP instead of hard-coding an API call?

  • The agent decides when to fetch. Claude reads the conversation, notices it needs current opportunity data it does not have, and calls the tool on its own. You do not write glue code for every question.
  • Structured input and output. The MCP server hands Claude the Actor's input schema, so the model fills in parameters like search term, NAICS code, and set-aside correctly, then gets back a clean dataset it can reason over.
  • One connection, many tools. The same MCP endpoint exposes search-actors, fetch-actor-details, and call-actor, so an agent can discover and run any Actor without new configuration.
  • No infrastructure. The server is hosted. You add a few lines to a config file and you are done.

The Actor we will use

We will expose the SAM.gov Federal Contract Opportunities Scraper. It searches active and archived opportunity notices across every federal agency and returns the full record for each one: title, notice type (Sources Sought, Combined Synopsis/Solicitation, Solicitation, Special Notice, and so on), solicitation number, the posting agency's full org path, NAICS and product-service codes, set-aside type, posted and response-deadline dates, place of performance, and the contracting officer's name, email, and phone.

That field set is exactly what a capture or BD analyst pulls before deciding whether a notice is worth a bid. You can narrow the search by keyword, NAICS code, set-aside, notice type, and date range, and restrict it to active opportunities only.

The SAM.gov Federal Contract Opportunities Scraper on the Apify Store

Step 1: Get your Apify API token

Sign in to the Apify Console, open Settings → Integrations, and copy your personal API token. The MCP server uses it to authenticate and to bill Actor runs to your account.

📌 Note: the token is a secret. Keep it in the client config only, never in a prompt or a committed file.

Step 2: Point Claude Desktop at the Apify MCP server

Open Claude Desktop's config file (Settings → Developer → Edit Config, or ~/Library/Application Support/Claude/claude_desktop_config.json on macOS) and add the Apify server. The tools query parameter is the important part: it tells the server which Actor to expose, so Claude gets one focused tool instead of the entire Store.

{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=scrapers_lat/sam-gov-opportunities-scraper",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Cursor uses the same JSON in .cursor/mcp.json. If you prefer to run it locally over stdio instead of the hosted endpoint:

{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": ["-y", "@apify/actors-mcp-server", "--tools", "scrapers_lat/sam-gov-opportunities-scraper"],
      "env": { "APIFY_TOKEN": "YOUR_APIFY_TOKEN" }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Restart Claude Desktop so it picks up the new server.

Step 3: Confirm the tool is loaded

After the restart, the Actor shows up as a callable tool. If you list the tools the Apify server exposes, you will see the storage helpers plus the Actor itself, named after its Store handle:

get-actor-run, get-dataset-items, get-key-value-store-record,
abort-actor-run, scrapers_lat--sam-gov-opportunities-scraper
Enter fullscreen mode Exit fullscreen mode

That last entry, scrapers_lat--sam-gov-opportunities-scraper, is our opportunity-finder tool. Claude now knows it exists, what it does (from the Actor's README), and what inputs it takes (from the input schema the server passes along).

Step 4: Ask Claude to find opportunities

Now the payoff. In a normal chat, ask a question that requires current, ground-truth data:

"We're a service-disabled veteran-owned IT shop. Find an active federal contract opportunity in our wheelhouse (IT / cybersecurity) that we're eligible to bid on, and give me the solicitation number, agency, NAICS, set-aside, and the response deadline."

Claude recognizes it cannot answer this from memory, selects the SAM.gov tool, and fills in the input from your question. Under the hood the client sends a tools/call with the Actor's parameters:

{
  "name": "scrapers_lat--sam-gov-opportunities-scraper",
  "arguments": {
    "searchTerm": "cybersecurity",
    "activeOnly": true,
    "withDetails": true,
    "maxOpportunities": 8
  }
}
Enter fullscreen mode Exit fullscreen mode

The Apify MCP server starts the Actor, waits for it to finish, and returns the dataset. Here is the real run metadata it produced:

{
  "runId": "0yUogSBO8lPXAFUqm",
  "actorName": "scrapers_lat/sam-gov-opportunities-scraper",
  "status": "SUCCEEDED",
  "startedAt": "2026-07-30T17:46:59.257Z",
  "finishedAt": "2026-07-30T17:47:01.862Z",
  "stats": { "runTimeSecs": 2.4 }
}
Enter fullscreen mode Exit fullscreen mode

Under three seconds, live against SAM.gov.

Step 5: Read the real output

The dataset the tool returns is structured opportunity data. This is an actual record from the run (trimmed to the fields that matter for a bid decision):

{
  "title": "7A21--RTLS Hand Held Application (VA-26-00077512)",
  "type": "Sources Sought",
  "solicitationNumber": "36C10B26Q0702",
  "fullParentPathName": "VETERANS AFFAIRS, DEPARTMENT OF.TECHNOLOGY ACQUISITION CENTER NJ (36C10B)",
  "naicsCode": "541519",
  "classificationCode": "7A21",
  "setAside": "SDVOSBC",
  "isActive": true,
  "postedDate": "2026-07-30T16:19:31.457+00:00",
  "responseDeadLine": "2026-08-17T14:00:00-05:00",
  "pointOfContact": [
    { "type": "primary", "name": "Juan C Perez", "title": "Contract Specialist",
      "email": "Juan.Perez5@va.gov", "phone": "512-981-4467" }
  ],
  "uiLink": "https://sam.gov/opp/54cedde1592c4639a9274299632e6e36/view"
}
Enter fullscreen mode Exit fullscreen mode

Claude reads that and answers in plain language: yes, the Department of Veterans Affairs has an active notice, it is a Sources Sought under NAICS 541519 (Other Computer Related Services), the set-aside is SDVOSBC so a service-disabled veteran-owned small business qualifies, responses are due 2026-08-17 at 14:00 Central, and the contracting officer is Juan C. Perez at Juan.Perez5@va.gov. Every one of those facts is traceable to a live SAM.gov notice, not the model's memory.

Claude calling the SAM.gov tool and answering with a live opportunity

The notice type matters as much as the match. This is a Sources Sought, which means the VA is still gauging market interest before it releases the formal solicitation. An agent that understands that distinction tells you to submit a capability statement now to shape the requirement, rather than waiting for an RFQ that has not dropped yet. A model working from training data would not know this notice exists, let alone what stage it is at.

A real use case: a daily bid-triage agent

Put this in context. A BD or capture lead starts every morning by scanning SAM.gov for new notices in their company's NAICS codes and set-aside eligibility, then deciding which handful are worth a proposal team's time. Done by hand, that is twenty minutes of clicking, filtering, and copying solicitation numbers into a tracker, per person, every day.

With the tool wired into Claude, the analyst asks the agent to pull today's active opportunities for their NAICS codes and set-aside, then have it rank them: which are Sources Sought (shape the requirement now), which are open Solicitations with a near-term deadline (decide fast), and which are the wrong size or place of performance. Claude calls the Actor, reads the type, setAside, responseDeadLine, and naicsCode on each record, and produces a short go/no-go list with the solicitation number and contracting officer attached as evidence. The mechanical scan disappears; the bid/no-bid judgment stays with the human.

This is the shape of every good agent tool: it removes the daily fetch, not the decision.

Going further: chain a second tool

Finding the opportunity is half the picture. Before you commit a proposal team, you want to know who has won similar work and at what dollar values, so you can gauge the competitive field and price to win. The same MCP connection can expose more Actors by extending the tools parameter:

https://mcp.apify.com?tools=scrapers_lat/sam-gov-opportunities-scraper,scrapers_lat/usaspending-awards-scraper
Enter fullscreen mode Exit fullscreen mode

Now the agent can find an open opportunity on SAM.gov and pull the USAspending Federal Award & Contract Scraper to see historical awards for that same agency and NAICS code, then combine both into one capture brief: here is the notice, here is who has won this kind of work before, here is the range of award amounts. Because each Actor is a separate tool, the agent picks the right one for each step on its own.

🏹 Troubleshooting: if the tool does not appear in Claude, the two usual causes are a missing or misspelled Actor handle in the tools parameter (it must be the exact username/actor-name from the Store URL) and a config that was edited while Claude was running. Fix the handle, save, and fully restart the client.

📌 Note: each tool call is a real Actor run billed to your Apify account (this Actor is pay-per-result). For an interactive morning scan the cost is a fraction of a cent; if you want to monitor dozens of NAICS codes on a fixed schedule, run the Actor directly through the Apify API or a scheduled task and have it push new notices to your tracker, rather than one call per chat message.

Wrapping up

You now have an AI agent that can find live U.S. federal contract opportunities, filtered to your NAICS codes and set-aside eligibility, on demand and mid-conversation, with the solicitation number, notice type, deadline, and contracting-officer contact a bid decision actually needs. The pattern is reusable: pick an Actor that returns authoritative structured data, expose it through the Apify MCP server with the tools parameter, and let the agent decide when to call it.

To take it further:

  • Narrow the search by NAICS code, set-aside, or notice type to match exactly what your company pursues. The setup is identical.
  • Add the USAspending awards Actor for competitive intelligence, or an entity-registration Actor to vet potential teaming partners, and build a full capture-support agent.
  • Read the Apify MCP server docs for OAuth setup, resource reads, and the search-actors / call-actor tools that let an agent discover Actors it was not preconfigured with.

The Actor used in this guide: SAM.gov Federal Contract Opportunities Scraper.

Top comments (0)