Volunteer Search MCP Server
Enables searching for volunteer opportunities via MCP protocol, REST API, and includes a custom Apex MCP client for Salesforce Agentforce integration, all powered by the free VolunteerConnector API.
README
๐ Volunteer Search MCP Server, Client & REST API
A Model Context Protocol (MCP) server, client demo, and REST API for searching volunteer opportunities from the free VolunteerConnector API.
๐ What Makes This Special?
Most MCP implementations are either servers OR clients. This project has BOTH:
- โ MCP Server (Node.js) - Serves MCP protocol
- โ MCP Client (Apex) - Custom Salesforce MCP client
- โ MCP Client (JavaScript) - Browser-based demo
- โ REST API - Traditional HTTP endpoints
- โ Hybrid Architecture - All in one deployment
๐ก Why the Apex MCP Client Matters:
Salesforce doesn't natively support MCP protocol. This project implements a full JSON-RPC 2.0 MCP client from scratch in Apex, making Salesforce Agentforce a first-class citizen in the MCP ecosystem.
This demonstrates:
- Deep understanding of protocol specifications
- Ability to implement AI protocols in enterprise platforms
- Bridge between traditional enterprise (Salesforce) and cutting-edge AI (MCP)
๐ฏ Features
- ๐ MCP Server - True Model Context Protocol implementation (JSON-RPC 2.0)
- ๐ฑ Multiple MCP Clients - Apex (Salesforce), JavaScript (Browser), Claude Desktop
- ๐ป MCP Client Demo - Interactive web-based client for testing MCP over SSE
- ๐ REST API - HTTP endpoints for traditional integration
- ๐ Hybrid Mode - Single server supporting both REST and MCP protocols
- โก Salesforce Agentforce - Custom Apex MCP client for Agentforce integration
- ๐ฐ FREE - Uses VolunteerConnector API (no authentication required)
- ๐ Heroku Ready - Deploy to Heroku in 5 minutes
- ๐งช Tested - Includes test scripts and live demos
- ๐ Well Documented - Complete guides and examples
๐ฆ What's Included
1. MCP Server (volunteer-search-server.js)
- Implements Model Context Protocol (stdio)
- Works with Claude Desktop and other MCP clients
- Exposes 2 tools:
search_volunteer_opportunities- Search with filtersget_opportunity_details- Get full details by ID
2. MCP Client Demo (public/index.html)
- Interactive web-based MCP client
- Connects to MCP server via SSE (Server-Sent Events)
- Real-time testing interface
- Beautiful, modern UI
- No backend required (pure frontend)
3. REST API (server.js)
- Express.js REST API
- Deployable to Heroku/Render/Railway
- Endpoints:
GET /- API infoGET /health- Health checkPOST /api/search- Search opportunitiesGET /api/opportunity/:id- Get details
4. Hybrid Server (server-with-mcp-sse.js)
- Supports BOTH REST API and MCP over SSE
- Single deployment for multiple protocols
- MCP endpoint:
POST /mcp/message(JSON-RPC 2.0) - Serves MCP client demo at
/ - Perfect for production deployments
5. Salesforce Apex MCP Client (VTOApexMCPClient.cls)
- Custom MCP client written in Apex
- Implements JSON-RPC 2.0 protocol from scratch
- Calls MCP server via HTTP POST
- Usable in Salesforce Agentforce Agent Builder
- Methods:
searchViaMCPProtocol- Search using MCP protocollistMCPTools- Discover available MCP tools
- Full protocol compliance - validates JSON-RPC responses
- Production-ready enterprise MCP client
๐ Quick Start
Option 1: MCP Client Demo (Interactive Web UI)
# Install dependencies
npm install
# Start the hybrid server (REST + MCP)
node server-with-mcp-sse.js
# Open in browser
open http://localhost:3000
What you get:
- Interactive MCP client in your browser
- Test volunteer searches in real-time
- See MCP protocol messages
- Beautiful UI for demos
Option 2: REST API (for Heroku/Salesforce)
# Install dependencies
npm install
# Start the REST API
npm start
# Test locally
curl http://localhost:3000/health
Option 3: MCP Server (for Claude Desktop)
# Install dependencies
npm install
# Start the MCP server
npm run start:mcp
Then add to Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"volunteer-search": {
"command": "node",
"args": ["/absolute/path/to/volunteer-search-mcp/volunteer-search-server.js"]
}
}
}
โก Salesforce Agentforce Integration
This project includes a custom Apex MCP client that allows Salesforce Agentforce to use the Model Context Protocol!
How It Works:
Salesforce Agentforce
โ
VTOApexMCPClient.cls (Apex MCP Client)
โ JSON-RPC 2.0 Message
POST /mcp/message
โ
Hybrid Server (MCP Protocol Handler)
โ
VolunteerConnector API
MCP Message Example:
Request (from Apex):
{
"jsonrpc": "2.0",
"id": 42345,
"method": "tools/call",
"params": {
"name": "search_volunteer_opportunities",
"arguments": {
"keywords": "tutoring",
"location": "Toronto",
"max_results": 5
}
}
}
Response (from server):
{
"jsonrpc": "2.0",
"id": 42345,
"result": {
"content": [
{
"type": "text",
"text": "๐ Found 5 volunteer opportunities...\n\n1. ..."
}
]
}
}
Key Features:
- โ Full JSON-RPC 2.0 compliance
- โ Protocol validation (checks jsonrpc version, message IDs)
- โ
Tool discovery (
tools/listmethod) - โ
Tool execution (
tools/callmethod) - โ Enterprise logging (debug logs for troubleshooting)
- โ Error handling (proper JSON-RPC error responses)
Why This Matters:
Most Salesforce integrations use REST. This project demonstrates that Salesforce can implement cutting-edge AI protocols like MCP through custom Apex clients.
This makes Salesforce a first-class citizen in the MCP ecosystem! ๐
๐ REST API Endpoints
GET /
Returns API information and available endpoints.
GET /health
Health check endpoint.
Response:
{
"status": "ok",
"timestamp": "2025-10-05T..."
}
POST /api/search
Search for volunteer opportunities.
Request Body:
{
"keywords": "tutoring",
"location": "Toronto",
"remote_only": false,
"max_results": 10
}
Response:
{
"success": true,
"total_count": 969,
"returned_count": 10,
"opportunities": [
{
"id": 43243,
"title": "Event Planner",
"organization": "Canadian Network for International Surgery",
"description": "...",
"url": "https://...",
"dates": "September 8, 2025 - November 9, 2025",
"duration": null,
"remote": false,
"location": "British Columbia",
"activities": "Event Planning, Marketing, Social Media"
}
],
"formatted_text": "๐ Found 10 volunteer opportunities..."
}
GET /api/opportunity/:id
Get detailed information about a specific opportunity.
Response:
{
"success": true,
"opportunity": {
"id": 43243,
"title": "Event Planner",
"organization": "Canadian Network for International Surgery",
"description": "...",
"url": "https://...",
"dates": "September 8, 2025 - November 9, 2025",
"activities": [
{"name": "Event Planning", "category": "PR, Fundraising, Events"}
]
},
"formatted_text": "๐ Volunteer Opportunity Details..."
}
๐ง MCP Tools
search_volunteer_opportunities
Search for volunteer opportunities with optional filters.
Parameters:
keywords(string, optional) - Search termslocation(string, optional) - City or regionremote_only(boolean, optional) - Filter for remote opportunitiesmax_results(number, optional) - Max results (1-50, default: 10)
Example:
{
"keywords": "tutoring",
"location": "Toronto",
"max_results": 5
}
get_opportunity_details
Get detailed information about a specific opportunity.
Parameters:
opportunity_id(number, required) - The opportunity ID
Example:
{
"opportunity_id": 43243
}
๐ Deploy to Heroku
Quick Deploy:
# Login to Heroku
heroku login
# Create app
heroku create your-app-name
# Deploy
git init
git add .
git commit -m "Initial commit"
git push heroku main
# Open app
heroku open
Detailed Guide:
See HEROKU_DEPLOYMENT.md for complete deployment instructions.
๐งช Testing
Test REST API:
# Test locally
./test-api.sh http://localhost:3000
# Test on Heroku
./test-api.sh https://your-app.herokuapp.com
Test MCP Server:
# Use MCP Inspector
npx @modelcontextprotocol/inspector node volunteer-search-server.js
๐ Integration Examples
Salesforce Apex
HttpRequest req = new HttpRequest();
req.setEndpoint('callout:Volunteer_Search_API/api/search');
req.setMethod('POST');
req.setHeader('Content-Type', 'application/json');
Map<String, Object> body = new Map<String, Object>{
'keywords' => 'tutoring',
'max_results' => 10
};
req.setBody(JSON.serialize(body));
Http http = new Http();
HttpResponse res = http.send(req);
JavaScript/Node.js
const response = await fetch('https://your-app.herokuapp.com/api/search', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
keywords: 'tutoring',
max_results: 10
})
});
const data = await response.json();
console.log(data.opportunities);
Python
import requests
response = requests.post(
'https://your-app.herokuapp.com/api/search',
json={
'keywords': 'tutoring',
'max_results': 10
}
)
data = response.json()
print(data['opportunities'])
curl
curl -X POST https://your-app.herokuapp.com/api/search \
-H "Content-Type: application/json" \
-d '{"keywords":"tutoring","max_results":10}'
๐ Data Source
This project uses the VolunteerConnector API:
- URL: https://www.volunteerconnector.org/api/search/
- Cost: FREE (no authentication required)
- Coverage: 969+ volunteer opportunities across North America
- Updates: Real-time
- Documentation: https://www.volunteerconnector.org/api
๐๏ธ Architecture
REST API Flow:
Client (Salesforce/Web/Mobile)
โ HTTP REST
Express.js Server (server.js)
โ HTTP GET
VolunteerConnector API
โ
Return formatted results
MCP Server Flow (stdio):
AI Assistant (Claude Desktop)
โ MCP Protocol (stdio)
MCP Server (volunteer-search-server.js)
โ HTTP GET
VolunteerConnector API
โ
Return formatted results
MCP Client Flow (SSE):
Web Browser (MCP Client Demo)
โ MCP over SSE
Hybrid Server (server-with-mcp-sse.js)
โ HTTP GET
VolunteerConnector API
โ
Return formatted results
โ SSE Stream
Display in web UI
Hybrid Architecture:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Hybrid Server (server-with-mcp-sse.js) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โ โ REST API โ โ MCP Protocol โ โ
โ โ Endpoints โ โ (JSON-RPC 2.0) โ โ
โ โ โ โ โ โ
โ โ /api/search โ โ /mcp/message โ โ
โ โ /api/opp/:id โ โ โ โ
โ โโโโโโโโโโฌโโโโโโโโ โโโโโโโโโโโฌโโโโโโโโโ โ
โ โ โ โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโผโโโโโโโโโโโ โ
โ โ VolunteerConnector โ โ
โ โ API โ โ
โ โโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ
โ Salesforce โ โ MCP Clients: โ
โ (REST API) โ โ โข Apex Client โ
โโโโโโโโโโโโโโโโ โ โข Browser Client โ
โ โข Claude Desktop โ
โโโโโโโโโโโโโโโโโโโโโโโ
๐ Key Difference:
REST: Traditional HTTP API calls
MCP: JSON-RPC 2.0 protocol messages
Multiple Integration Patterns:
| Client Type | Protocol | Endpoint | Use Case |
|---|---|---|---|
| Salesforce (REST) | HTTP REST | /api/search |
Standard integration |
| Salesforce (MCP) | JSON-RPC 2.0 | /mcp/message |
Protocol-compliant AI |
| Web Browser | JSON-RPC 2.0 | /mcp/message |
Interactive demo |
| Claude Desktop | MCP (stdio) | N/A (stdio) | Native AI assistant |
๐ Project Structure
volunteer-search-mcp/
โโโ server.js # REST API server (Express.js)
โโโ server-with-mcp-sse.js # Hybrid server (REST + MCP over SSE)
โโโ volunteer-search-server.js # MCP server (stdio for Claude Desktop)
โโโ public/
โ โโโ index.html # MCP Client Demo (interactive web UI)
โโโ package.json # Dependencies
โโโ Procfile # Heroku configuration
โโโ test-api.sh # Test script
โโโ GETTING_STARTED.md # Quick start guide
โโโ CLAUDE_DESKTOP_DEMO.md # Claude Desktop setup guide
โโโ HEROKU_DEPLOYMENT.md # Deployment guide
โโโ README.md # This file
โโโ LICENSE # MIT License
โโโ .gitignore # Git ignore rules
Salesforce Apex MCP Client (separate repo):
โโโ VTOApexMCPClient.cls # Apex MCP client (JSON-RPC 2.0)
โโโ VTOApexMCPClient.cls-meta.xml
๐ ๏ธ Development
Install Dependencies:
npm install
Run REST API (Development):
npm run dev
Run MCP Server (Development):
npm run dev:mcp
Test:
# Test REST API
./test-api.sh http://localhost:3000
# Test MCP Server
npx @modelcontextprotocol/inspector node volunteer-search-server.js
๐ Use Cases
For Enterprises:
- Salesforce Agentforce - Add volunteer search to AI agents (REST or MCP)
- Corporate VTO Programs - Help employees find volunteer work
- Volunteer Management Platforms - Integrate external volunteer opportunities
- Mobile Apps - Find local volunteer opportunities
- Nonprofit Websites - Display volunteer opportunities
For AI/ML Developers:
- Claude Desktop - Native MCP integration via stdio
- Custom AI Assistants - Add volunteer search to any MCP-compatible AI
- Protocol Research - Study MCP client/server implementation
- Multi-protocol Architecture - Learn REST + MCP hybrid patterns
For Learning & Demos:
- Interactive Demos - Use web client for presentations and testing
- Hackathons - Showcase MCP integration with live demo
- Protocol Education - Learn JSON-RPC 2.0 and MCP specification
- Salesforce Extensions - Example of custom Apex MCP client
๐ Resources
- MCP Documentation: https://modelcontextprotocol.io/
- VolunteerConnector API: https://www.volunteerconnector.org/api
- Heroku Docs: https://devcenter.heroku.com/
- Express.js: https://expressjs.com/
๐ค Contributing
Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
- Improve documentation
๐ License
MIT License - see LICENSE file for details.
๐ Acknowledgments
- VolunteerConnector for providing the free volunteer opportunities API
- Anthropic for creating the Model Context Protocol
- Heroku for easy deployment platform
๐ Support
- Issues: Open an issue on GitHub
- API Status: Check https://www.volunteerconnector.org/
- MCP Help: Visit https://modelcontextprotocol.io/
๐ Quick Links
- ๐ Getting Started Guide
- ๐ป MCP Client Demo - Start hybrid server first
- ๐ค Claude Desktop Setup
- ๐ Heroku Deployment Guide
- ๐งช Test the API
- ๐ MCP Documentation
- ๐ VolunteerConnector API
Built with โค๏ธ for the volunteer community
Star โญ this repo if you find it useful!
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.