The Grants Search MCP Server allows users to search for government grants via keywords and paginate results.
Search for grants: Query government grants by keywords using the 'search-grants' tool
Pagination: Control results by specifying page number and grants per page
Detailed grant information: Retrieve comprehensive details about each grant, including title, funding information, eligibility, and more
API integration: Interacts with the Simpler Grants API to fetch and display grant data
Grants MCP Server
A Model Context Protocol (MCP) server for comprehensive government grants discovery and analysis, powered by the Simpler Grants API.
Overview
The Grants MCP Server is a Python-based MCP implementation using FastMCP that provides intelligent tools for discovering, analyzing, and tracking government grant opportunities. It offers multiple specialized tools for different aspects of grant research, from opportunity discovery to funding trend analysis and agency landscape mapping.
Features
🔍 Core Capabilities
- Grant Opportunity Discovery: Search and filter grants based on keywords, agencies, funding categories, and eligibility criteria
- Funding Trend Analysis: Analyze historical funding patterns and identify emerging opportunities
- Agency Landscape Mapping: Understand the grant ecosystem across different government agencies
- Intelligent Caching: Built-in caching system to optimize API calls and improve response times
- Comprehensive Grant Details: Access detailed information including funding amounts, deadlines, eligibility requirements, and contact information
🛠️ Technical Features
- Built with FastMCP for robust MCP server implementation
- Asynchronous Python architecture for high performance
- Dual Transport Support: stdio (local) and HTTP (containerized)
- Docker Support: Ready-to-deploy containerized version
- Configurable caching with TTL and size limits
- Retry logic and error handling for API resilience
- Environment-based configuration management
- Comprehensive test suite with unit, integration, and live tests
Quick Start with Docker 🐳
Prerequisites
- Docker and Docker Compose installed
- Simpler Grants API key (see Obtaining API Key)
1. Clone the Repository
2. Configure API Key
Important: You must provide your own API key. Never commit API keys to version control.
Option A - Using .env file (Recommended):
Option B - Edit docker-compose.yml directly:
3. Build and Run
4. Test the Server
5. Configure Claude Desktop
Copy the Docker configuration to Claude Desktop:
Then restart Claude Desktop to connect to your containerized MCP server.
Architecture
Deployment Options
Option 1: Docker (Recommended for Production)
The Docker deployment provides:
- Consistent environment across platforms
- Easy scaling and deployment
- Isolation from system dependencies
- Ready for cloud deployment (Google Cloud Run, AWS ECS, etc.)
Option 2: Local Python Installation
For development and testing:
Obtaining API Key
The Simpler Grants API key is required for this MCP server to function. To get your API key:
- Visit Simpler Grants API
- Sign up for an account or log in
- Navigate to your API settings/dashboard
- Generate or copy your API key
- Keep this key secure - you'll need it for configuration
Configuration
Environment Variables
Variable | Description | Default |
---|---|---|
SIMPLER_GRANTS_API_KEY | API key for Grants.gov (required) | - |
MCP_TRANSPORT | Transport mode: stdio or http | stdio |
PORT | HTTP server port (container mode) | 8080 |
LOG_LEVEL | Logging level | INFO |
CACHE_TTL | Cache time-to-live (seconds) | 300 |
MAX_CACHE_SIZE | Maximum cache entries | 1000 |
Docker Configuration
The docker-compose.yml
file includes:
- Port mapping: 8081 (host) → 8080 (container)
- Resource limits: 1 CPU, 1GB RAM
- Auto-restart policy
- Health checks with proper SSE headers
Available Tools
1. opportunity_discovery
Search for grant opportunities with detailed analysis.
Parameters:
query
: Search keywords (e.g., "renewable energy", "climate change")filters
: Advanced filter parametersmax_results
: Maximum number of results (default: 100)page
: Page number for paginationgrants_per_page
: Grants per page (default: 3)
2. agency_landscape
Map agencies and their funding focus areas.
Parameters:
include_opportunities
: Include opportunity analysis (default: true)focus_agencies
: Specific agency codes (e.g., ["NSF", "NIH"])funding_category
: Filter by categorymax_agencies
: Maximum agencies to analyze (default: 10)
3. funding_trend_scanner
Analyze funding trends and patterns.
Parameters:
time_window_days
: Analysis period (default: 90)category_filter
: Filter by categoryagency_filter
: Filter by agencymin_award_amount
: Minimum award filterinclude_forecasted
: Include forecasted opportunities (default: true)
Claude Desktop Integration
For Docker Deployment
- Ensure Docker container is running:
docker-compose up -d
- Install mcp-remote if needed:
npm install -g mcp-remote
- Copy configuration:
- Restart Claude Desktop
For Local Development
- Copy the stdio configuration:
- Update the path in the config to your local installation
- Restart Claude Desktop
Testing
Test Docker Deployment
Run Test Suite
Troubleshooting
Port Conflicts
If port 8081 is in use:
Container Issues
API Key Issues
- Ensure
SIMPLER_GRANTS_API_KEY
is set in docker-compose.yml - Check logs for authentication errors:
docker logs grants-mcp-server
- Verify API key is valid at Simpler Grants API
Cloud Deployment
The containerized version is ready for cloud deployment:
Google Cloud Run
AWS ECS / Fargate
See specs/cloud_deployment.md
for detailed AWS deployment instructions.
Development
Project Structure
src/mcp_server/
: Core server implementationscripts/
: Testing and utility scriptstests/
: Comprehensive test suitespecs/
: Technical specifications and documentationclaude_desktop_configs/
: Ready-to-use Claude Desktop configurations
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature
- Make your changes and add tests
- Ensure tests pass:
pytest
- Build and test Docker image:
docker-compose build && docker-compose up -d
- Commit with descriptive messages
- Push and create a pull request
Roadmap
- Phase 1: Python implementation with FastMCP
- Phase 2: Enhanced discovery tools
- Phase 3: Docker containerization
- Phase 4: Intelligent scoring system
- Phase 5: Cloud deployment automation
- Phase 6: Multi-agency comparison tools
- Phase 7: Grant application assistance
License
MIT License - see LICENSE file for details
Acknowledgments
- Built with FastMCP
- Powered by Simpler Grants API
- Model Context Protocol by Anthropic
Support
For issues, questions, or contributions:
- Open an issue on GitHub
- Check the Deployment Guide for detailed instructions
- Review
specs/
directory for technical documentation
Note: This is an alpha release. API and features may change. Use in production with caution.# Deployment Test
Service accounts and permissions are now properly configured!
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
An MCP server that enables users to search for government grants based on keywords and view detailed information including funding, eligibility, and deadlines.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server that provides access to government datasets from Data.gov, enabling users to search packages, view dataset details, list groups and tags, and access resources by URL.Last updated -430916MIT License
- AsecurityFlicenseAqualityAn MCP server that enables interaction with Markdown knowledge bases, allowing users to search and retrieve content by tags, text, URL, or date range from their local markdown files.Last updated -775
- -securityAlicense-qualityA document-based MCP server that supports keyword searching and content retrieval from official website documentation.Last updated -5MIT License
- AsecurityAlicenseAqualityAn MCP server that allows users to efficiently search and reference user-configured documents through document listing, grep searching, semantic searching with OpenAI Embeddings, and full document retrieval.Last updated -43MIT License