Grantsgov Mcp Server

io.github.cyanheads由 GitHub 帳號 cyanheads 發布v0.2.0更新於 Oct 26, 2026

Search Grants.gov funding opportunities and read full records: eligibility, awards, deadlines.

已驗證Streamable HTTP可網頁執行網頁搜尋與抓取商業與電商

概覽

AI 產生的概覽

搜尋 Grants.gov 聯邦補助機會並讀取完整紀錄(資格、補助金額區間、截止日期、附件),無需 API 金鑰。

可以做什麼
  • 依關鍵字、機關、申請者資格、補助類別、補助工具、援助編號或截止時間範圍搜尋聯邦補助機會
  • 讀取完整機會紀錄(每次最多 5 筆),含補助上下限、資格說明、關鍵日期、機關聯絡人、附件與申請包
  • 依分節位移翻頁檢視較長的說明、資格敘述與附件清單
  • 列出 Grants.gov 搜尋篩選可用的代碼——機關與子機關、資格類型、補助類別、補助工具、狀態、排序選項與關鍵字語法——並附即時機會數量
適用情境
適合協助美國聯邦補助研究的場合:整理補助候選清單、確認機構是否符合申請資格、比較截止日期與補助規模,或從 NOFO 附件蒐集申請要求。
執行需求
可使用託管的 Streamable HTTP 端點,或透過 npx(Node.js)、Bun、Docker 在本機執行。需要能連線 Grants.gov API 的網路。無需 API 金鑰或帳號。選用的框架變數可控制傳輸方式、驗證模式、HTTP 主機/連接埠/路徑、日誌等級與公開 URL。
安裝前請注意
唯讀:工具僅搜尋與讀取 Grants.gov 公開資料,不會送出或變更任何內容。機會資料會與 Grants.gov 往返傳輸,託管端點也能看到你的查詢。紀錄僅供參考,本專案與 Grants.gov 無隸屬關係,申請前請在官方網站確認截止日期與資格。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Grantsgov Mcp Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.cyanheads%2Fgrantsgov-mcp-server/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "grantsgov": {
      "type": "http",
      "url": "https://grantsgov.caseyjhand.com/mcp"
    }
  }
}

README

@cyanheads/grantsgov-mcp-server

Search Grants.gov federal funding opportunities, read full records (eligibility, awards, deadlines, attachments), and decode filter codes via MCP. STDIO or Streamable HTTP.

3 Tools

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

ToolDescription
grantsgov_search_opportunitiesSearch opportunities by keyword and filters; each row leads with its close date and days left, plus facet counts for narrowing
grantsgov_get_opportunityRead full records for up to 5 opportunities by numeric id or opportunity number
grantsgov_list_referenceList 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.

Capability reference

grantsgov_search_opportunities tool

  • Filters: keyword, 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_days
  • eligibilities also matches opportunities open to any applicant type (code 99) unless include_unrestricted is false
  • Keyword terms are all required; join alternatives with OR, 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_keyword
  • closing_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). total_count_kind distinguishes exact counts from lower bounds when the scan is incomplete; next_offset reaches only remaining scanned matches
  • Up to 100 rows per page (default 25); limit accepts 1–1,000 and values above 100 are capped with a notice. Offset paging uses next_offset; effective_keyword and applied_filters echo what was sent. Sub-agency facets count each subtree under the current upstream query; include_facets: false drops the facet counts
  • Rows carry close_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_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 executable continuation carry the remaining queue with the original section offsets. Numbers resolve across all four statuses; selected aliases fetch a record once per call
  • A miss or a number shared by several opportunities comes back in unresolved[] as not_found or ambiguous (with candidates), not as an error
  • Records 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 contact
  • Funding and eligibility fields come from the synopsis or forecast block matching doc_type, named in money_source; forecasts add forecast_estimates
  • Independent 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, and related_opportunity_offset (default 0). Each record's pages supplies full totals and executable single-opportunity continuations; partial narratives retain *_truncated, and past-end pages are empty. Attachments include download_url and the unchanged upstream created_date when listed
  • last_revision_note and last_revision_changed summarize the active synopsis or forecast's latest revision when listed. Changed names map to public fields; unknown names keep an upstream: prefix. Missing metadata does not mean nothing changed

grantsgov_list_reference tool

  • topic: agencies, eligibilities, funding_categories, funding_instruments, statuses, sort_options, or keyword_syntax
  • Codes come from a live Grants.gov snapshot, cached for 24 hours and dated by snapshot_date, with open_count (forecasted and posted) and total_count per code (statuses carries total_count only); sort_options and keyword_syntax are static
  • Up to 100 entries per page (default 50); limit accepts 1–1,000 and values above 100 are capped with a notice. Filters apply before paging; continuation preserves the complete next-call arguments
  • A failed refresh can serve expired data with reference_cache disclosing stale status, the failure reason, and retry time. Searches using that vocabulary disclose the same degradation and snapshot timestamp
  • agencies 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_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 process
  • Inputs 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 vocabulary
  • Deadlines counted from today in US Eastern Time, the zone Grants.gov publishes in; far-future stand-in close dates are flagged placeholder rather than reported as deadlines
  • HTML5 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_keyword and applied_filters, including defaulted statuses, the expanded agency filter, and the added code 99
  • Discriminated fields: close_date_kind, doc_type, money_source, and unresolved[].outcome let callers branch on data
  • Empty-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, and upstream_route_unavailable for Grants.gov outages

