grantsgov-mcp-server
Click on "Deploy 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., "@grantsgov-mcp-serversearch for open grants related to clean energy"
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.
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. The Grants.gov API is keyless, so there is nothing to configure; the server runs as a stdio process or a local Streamable HTTP server.
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 |
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)Up to 100 rows per page (default 25) with offset paging via
next_offset;effective_keywordandapplied_filtersecho what was sent, andinclude_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
Up to 5 opportunities per call across
opportunity_idsandopportunity_numbers; numbers resolve across all four statusesA 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_estimatesCaps: description 12,000 characters and eligibility narrative 6,000 (cut text is flagged
*_truncated); attachments 30 (each with adownload_url), application packages 10, and related opportunities 10, each list with its total count
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 staticagencieslists 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:
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 deadlinesAgency HTML converted to plain text; in
content[], multi-line agency text renders 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
Add the following to your MCP client configuration file. No API key is needed.
{
"mcpServers": {
"grantsgov-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/grantsgov-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with npx (no Bun required):
{
"mcpServers": {
"grantsgov-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/grantsgov-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with Docker:
{
"mcpServers": {
"grantsgov-mcp-server": {
"type": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/grantsgov-mcp-server:latest"]
}
}
}For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcpPrerequisites
Bun v1.4.0 or higher (or Node.js v24+).
Network access to
api.grants.gov. No account or API key is required.
Installation
Clone the repository:
git clone https://github.com/cyanheads/grantsgov-mcp-server.gitNavigate into the directory:
cd grantsgov-mcp-serverInstall dependencies:
bun installConfigure environment (optional):
cp .env.example .env
# every variable is optional; the server has no settings of its ownConfiguration
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
Build 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 build -t grantsgov-mcp-server .
docker run --rm -p 3010:3010 grantsgov-mcp-serverThe Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/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 |
| 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 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.
Search verified-open US grants (federal, state, foundation). Read-only MCP for AI agents.
Find US federal grants your organization is actually eligible to apply for. Free, no API key.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides access to open federal grant opportunities from Grants.gov without authentication. Enables querying and exploring grant data through natural language via Pipeworx gateway.1 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables searching and retrieving California state grant opportunities, including filters by status, category, and agency, without requiring an API key.3 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables searching and analyzing Australian Commonwealth grant opportunities and awarded grants from grants.gov.au, including recipient lookups and coverage checks.2 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.MIT