The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Grantsgov MCP Server listing page.
Search Grants.gov federal funding opportunities, read full records (eligibility, awards, deadlines, attachments), and decode filter codes via MCP. STDIO or Streamable HTTP.
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.
| Tool | Description |
|---|---|
grantsgov_search_opportunities | Search opportunities by keyword and filters; each row leads with its close date and days left, plus facet counts for narrowing |
grantsgov_get_opportunity | Read full records for up to 5 opportunities by numeric id or opportunity number |
grantsgov_list_reference | List the codes the search filters take (agencies, applicant types, funding categories and instruments), plus statuses, sort options, and keyword syntax |
grantsgov_search_opportunities toolkeyword, statuses (default forecasted and posted), 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_dayseligibilities also matches opportunities open to any applicant type (code 99) unless include_unrestricted is falseOR, quote phrases, exclude with NOT or -term, and use a trailing * for prefixes. An ungrouped AND/OR mix or a field prefix (agency:NSF) fails as invalid_keywordclosing_within_days (0–365) scans posted opportunities by close date; it allows only the posted status and the close_date_asc sort, and posted_within_days rejects closed and archived (filter_conflict)next_offset; effective_keyword and applied_filters echo what was sent, and include_facets: false drops the facet countsclose_date_kind (fixed, none_listed, placeholder) and days_until_close, but no award amounts. Unknown codes fail as unknown_agency, unknown_eligibility, or unknown_funding_categorygrantsgov_get_opportunity toolopportunity_ids and opportunity_numbers; numbers resolve across all four statusesunresolved[] as not_found or ambiguous (with candidates), not as an errorclose_date_is_estimate), award ceiling and floor, total funding, expected awards, cost sharing, applicant types with the eligibility narrative, assistance listings, and the agency contactdoc_type, named in money_source; forecasts add forecast_estimates*_truncated); attachments 30 (each with a download_url), application packages 10, and related opportunities 10, each list with its total countgrantsgov_list_reference tooltopic: agencies, eligibilities, funding_categories, funding_instruments, statuses, sort_options, or keyword_syntaxsnapshot_date, with open_count (forecasted and posted) and total_count per code (statuses carries total_count only); sort_options and keyword_syntax are staticagencies lists the top level by default; parent_code lists every code under one agency, and name_contains matches labels and codes on any topic (for agencies, at every level)parent_code with another topic fails as filter_not_applicable; an unknown code fails as unknown_parent_codeBuilt 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:
search2, fetchOpportunity), with retries and at most 4 concurrent upstream requests per processAND, 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 vocabularyplaceholder rather than reported as deadlinescontent[], multi-line agency text renders as blockquotes and inline text is flattened to one lineAgent-friendly output:
effective_keyword and applied_filters, including defaulted statuses, the expanded agency filter, and the added code 99close_date_kind, doc_type, money_source, and unresolved[].outcome let callers branch on dataupstream_unavailable, rate_limited, and upstream_route_unavailable for Grants.gov outagesAdd the following to your MCP client configuration file. No API key is needed.
Or with npx (no Bun required):
Or with Docker:
For Streamable HTTP, set the transport and start the server:
api.grants.gov. No account or API key is required.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 |
|---|---|---|
MCP_TRANSPORT_TYPE | Transport: stdio or http. | stdio |
MCP_HTTP_PORT | HTTP server port. | 3010 |
MCP_SESSION_MODE | HTTP session mode: stateless, stateful, or auto. .env.example and the Docker image set stateless. | auto |
MCP_AUTH_MODE | Authentication: none, jwt, or oauth. | none |
MCP_LOG_LEVEL | Log level (debug, info, warning, error, etc.). | info |
LOGS_DIR | Directory for log files (Node.js only). | <app-root>/logs |
STORAGE_PROVIDER_TYPE | Storage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1. | in-memory |
OTEL_ENABLED | Enable OpenTelemetry. | false |
See .env.example for the full list of optional overrides.
Build and run the production version:
Run checks and tests:
The 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.
| Directory | Purpose |
|---|---|
src/index.ts | createApp() entry point: registers the tools and starts and disposes the Grants.gov service. |
src/mcp-server/tools/definitions | Tool definitions (*.tool.ts). |
src/mcp-server/tools | Shared input schemas (input-schemas.ts) and format() rendering helpers (render.ts). |
src/services/grants-gov | Grants.gov API client, keyword compiler, reference snapshot, date and money normalization, HTML-to-text. |
tests/ | Unit and tool tests mirroring src/, with trimmed Grants.gov response fixtures. |
docs/design.md | Design notes: probed API behavior and the decisions behind the tool surface. |
See CLAUDE.md for development guidelines and architectural rules. The short version:
try/catch in tool logicctx.log for logging and ctx.fail with the tool's declared error reasonssrc/mcp-server/tools/definitions/index.tsIssues are welcome. Run checks and tests before submitting:
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.
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.