Getting started

Connect to the hosted instance, no install:

sh
claude mcp add --transport http grantsgov-mcp-server https://grantsgov.caseyjhand.com/mcp

Or run it locally:

sh
claude mcp add grantsgov-mcp-server -- npx -y @cyanheads/grantsgov-mcp-server

For other clients, add this to the MCP config file:

json
{  "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.

VariableDescriptionDefault
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_PORTHTTP server port.3010
MCP_SESSION_MODEHTTP session mode: stateless, stateful, or auto. The server declares stateless; set this only to override it.stateless
MCP_AUTH_MODEAuthentication: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (debug, info, warning, error, etc.).info
LOGS_DIRDirectory for log files (Node.js only).<app-root>/logs
STORAGE_PROVIDER_TYPEStorage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1.in-memory
OTEL_ENABLEDEnable OpenTelemetry.false

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:

    sh
    git clone https://github.com/cyanheads/grantsgov-mcp-server.gitcd grantsgov-mcp-server && bun installcp .env.example .env   # optional framework overrides
  • Build and run the production version:

    sh
    # One-time buildbun run rebuild
    # Run the built serverbun run start:http# orbun run start:stdio
  • Run checks and tests:

    sh
    bun run devcheck  # Lints, formats, type-checks, and morebun run test      # Runs the test suite

Docker

sh
docker run --rm -p 3010:3010 ghcr.io/cyanheads/grantsgov-mcp-server:latest

The 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

DirectoryPurpose
src/index.tscreateApp() entry point: registers the tools and published skill, and starts and disposes the Grants.gov service.
src/mcp-server/tools/definitionsTool definitions (*.tool.ts).
src/mcp-server/toolsShared input schemas (input-schemas.ts) and format() rendering helpers (render.ts).
src/services/grants-govGrants.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.
skills/Published guidance for agents reviewing federal funding opportunities.
docs/design.mdDesign 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/catch in tool logic
  • Use ctx.log for logging and ctx.fail with the tool's declared error reasons
  • Register new tools in src/mcp-server/tools/definitions/index.ts
  • Wrap 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:

sh
bun run devcheckbun run test

Data 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.

來源:README.md,提交 6612321

工具

3

grantsgov_search_opportunities

Search Grants.gov Opportunities

Search federal funding opportunities on Grants.gov by keyword, agency, applicant eligibility, funding category, funding instrument, assistance listing, opportunity number, posting window (posted_within_days), or closing window (closing_within_days). Returns forecasted and posted opportunities unless statuses says otherwise, each row led by its close date and days remaining, plus facet counts for narrowing. Bare keyword terms are all required; join alternatives with OR, in parentheses when other terms stay required. Rows carry no award amounts or eligibility detail; read those with grantsgov_get_opportunity. Filter codes come from grantsgov_list_reference.

輸入參數sortlimitoffsetkeywordagenciesstatuseseligibilitiesinclude_facetsassistance_listingfunding_categoriesopportunity_numberposted_within_days另有 3 個

grantsgov_get_opportunity

Get Grants.gov Opportunity

Read the Grants.gov record for up to 5 opportunities, given numeric opportunity ids or opportunity numbers: deadline, funding, eligibility, description, assistance listings, contact, attachments, packages, and latest revision metadata. Lists and narratives are bounded independent pages; follow each record pages continuation to retrieve the remaining section. An opportunity number is resolved across all statuses. A miss or an ambiguous number comes back as an unresolved entry with guidance, not an error.

輸入參數opportunity_idsattachment_offsetdescription_offseteligibility_offsetopportunity_numbersapplication_package_offsetrelated_opportunity_offsetfunding_category_explanation_offset

grantsgov_list_reference

List Grants.gov Reference Codes

List the codes Grants.gov search filters accept, with labels and live opportunity counts: agencies (top level, or one agency's sub-agencies via parent_code, or matched by name via name_contains), applicant eligibility types, funding categories, funding instruments, statuses, sort options, and keyword syntax. Use the codes as grantsgov_search_opportunities inputs.

輸入參數limittopic必填offsetparent_codename_contains

版本歷史

4
  1. v0.2.0最新Oct 26, 2026
  2. v0.1.3Oct 18, 2026
  3. v0.1.2Oct 8, 2026
  4. v0.1.1Sep 24, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分