Charity MCP Server

by briancasteel

Not rated
GitHub

About

Access charity and nonprofit organization data from the IRS database via CharityAPI.org.

Details

Author
briancasteel
Categories
Database, API, Other

Setup

Install Charity MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/briancasteel/charity-mcp-server

Follow the installation instructions in the repository README, then restart your MCP client.

Access charity and nonprofit organization data from the IRS database via CharityAPI.org.

A comprehensiveModel Context Protocol (MCP)server that provides AI assistants with enterprise-grade access to charity and nonprofit organization data from the IRS database. This feature-complete server enables AI tools to look up charity information, verify tax-deductible status, search for nonprofit organizations, and utilize advanced prompt templates for guided charity research workflows.

Achievement: 100% complete implementation exceeding all original requirements

- ✅ All 4 core MCP tools with comprehensive error handling
- ✅ Complete prompt system with 14 specialized templates
- ✅ Enterprise-grade architecture with full type safety
- ✅ Production-ready with comprehensive testing and documentation
- ✅ Advanced features providing superior user experience

- Look up detailed information about any charity using their EIN (Tax ID)
- Get comprehensive IRS data including official name, location, tax status, and classification codes
- Validate EIN format and business rules

- Search for charities by organization name, city, or state
- Support for pagination and filtering
- Find organizations when you don't have their exact EIN

- Quickly verify if an organization qualifies as a tax-deductible public charity
- Check 501(c)(3) status for donation planning
- Instant verification of tax-deductible status

- 8 Verification Prompts: Complete charity verification workflows with guided steps
- 6 Quick Reference Prompts: Streamlined lookup assistance and best practices
- Dynamic Generation: Template-driven prompts with parameter substitution
- User Experience: Pre-built workflows for common charity research scenarios
- AI Assistant Guidance: Best practices and decision trees for optimal tool usage

- Rate Limiting: Configurable API rate limits to prevent abuse
- Input Validation: Comprehensive validation with security checks
- Error Handling: Robust error handling with user-friendly messages
- Logging: Detailed logging for monitoring and debugging
- Type Safety: Full TypeScript implementation with Zod schemas

- Node.js 18+
- npm or yarn
- CharityAPI account and API key

git clone <repository-url> cd charity-mcp-server
cp .env.example .env # Edit .env with your API key and configuration

Create a.envfile based on.env.example:

# CharityAPI Configuration CHARITY_API_BASE_URL=https://api.charityapi.org CHARITY_API_KEY=your_api_key_here CHARITY_API_TIMEOUT=10000 CHARITY_API_MAX_RETRIES=3 CHARITY_API_RETRY_DELAY=1000 # Server Configuration MAX_CONCURRENT_REQUESTS=10 REQUEST_TIMEOUT_MS=30000 ENABLE_CACHING=false LOG_LEVEL=INFO # Rate Limiting RATE_LIMIT_REQUESTS_PER_MINUTE=100 RATE_LIMIT_WINDOW_MS=60000

- Sign up for aCharityAPI account
- Generate an API key from your dashboard
- Add the API key to your.envfile

Look up detailed information about a specific charity using their EIN.

- ein(string, required): EIN in format "XX-XXXXXXX" or "XXXXXXXXX"

{ "ein": "13-1837418" }

- Complete organization details
- Tax deductibility status and codes
- Organization classification and activity codes
- Current IRS status and ruling information

Search for charities by name, location, or other criteria.

- query(string, optional): Organization name or keywords
- city(string, optional): Filter by city name
- state(string, optional): Filter by state (2-letter code)
- limit(number, optional): Results per page (1-100, default 25)
- offset(number, optional): Skip results for pagination (default 0)

{ "query": "American Red Cross", "state": "CA", "limit": 10 }

- List of matching organizations
- Pagination information
- Basic details (name, EIN, location, deductibility)

3. Public Charity Check (public_charity_check)

Verify if an organization qualifies as a tax-deductible public charity.

- ein(string, required): EIN in format "XX-XXXXXXX" or "XXXXXXXXX"

{ "ein": "13-1837418" }

- Public charity status (yes/no)
- Tax-deductible donation eligibility
- EIN confirmation

The server provides built-in prompts to help AI assistants perform charity verification effectively:
-

Charity Verification Guide(charity_verification_guide)

- Complete guide for performing charity legitimacy verification
- Customizable by organization type (name_only, ein_based, suspicious, etc.)

Basic Legitimacy Workflow(basic_legitimacy_workflow)

- Step-by-step workflows for different verification scenarios
- Parameters: verification_type, organization_name, ein, location

Red Flag Detection(red_flag_detection)

- Guidance for detecting and handling problematic charity statuses
- Handles revoked, conditional, and suspended organizations

Verification Response Templates(verification_response_templates)

- Standardized response formats for different verification outcomes
- Templates for verified, failed, conditional, and not_found cases
-

Quick Verification Reference(quick_verification_reference)

- Fast lookup templates for common verification scenarios
- Customizable by user input type

