{"id":51013933,"url":"https://github.com/bch1212/mcp-grantiq","last_synced_at":"2026-06-21T07:31:32.257Z","repository":{"id":356810319,"uuid":"1233989884","full_name":"bch1212/mcp-grantiq","owner":"bch1212","description":"Paid MCP server exposing US federal grants and contracts to AI agents","archived":false,"fork":false,"pushed_at":"2026-05-09T20:31:46.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-09T22:26:19.416Z","etag":null,"topics":["ai-agents","claude","fastapi","fastmcp","grants","grants-gov","mcp","mcp-server","model-context-protocol","sam-gov"],"latest_commit_sha":null,"homepage":"https://mcp.grantiq.us","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bch1212.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-09T15:54:48.000Z","updated_at":"2026-05-09T20:31:49.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bch1212/mcp-grantiq","commit_stats":null,"previous_names":["bch1212/mcp-grantiq"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bch1212/mcp-grantiq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bch1212%2Fmcp-grantiq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bch1212%2Fmcp-grantiq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bch1212%2Fmcp-grantiq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bch1212%2Fmcp-grantiq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bch1212","download_url":"https://codeload.github.com/bch1212/mcp-grantiq/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bch1212%2Fmcp-grantiq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34601660,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","claude","fastapi","fastmcp","grants","grants-gov","mcp","mcp-server","model-context-protocol","sam-gov"],"created_at":"2026-06-21T07:31:31.672Z","updated_at":"2026-06-21T07:31:32.252Z","avatar_url":"https://github.com/bch1212.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GrantIQ MCP\n\n**A paid MCP server that gives AI agents instant, structured access to every open US federal grant and contract opportunity.** Backed by Grants.gov + SAM.gov, with 24-hour SQLite caching, per-key daily limits, and a Stripe-friendly upgrade hook.\n\n`https://mcp-grantiq.up.railway.app/mcp`\n\n---\n\n## MCPize listing copy\n\n**Title:** GrantIQ MCP — US Federal Grants \u0026 Contracts for AI Agents\n\n**Subtitle:** Search, match, and monitor every open SAM.gov and Grants.gov opportunity from any LLM, in one tool call.\n\nGrantIQ MCP turns the messy world of US government funding into a clean, agent-ready API. Eight typed tools cover everything from broad keyword search and NAICS-coded contract discovery to deadline radar and historical award lookups. Responses are normalized across both data sources, returned as plain JSON, and cached for 24 hours so repeat queries don't burn rate limit on the upstream agencies.\n\nBuilt for procurement copilots, grant-finder agents, and B2G sales tools, GrantIQ MCP ships with a free tier (50 calls/day) that any developer can drop into Claude or Cursor in 15 seconds. Upgrade to Pro for $19/mo for unlimited calls, or pay $0.02 per call for bursty workloads — billing flips a key from free to pro via a single webhook, with no app rewrites required.\n\n---\n\n## Pricing\n\n| Tier | Price | Limit |\n| --- | --- | --- |\n| Free | $0 | 50 calls / day / key |\n| Pro | **$19 / month** | Unlimited |\n| Pay-as-you-go | **$0.02 / call** | Unlimited |\n\n---\n\n## Install\n\n```bash\nclaude mcp add grantiq-mcp --url https://mcp-grantiq.up.railway.app/mcp\n```\n\nThen add the API key Claude should use:\n\n```bash\nclaude mcp env grantiq-mcp X-API-Key=grantiq-dev-key-001\n```\n\nThe dev key `grantiq-dev-key-001` is seeded automatically and capped at 50 calls/day. Mint your own with the admin endpoint below.\n\n---\n\n## Tool reference\n\n| Tool | Args | Returns |\n| --- | --- | --- |\n| `search_grants` | `keyword`, `agency`, `amount_min`, `amount_max`, `status`, `limit` | List of matching grants |\n| `get_grant_details` | `opportunity_id` | Full grant object |\n| `search_contracts` | `keyword`, `naics_code`, `agency`, `set_aside`, `limit` | List of SAM contracts |\n| `get_contract_details` | `notice_id` | Full contract object |\n| `match_opportunities` | `org_description`, `org_type`, `focus_areas` | Top 10 matched opps (grants + contracts) |\n| `get_agencies` | `type` (`grants` / `contracts` / `both`) | Agencies with open opps, ranked by volume |\n| `get_deadlines` | `days_ahead` | Opportunities closing within N days |\n| `search_awards` | `recipient_name`, `agency`, `year` | Past SAM award history |\n\nEvery tool returns either:\n\n```json\n{ \"success\": true,  \"cached\": false, \"data\": { ... } }\n```\n\nor, on failure:\n\n```json\n{ \"success\": false, \"error\": \"...\" }\n```\n\nWhen the daily limit is hit, the HTTP layer returns **429** with body:\n\n```json\n{ \"error\": \"Limit reached. Upgrade at mcpize.com/grantiq-mcp\" }\n```\n\n---\n\n## curl examples\n\nThe MCP endpoint speaks the JSON-RPC streamable-HTTP protocol and is best used through an MCP client. For convenience, every tool also has a REST mirror at `/tools/\u003ctool\u003e`.\n\n```bash\n# Search grants\ncurl -s https://mcp-grantiq.up.railway.app/tools/search_grants \\\n  -H 'Content-Type: application/json' \\\n  -H 'X-API-Key: grantiq-dev-key-001' \\\n  -d '{\"keyword\":\"renewable energy\",\"limit\":5}'\n\n# Get grant details\ncurl -s https://mcp-grantiq.up.railway.app/tools/get_grant_details \\\n  -H 'Content-Type: application/json' \\\n  -H 'X-API-Key: grantiq-dev-key-001' \\\n  -d '{\"opportunity_id\":\"345678\"}'\n\n# Search SAM.gov contracts (cyber, small-business set-aside)\ncurl -s https://mcp-grantiq.up.railway.app/tools/search_contracts \\\n  -H 'Content-Type: application/json' \\\n  -H 'X-API-Key: grantiq-dev-key-001' \\\n  -d '{\"keyword\":\"cybersecurity\",\"set_aside\":\"SBA\",\"limit\":5}'\n\n# Get contract details\ncurl -s https://mcp-grantiq.up.railway.app/tools/get_contract_details \\\n  -H 'Content-Type: application/json' \\\n  -H 'X-API-Key: grantiq-dev-key-001' \\\n  -d '{\"notice_id\":\"abc123\"}'\n\n# Match opportunities to an org profile\ncurl -s https://mcp-grantiq.up.railway.app/tools/match_opportunities \\\n  -H 'Content-Type: application/json' \\\n  -H 'X-API-Key: grantiq-dev-key-001' \\\n  -d '{\"org_description\":\"Battery storage R\u0026D startup\",\"org_type\":\"for-profit\",\"focus_areas\":[\"energy\",\"battery\",\"storage\"]}'\n\n# Top agencies right now\ncurl -s https://mcp-grantiq.up.railway.app/tools/get_agencies \\\n  -H 'Content-Type: application/json' \\\n  -H 'X-API-Key: grantiq-dev-key-001' \\\n  -d '{\"type\":\"both\"}'\n\n# Deadlines in the next 14 days\ncurl -s https://mcp-grantiq.up.railway.app/tools/get_deadlines \\\n  -H 'Content-Type: application/json' \\\n  -H 'X-API-Key: grantiq-dev-key-001' \\\n  -d '{\"days_ahead\":14}'\n\n# Past award history\ncurl -s https://mcp-grantiq.up.railway.app/tools/search_awards \\\n  -H 'Content-Type: application/json' \\\n  -H 'X-API-Key: grantiq-dev-key-001' \\\n  -d '{\"recipient_name\":\"Acme Corp\",\"year\":2025}'\n```\n\n---\n\n## Operator endpoints\n\nMint a fresh key (free or pro):\n\n```bash\ncurl -s https://mcp-grantiq.up.railway.app/admin/keys \\\n  -H 'X-Admin-Token: $GRANTIQ_ADMIN_TOKEN' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"tier\":\"free\",\"daily_limit\":50}'\n```\n\nPromote a free key to pro (called from the Stripe checkout success webhook):\n\n```bash\ncurl -s https://mcp-grantiq.up.railway.app/billing/upgrade \\\n  -H 'X-Admin-Token: $GRANTIQ_ADMIN_TOKEN' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"key\":\"grantiq_xxxxx\"}'\n```\n\n---\n\n## Local dev\n\n```bash\npython -m venv .venv \u0026\u0026 source .venv/bin/activate\npip install -r requirements.txt\ncp .env.example .env\npython server.py        # http://localhost:8000\npytest -v               # 22 tests, hermetic with respx mocks\n```\n\n---\n\n## Deploy to Railway\n\nThe repo includes `nixpacks.toml`. After `railway init`, just `railway up`. The start command is `python server.py` (not `uvicorn ...`) because Railway exec's `[start].cmd` without a shell — server.py reads `$PORT` via `os.getenv` and starts uvicorn programmatically.\n\nSet these on the Railway service:\n\n- `SAM_API_KEY` — your SAM.gov key\n- `GRANTIQ_ADMIN_TOKEN` — long random string\n- `GRANTIQ_DB_PATH` — `/data/grantiq.db` if you mount a Volume (recommended so cache + keys survive deploys)\n\nA ready-to-run `deploy.sh` is in this directory.\n\n---\n\n## Caveats\n\n- **SAM.gov award history** is exposed via the opportunities API filtered to `ptype=a` (Award Notice). For deeper award analytics (CFDA-level totals, recipient rollups), USAspending.gov is more appropriate and would be a v2 add.\n- **Cache TTL is global** (24h). For deadline-sensitive flows the agent should pass distinct query args or call `/admin/keys` to mint a key that bypasses cache (not yet exposed — see TODO).\n- **Match scoring** is deterministic Jaccard over title + agency tokens. It's fast and free; an LLM rerank can be added behind the same interface.\n- **Stripe wiring** is one-way (`/billing/upgrade`). The MCP server doesn't host the checkout page itself — that lives on the marketing site.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbch1212%2Fmcp-grantiq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbch1212%2Fmcp-grantiq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbch1212%2Fmcp-grantiq/lists"}