grantsgov-mcp-server
This server has a remotely hosted endpoint. Open its connector listing for connection details, authentication requirements, and setup instructions:
Public Hosted Server: https://grantsgov.caseyjhand.com/mcp
Overview
US federal funding opportunities from Grants.gov, covering every agency's forecasted, posted, closed, and archived notices. Search by keyword, agency, applicant type, funding category, assistance listing, or deadline window, then read a full record: award range, eligibility, key dates, agency contact, and NOFO attachments. No API key required.
Tools
Tool | Description |
| Search opportunities by keyword and filters; each row leads with its close date and days left, plus facet counts for narrowing |
| Read full records for up to 5 opportunities by numeric id or opportunity number |
| List the codes the search filters take (agencies, applicant types, funding categories and instruments), plus statuses, sort options, and keyword syntax |
The grantsgov-guide skill covers funding shortlists, eligibility and deadline review, and application requirements. It ships with the package and plugins and is available over MCP as skill://grantsgov-guide/SKILL.md.
Related MCP server: ca-grants
Capability reference
grantsgov_search_opportunities tool
Filters:
keyword,statuses(defaultforecastedandposted),agencies(a code includes its sub-agencies),eligibilities,funding_categories,funding_instruments,assistance_listing(one ALN),opportunity_number(exact match),posted_within_days,closing_within_dayseligibilitiesalso matches opportunities open to any applicant type (code99) unlessinclude_unrestrictedisfalseKeyword terms are all required; join alternatives with
OR, quote phrases, exclude withNOTor-term, and use a trailing*for prefixes. An ungrouped AND/OR mix or a field prefix (agency:NSF) fails asinvalid_keywordclosing_within_days(0–365) scans posted opportunities by close date; it allows only thepostedstatus and theclose_date_ascsort, andposted_within_daysrejectsclosedandarchived(filter_conflict).total_count_kinddistinguishes exact counts from lower bounds when the scan is incomplete;next_offsetreaches only remaining scanned matchesUp to 100 rows per page (default 25);
limitaccepts 1–1,000 and values above 100 are capped with a notice. Offset paging usesnext_offset;effective_keywordandapplied_filtersecho what was sent. Sub-agency facets count each subtree under the current upstream query;include_facets: falsedrops the facet countsRows carry
close_date_kind(fixed,none_listed,placeholder) anddays_until_close, but no award amounts. Unknown codes fail asunknown_agency,unknown_eligibility, orunknown_funding_category
grantsgov_get_opportunity tool
Accept up to 50 nonblank entries per identifier list and 50 normalized unique identifiers combined. Read the first 5 identifiers, ids before numbers;
deferred_ids,deferred_numbers, and an executablecontinuationcarry the remaining queue with the original section offsets. Numbers resolve across all four statuses; selected aliases fetch a record once per callA miss or a number shared by several opportunities comes back in
unresolved[]asnot_foundorambiguous(withcandidates), not as an errorRecords carry the close date (an estimate on forecasts, flagged by
close_date_is_estimate), award ceiling and floor, total funding, expected awards, cost sharing, applicant types with the eligibility narrative, assistance listings, and the agency contactFunding and eligibility fields come from the synopsis or forecast block matching
doc_type, named inmoney_source; forecasts addforecast_estimatesIndependent pages: description 12,000 characters, eligibility narrative 6,000, funding-category explanation 2,000, attachments 30, application packages 10, and related opportunities 10. The six zero-based inputs are
description_offset,eligibility_offset,funding_category_explanation_offset,attachment_offset,application_package_offset, andrelated_opportunity_offset(default 0). Each record'spagessupplies full totals and executable single-opportunity continuations; partial narratives retain*_truncated, and past-end pages are empty. Attachments includedownload_urland the unchanged upstreamcreated_datewhen listedlast_revision_noteandlast_revision_changedsummarize the active synopsis or forecast's latest revision when listed. Changed names map to public fields; unknown names keep anupstream:prefix. Missing metadata does not mean nothing changed
grantsgov_list_reference tool
topic:agencies,eligibilities,funding_categories,funding_instruments,statuses,sort_options, orkeyword_syntaxCodes come from a live Grants.gov snapshot, cached for 24 hours and dated by
snapshot_date, withopen_count(forecasted and posted) andtotal_countper code (statusescarriestotal_countonly);sort_optionsandkeyword_syntaxare staticUp to 100 entries per page (default 50);
limitaccepts 1–1,000 and values above 100 are capped with a notice. Filters apply before paging;continuationpreserves the complete next-call argumentsA failed refresh can serve expired data with
reference_cachedisclosing stale status, the failure reason, and retry time. Searches using that vocabulary disclose the same degradation and snapshot timestampagencieslists the top level by default;parent_codelists every code under one agency, andname_containsmatches labels and codes on any topic (for agencies, at every level)parent_codewith another topic fails asfilter_not_applicable; an unknown code fails asunknown_parent_code
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
Grants.gov-specific:
List inputs accept one whole string or an array; blank values and members read as unset. Strings are never split on commas, spaces, or line breaks
Keyless client for the Grants.gov REST API (
search2,fetchOpportunity), with retries and at most 4 concurrent upstream requests per processInputs mapped to the form Grants.gov reads as intended: bare keyword terms joined with
AND, hyphenated tokens (COVID-19,K-12) matched as phrases, agency codes expanded to their sub-agency subtree, opportunity numbers matched literally, and filter codes checked against the live vocabularyDeadlines counted from today in US Eastern Time, the zone Grants.gov publishes in; far-future stand-in close dates are flagged
placeholderrather than reported as deadlinesHTML5 entities decoded in human-readable fields; narrative HTML converted to plain text with table cell and row boundaries preserved. In
content[], agency prose renders as literal text, identifiers retain code styling, multi-line fields render as blockquotes, and inline text is flattened to one line
Agent-friendly output:
Echo of what ran:
effective_keywordandapplied_filters, including defaulted statuses, the expanded agency filter, and the added code99Discriminated fields:
close_date_kind,doc_type,money_source, andunresolved[].outcomelet callers branch on dataEmpty-result and paging notices that name the next call, such as counts of closed and archived matches when the default statuses found nothing, or the next close date when a closing window is empty
Typed failure reasons with recovery hints, including
upstream_unavailable,rate_limited, andupstream_route_unavailablefor Grants.gov outages
Getting started
Connect to the hosted instance, no install:
claude mcp add --transport http grantsgov-mcp-server https://grantsgov.caseyjhand.com/mcpOr run it locally:
claude mcp add grantsgov-mcp-server -- npx -y @cyanheads/grantsgov-mcp-serverFor other clients, add this to the MCP config file:
{
"mcpServers": {
"grantsgov-mcp-server": {
"command": "npx",
"args": ["-y", "@cyanheads/grantsgov-mcp-server"]
}
}
}No API key is required. For Docker or a source build, see Running the server.
Configuration
The server reads no configuration of its own: the Grants.gov API is keyless and its endpoints are fixed. These framework variables control transport, auth, and logging.
Variable | Description | Default |
| Transport: |
|
| HTTP server port. |
|
| HTTP session mode: |
|
| Authentication: |
|
| Log level ( |
|
| Directory for log files (Node.js only). |
|
| Storage backend: |
|
| Enable OpenTelemetry. |
|
See .env.example for the full list of optional overrides.
Running the server
Local development
Requires Bun v1.4.0 or higher (or Node.js v24+) and network access to api.grants.gov.
Clone and install:
git clone https://github.com/cyanheads/grantsgov-mcp-server.git cd grantsgov-mcp-server && bun install cp .env.example .env # optional framework overridesBuild and run the production version:
# One-time build bun run rebuild # Run the built server bun run start:http # or bun run start:stdioRun checks and tests:
bun run devcheck # Lints, formats, type-checks, and more bun run test # Runs the test suite
Docker
docker run --rm -p 3010:3010 ghcr.io/cyanheads/grantsgov-mcp-server:latestThe image defaults to HTTP transport, stateless session mode, and logs to /var/log/grantsgov-mcp-server. To run over stdio from an MCP client, use "command": "docker" with "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/grantsgov-mcp-server:latest"]. To build locally, docker build -t grantsgov-mcp-server .; OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
Directory | Purpose |
|
|
| Tool definitions ( |
| Shared input schemas ( |
| Grants.gov API client, keyword compiler, reference snapshot, date and money normalization, HTML-to-text. |
| Unit and tool tests mirroring |
| Published guidance for agents reviewing federal funding opportunities. |
| Design notes: probed API behavior and the decisions behind the tool surface. |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor logging andctx.failwith the tool's declared error reasonsRegister new tools in
src/mcp-server/tools/definitions/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testData source
Opportunity data comes from Grants.gov, where federal agencies post their funding opportunities. The records are US government works. This project is not affiliated with or endorsed by Grants.gov or any federal agency.
License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
Search open and upcoming US federal grant opportunities on Grants.gov and get full grant details.
Searches live federal grant listings on Grants.gov and reads full opportunity details.
Search US grants + federal contracts (Grants.gov + SAM.gov) from any LLM.
U.S. federal grant discovery, details, fit scoring, briefs, and shortlist checks via x402.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceProvides access to open federal grant opportunities from Grants.gov without authentication. Enables querying and exploring grant data through natural language via Pipeworx gateway.460 npm1MIT
- AlicenseNot gradedqualityBmaintenanceEnables searching and retrieving California state grant opportunities, including filters by status, category, and agency, without requiring an API key.228 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables searching and analyzing Australian Commonwealth grant opportunities and awarded grants from grants.gov.au, including recipient lookups and coverage checks.487 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables asking questions in natural language about live grants.gov funding opportunities, with tools to find, filter, check eligibility, track deadlines, and rank matches—while refusing to guess when data is unavailable.1MIT