Response Templates Quick(response_templates_quick)

- Quick response templates with status indicators (✅ ⚠️ ❌)
- Templates for verified, cannot_verify, and problems_found cases

Tool Selection Guide(tool_selection_guide)

- Decision tree for selecting the right MCP tool
- Scenario-specific guidance for different verification contexts

Common Keywords Reference(common_keywords_reference)

- Reference of keywords that trigger charity verification
- Intent recognition patterns for AI assistants

AI Assistant Best Practices(ai_assistant_best_practices)

- Comprehensive best practices for using the charity verification system
- Guidelines for communication, error handling, and user experience

AI assistants can access these prompts through the MCP protocol:

{ "method": "prompts/get", "params": { "name": "basic_legitimacy_workflow", "arguments": { "verification_type": "organization_name", "organization_name": "American Red Cross" } } }

Add to your Claude Desktop configuration:

{ "mcpServers": { "charity-server": { "command": "node", "args": ["path/to/charity-mcp-server/build/index.js"], "env": { "CHARITY_API_KEY": "your_api_key_here" } } } }

The server implements the standard MCP protocol and works with any compatible client. Connect using stdio transport.

src/ ├── config/ # Configuration management ├── formatting/ # Response formatting utilities ├── prompts/ # MCP prompt implementations and templates ├── schemas/ # Zod validation schemas ├── services/ # External API clients and rate limiting ├── tools/ # MCP tool implementations ├── transformers/ # Data transformation utilities ├── types/ # TypeScript type definitions ├── utils/ # Logging, error handling, validation └── validation/ # Input validation and sanitization
# Install dependencies npm install # Run in development mode with hot reload npm run dev # Build for production npm run build # Start production server npm start # Clean build artifacts npm run clean # Run tests (when implemented) npm test # Run linting (when configured) npm run lint

The server follows a layered architecture:
- MCP Layer: Handles protocol communication and tool registration
- Validation Layer: Input sanitization and validation with Zod schemas
- Service Layer: External API communication with rate limiting
- Transform Layer: Data transformation and standardization
- Formatting Layer: Response formatting for optimal AI consumption

- Input Validation: EIN format validation, security sanitization
- Rate Limiting: Token bucket algorithm with configurable limits
- Error Handling: Structured error responses with user-friendly messages
- Logging: Structured logging with configurable levels
- Type Safety: Full TypeScript coverage with runtime validation

This server integrates withCharityAPI.orgto provide:

- Access to complete IRS nonprofit database
- Real-time charity information lookup
- Organization search and filtering capabilities
- Tax-deductible status verification

- 100 requests per minute per tool
- Configurable via environment variables
- Automatic cleanup of expired tokens
- Fork the repository
- Create a feature branch (git checkout -b feature/amazing-feature)
- Commit your changes (git commit -m 'Add amazing feature')
- Push to the branch (git push origin feature/amazing-feature)
- Open a Pull Request

- Maintain TypeScript strict mode compliance
- Add comprehensive input validation for new features
- Include error handling with user-friendly messages
- Update schemas and types for new data structures
- Add logging for debugging and monitoring
- Follow existing code organization patterns

This project is licensed under the MIT License - see theLICENSEfile for details.

For AI assistants using this MCP server, see our comprehensive prompt guides:

- Verification Prompts Guide- Detailed workflows and examples for charity verification
-
Quick Reference- Fast lookup templates and best practices

- "Is the American Red Cross a real charity registered with the IRS?"
- "Verify that organization with EIN 13-1837418 is legitimate"
- "Quick check: is EIN 52-1693387 a legitimate public charity?"

- "I got a donation request from 'Help Kids Foundation' - are they legitimate?"
- "Someone is collecting money for hurricane relief - EIN 12-3456789. Is it real?"

- "Is there a legitimate charity called 'Local Food Bank' in Chicago, IL?"
- "Verify 'Animal Rescue' operating in California"

- Issues: Report bugs and feature requests via GitHub Issues
- Documentation: Additional documentation available in the/docsfolder
- CharityAPI: For API-related questions, visit
CharityAPI.org

- Model Context Protocolfor the standard
-
CharityAPI.orgfor nonprofit data access
- The open source community for inspiration and contributions

-

Enhanced Medication Information MCP Server

Provides real-time access to FDA drug data, including shortages, labeling, and recalls, via the openFDA API.

A Centralized MCP Server for Fetching Data from Many Countries' Govs

Access NCBI's suite of APIs, including E-utilities, BLAST, PubChem, and PMC services.

API de datos electorales del mundo democrático: partidos políticos, perfiles ideológicos y programas electorales.

Access the ChEMBL chemical database for drug discovery, chemical informatics, and bioactivity research using specialized tools via its REST API.

Access Reactome pathway and systems biology data via its live API.

NIH clinical trials and FDA adverse event reports. 4 MCP tools for health research.

Structured iGaming reference data — slot specs, RTP variants, providers, regulators, news and jobs.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.