Een eenvoudige MCP (Model Context Protocol) server met Server-Sent Events (SSE) functionaliteit, geoptimaliseerd voor deployment op Render.com.
- 🚀 Express.js server - Lightweight en snel
- 📡 Server-Sent Events (SSE) - Real-time data streaming
- ⏰ Timestamp broadcasting - Elke 5 seconden
- 💓 Keep-alive pings - Elke 30 seconden
- 🌐 CORS enabled - Cross-origin requests toegestaan
- 🏥 Health checks - Voor Render.com monitoring
- 📊 Status endpoints - Server informatie en statistieken
GET /- Server informatie en beschikbare endpointsGET /health- Health check voor monitoringGET /sse- Server-Sent Events streamGET /mcp/status- Uitgebreide server status
-
Installeer dependencies:
npm install
-
Start de server:
npm start # of voor development: npm run dev -
Test SSE verbinding: Open
http://localhost:3000/ssein je browser of gebruik curl:curl -N http://localhost:3000/sse
- Connect GitHub repository in Render dashboard
- Selecteer deze repository
- Render detecteert automatisch de
render.yamlconfiguratie - Deploy - Render gebruikt automatisch de configuratie
- Maak nieuwe Web Service in Render
- Configuratie:
- Build Command:
npm install - Start Command:
npm start - Health Check Path:
/health - Environment: Node.js
- Plan: Free tier
- Build Command:
De SSE stream stuurt JSON data in het volgende formaat:
{
"type": "connection",
"message": "SSE connection established",
"timestamp": "2024-01-01T12:00:00.000Z",
"server": "MCP Server"
}{
"type": "timestamp",
"timestamp": "2024-01-01T12:00:05.000Z",
"uptime": 123.456,
"memory": {
"rss": 12345678,
"heapTotal": 8765432,
"heapUsed": 5432109,
"external": 987654
}
}: keep-alive 1704110400000
PORT- Server port (default: 3000, Render sets automatically)NODE_ENV- Environment (production/development)
De server is geconfigureerd om alle origins toe te staan voor maximale compatibiliteit:
cors({
origin: '*',
methods: ['GET', 'POST', 'OPTIONS'],
allowedHeaders: ['Content-Type', 'Cache-Control', 'Accept'],
credentials: false
})- 500 errors - Gelogd en JSON response
- 404 errors - Friendly message met beschikbare endpoints
- SSE disconnects - Automatic cleanup van intervals
- Graceful shutdown - SIGTERM/SIGINT handling
curl https://your-app.onrender.com/healthcurl https://your-app.onrender.com/mcp/status- express - Web framework
- cors - Cross-origin resource sharing
MIT License - Zie LICENSE bestand voor details.
Voor vragen of issues, maak een GitHub issue aan in deze repository: https://github.com/Fuglys/mcp-server