rfp-agent
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
rfp-agent: find federal contracts worth bidding on
An agent that helps a small company decide which US federal contract notices to bid on. It loads every open notice from SAM.gov, removes duplicate postings, scores each one 0-100 for the company with plain reasons, and looks up the Federal Acquisition Regulation (FAR), refusing when the FAR does not cover the question. The tools run as an MCP server, so Claude Desktop, Claude Code or any MCP client can use them; a small agent loop can also drive them with a free local model to write a go/no-go brief.
$ rfp-agent search --profile examples/atlanta_it_profile.toml --min-days-left 10 --limit 5
4,360 open notices with 10+ days left, ranked by fit
77 Region 9 Help Desk IT Support Services Bridge EPA Special Notice closes 2026-12-09
77 DA10--Utilization Management Software VA Sources Sought closes 2026-12-11
76 Acquisition SI DoD Sources Sought closes 2026-12-18
75 NILE ISS 6 Engineering Services (N0003927RM002) Navy Solicitation closes 2026-12-17
75 Fountainhead DOJ Sources Sought closes 2026-12-24Three results
15,171 → 10,773 notices. 4,398 open notices were repeat postings of the same solicitation (every amendment gets a new notice id). The largest group, GSA's Multiple Award Schedule, was posted 60 times.
The FAR tool refuses what the FAR does not cover. "Per diem rate for lodging in Atlanta?" scores 0.620, below the 0.711 floor calibrated on nonsense probes, so it returns no answer instead of an invented rate.
Small local models fail the full task in ways a simple eval hides. Both pass 7/7 tool-choice cases, yet on the real brief llama3.1:8b invented three notice ids. They never reached the brief's tables, which are built only from tool results.
Related MCP server: samgov-mcp
How it fits together
flowchart LR
CSV[SAM.gov public CSV<br/>no key] --> S[store.py<br/>normalize, keep open,<br/>remove duplicates]
API[SAM.gov API<br/>key from Keychain] --> S
S --> J[(opportunities.jsonl<br/>10,773 notices)]
P[company profile<br/>.toml] --> SC[scoring.py<br/>rule-based 0-100]
J --> T[tools.py<br/>4 tools, input checks]
SC --> T
F[abstain-rag FAR index<br/>bge-small + FAISS] --> FT[far_tool.py<br/>floor + margin gates]
FT --> T
T --> M[mcp_server.py<br/>Claude Desktop / Code]
T --> A[agent.py<br/>local LLM loop] --> B[go/no-go brief]What the LLM decides and what it does not. The model only chooses which tool to call and writes the summary. Fit scores come from rules, refusals from retrieval gates, and the brief's tables from tool results, so a weaker model cannot change a score, talk the FAR tool into answering, or put a made-up notice in a table.
Results
What | Result |
Notices after removing duplicates | 10,773 of 15,171 (4,398 repeats, 2,057 groups) |
FAR answered: "When must a contracting officer set aside for small business?" | allowed, top section 19.502-1 (score 0.840) |
FAR refused: "Per diem rate for lodging in Atlanta in 2026?" | refused, 0.620 < floor 0.711 |
Evals, tool choice (7 cases) | 7/7 llama3.1:8b, 7/7 qwen2.5:7b, 7/7 rules baseline |
Evals, FAR refusal (7) and fit bands (5) | all pass; decided by gates and rules, same for every model |
Full brief, qwen2.5:7b | 0 results at first (stacked every filter), retried after the empty-result hint, 1 GO; summary named the wrong NAICS code |
Full brief, llama3.1:8b | one 11-keyword query, 0 results, stopped; before the hint it invented 3 notice ids |
Tests | 78, no network and no model needed |
Read the eval rows with care: only tool choice uses the model, the 7 cases are easy, and only the tool name is graded (both models made up argument values that still passed). 4 judgment-call cases were reviewed by a person, who agreed with all 4.
Quick start
Needs Python 3.12 and uv. The FAR tool also needs the sibling
abstain-rag checkout at ../abstain-rag.
git clone https://github.com/gss-18/rfp-agent && cd rfp-agent
uv sync # add --no-group far to skip the FAR tool
uv run rfp-agent extract # public CSV of all open notices, no key, ~230 MB
uv run rfp-agent build # -> data/opportunities.jsonl
uv run rfp-agent search --profile examples/atlanta_it_profile.toml --min-days-left 10Command reference
Every command prints JSON (except brief, which prints Markdown). Run uv run rfp-agent <command> --help for
the same list.
extract: download all open notices (no key)
uv run rfp-agent extractDownloads SAM.gov's public daily CSV extract (~230 MB) into data/raw/. No options. This is the easiest way
to get data.
fetch: recent notices from the SAM.gov API (needs a key)
uv run rfp-agent fetch --days 7 --pages 1 --budget 3Option | Default | Meaning |
| 7 | notices posted in the last N days |
| 1 | how many result pages to request (1,000 notices each) |
| 3 | most live API calls allowed per day; personal keys have low limits |
| off | use only responses already cached in |
The key is read from SAM_API_KEY or the macOS Keychain (security add-generic-password -s sam-gov-api -a <you> -w). It is never written to disk. Note: the API's offset parameter is a page index, not a record count.
build: create the local store
uv run rfp-agent buildMerges the CSV extract and any cached API pages, keeps only open notices, removes duplicates, and writes
data/opportunities.jsonl. Prints the counts, including duplicates_removed.
Option | Meaning |
| ignore the CSV extract; build from cached API pages only |
search: find notices
uv run rfp-agent search "data analytics" --naics 5415 --set-aside small_business --min-days-left 10
uv run rfp-agent search --profile examples/atlanta_it_profile.toml --limit 20Argument / option | Default | Meaning |
| none | words to find in the title, agency or description. Whole words only ("bi" does not match "bi-lateral"). Several words match as a phrase first ("power bi"); if no notice has the phrase, notices with all the words anywhere count. The output's |
| none | NAICS codes or prefixes, comma-separated: |
| none |
|
| 0 (any) | only notices posted in the last N days |
| 0 | only notices with at least N days before the response deadline |
| 10 | how many results to print (1-50); |
| none | rank by fit score for this company (best first, earlier deadline breaks ties) and add |
If nothing matches, the output includes a hint explaining why, so an agent can widen its search.
score: why a notice scored what it did
uv run rfp-agent score db8203e048e448d4b21fd62e7ec32337 --profile examples/atlanta_it_profile.tomlArgument / option | Default | Meaning |
| required | the id from |
| the example profile | the company to score for |
Prints the total, the band (strong 70+, possible 40-69, weak), eligibility, and each part with its reason:
naics 35 NAICS 541512 is one of the firm's codes
set_aside 25 set aside for small_business, which the firm holds
keywords 0 no profile keywords in title or description
deadline 10 20 days to respond (need 10)
place 5 no place of performance listedfar: look up the FAR, or refuse
uv run rfp-agent far "Can a contractor withdraw its offer before the award?"Argument | Meaning |
| a plain-English question, in quotes |
Returns answer_allowed, the reason, and the top FAR sections with scores and passages. It never writes an
answer itself; it returns evidence to read.
brief: run the agent and write a go/no-go brief
uv run rfp-agent brief --llm ollama --model qwen2.5:7b --out runs/brief.mdOption | Default | Meaning |
| the example profile | the company the brief is for |
|
|
|
|
| the Ollama model, e.g. |
| 12 | most tool calls the agent may make before it must stop |
| write the Markdown brief to this file instead of the screen |
The brief marks each notice GO (70+), REVIEW (40-69) or NO-GO, and never says GO for an ineligible set-aside, an impossible deadline, or a sole-source/special notice. Tables come from tool results; the summary is written by the model and labeled as such.
eval: run the evaluation cases
uv run rfp-agent eval # offline rules baseline
uv run rfp-agent eval --llm ollama --model llama3.1:8bOption | Default | Meaning |
|
| which model picks tools for the tool-choice cases |
|
| the Ollama model |
| off | skip cases that need the FAR index (what CI does) |
Cases live in evals/cases.jsonl (tool choice, FAR refusal, fit bands). The output shows each case, the tool
arguments the model chose, and PASS/FAIL.
rfp-agent-mcp: the MCP server
uv run rfp-agent-mcpStarts the server over stdio. Add it to Claude Desktop (claude_desktop_config.json) or Claude Code:
{"mcpServers": {"rfp-agent": {"command": "uv",
"args": ["--directory", "/path/to/rfp-agent", "run", "rfp-agent-mcp"]}}}Tool | Inputs |
|
|
|
|
|
|
|
|
Your company profile
A profile is a small TOML file. Copy examples/atlanta_it_profile.toml and edit it:
[company]
name = "Peachtree Data Systems (example)"
naics = ["541511", "541512", "541519"] # work types from your SAM.gov registration
eligibilities = ["small_business"] # set-asides you qualify for
keywords = ["data", "analytics", "cloud", "software", "cybersecurity"]
states = ["GA", "AL", "FL", "SC", "TN", "NC"] # where you can perform the work
min_days_to_deadline = 10 # how fast you can write a proposalFor safety, tools only read profiles inside the project or a folder you allow. To keep a real company's profile out of the repo, put it elsewhere and point to that folder:
export RFP_PROFILE_DIR=~/rfp-profiles
uv run rfp-agent search --profile ~/rfp-profiles/mycompany.toml --min-days-left 10How the fit score works
Part | Points | Rule |
NAICS | 35 | exact code 35; same 4-digit group 20; notice lists none 10 |
Set-aside | 25 | firm holds it 25; open competition 15; firm lacks it 0 and the total is capped at 10 |
Keywords | 20 | 2+ in the title 20; 1 in the title 12; only in the description 6 |
Deadline | 10 | enough days 10; at least half the days needed 5 |
Place | 10 | target state 10; none listed 5; other state 2 |
If neither the NAICS code nor any keyword matches, the total is capped at 30. The reasoning behind each weight
is in src/rfp_agent/scoring.py. Rules, not a model, so the same notice always gets the same score and every
point has a reason a person can check or disagree with.
How the FAR refusal works
far_lookup retrieves 50 FAR passages with bge-small, collapses them to sections, and applies two gates from
abstain-rag:
floor: the best section must score at least 0.711, the 95th percentile of scores for "word salad" probes built from real FAR words (questions that look like the FAR but ask nothing);
margin: the best section must beat the mean of the next nine by at least 0.0086.
If either fails, answer_allowed is false.
Repository map
Path | What it does |
| SAM.gov API client: key from Keychain or env, response cache, daily call budget |
| CSV extract, merge with API data, keep open notices, remove duplicates, save |
|
|
|
|
|
|
|
|
| the four tools with input checks, shared by MCP and the agent |
| MCP server over stdio (official Python SDK) |
| Ollama interface, offline fakes, tool-calling loop, brief writer |
| evaluation runner and cases |
| project page |
| step-by-step guide with check-yourself questions |
| 78 tests; no network, no model |
Settings
Variable | Default | Meaning |
| Keychain | SAM.gov API key, if not in the Keychain |
|
| where downloads and the store live |
| none | an extra folder the tools may read profiles from |
|
| the abstain-rag checkout with the FAR index |
Tests and CI
uv run pytest -q # 78 tests; FAR tests skip if abstain-rag is missing
uv run ruff check .GitHub Actions runs ruff, pytest and the offline evals on every push, without the FAR index.
Limitations
Duplicate removal can over-merge. In 273 of 2,057 groups the titles differ. Most are amendments, but an agency that reuses one solicitation number for different work keeps only the newest notice.
Search is keyword-based. Boilerplate clauses in descriptions (e.g. cybersecurity requirements on a parts order) can match; ranking by fit score pushes those down but does not remove them.
Fit weights are judgment calls, documented in
scoring.py, not learned from bid outcomes.The evals are small (19 cases) and grade tool names, not arguments.
The model-written summary can be wrong. Check it against the tables.
Not legal or bidding advice: the FAR tool returns sections to read, not interpretations.
Contributing and security
See CONTRIBUTING.md and SECURITY.md. Changes are listed in CHANGELOG.md.
License
MIT © 2026 Trivikram Sridevi
Data
SAM.gov contract opportunities (public, U.S. General Services Administration): https://sam.gov · FAR: https://www.acquisition.gov/browse/index/far
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP access to the U.S. federal procurement graph: contracts, opportunities, entities, and more.
Federal+SLED govcon MCP: SAM, USASpending, recompete, hearings, policy intel, search. Private AI.
Search, quote and link U.S. federal procurement regulations from official sources.
Search U.S. federal contract opportunities (RFPs, bids, awards) from SAM.gov official data.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to search federal contracts, analyze agency spending, track competitor wins, and monitor small business set-aside opportunities using SAM.gov, USASpending.gov, and FPDS data.1-
- AlicenseAqualityDmaintenanceMCP server for querying SAM.gov federal contract opportunities, providing precise search, retrieval, and attachment tools with full source traceability and explicit abstention when data is absent.5MIT
- AlicenseBqualityAmaintenanceEnables searching and filtering federal contract opportunities by keyword, agency, set-aside, NAICS, and more from any MCP client. Analyzes solicitations for small-business fit and risk, and provides reference lookups for NAICS codes, set-asides, and federal thresholds.9MIT
- FlicenseNot gradedqualityBmaintenanceEnables MCP clients to search and retrieve contract intelligence over public contract data, with agent skills for precedent lookup, negotiation checks, and risk flagging, all with verification and citations.-