๐ Service Health MCP Server
The first universal service health monitoring tool for Claude Desktop and MCP-compatible AI assistants, enabling AI assistants to monitor web services, APIs, and HTTP endpoints with enterprise-level security.
๐ Quick Start
Step 1: Install
git clone https://github.com/natashanajdovski/service-health-mcp.git
cd service-health-mcp
npm install
npm run build
Step 2: Configure Claude Desktop
Find your config file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Linux:
~/.config/Claude/claude_desktop_config.json
Add this configuration:
{
"mcpServers": {
"service-health": {
"command": "node",
"args": ["C:\\path\\to\\service-health-mcp\\dist\\server.js"],
"cwd": "C:\\path\\to\\service-health-mcp"
}
}
}
Step 3: Restart & Test
- Completely close and reopen Claude Desktop
- Test with:
"Check if google.com is healthy"
- See professional health reports instantly! ๐
โจ Features
๐ Health Monitoring
- โ
HTTP/HTTPS endpoint testing
- โ
Response time measurement
- โ
Status code validation
- โ
Custom headers support
- โ
Multiple HTTP methods
- โ
Configurable timeouts (1-30s)
๐ก๏ธ Enterprise Security
- โ
SSRF attack prevention
- โ
Internal network blocking
- โ
Input validation & sanitization
- โ
Protocol restrictions (HTTP/HTTPS only)
- โ
Port filtering & safe defaults
- โ
Zero credential exposure
โก Performance
- โ
Sub-second response times
- โ
Efficient connection handling
- โ
Minimal resource usage
- โ
Non-blocking async operations
- โ
Optimized error handling
- โ
Smart retry logic
๐ง Developer Experience
- โ
Full TypeScript support
- โ
Professional error messages
- โ
Comprehensive logging
- โ
Easy MCP integration
- โ
Hot reload development
- โ
Extensive documentation
๐ฆ Installation
git clone https://github.com/natashanajdovski/service-health-mcp.git
cd service-health-mcp
npm install
npm run build
๐ป Usage Examples
Basic Usage
๐ "Check if google.com is healthy"
๐ "Is api.github.com responding properly?"
๐ "Test if my-website.com is up"
Advanced Usage
๐ "Check if api.example.com/health is healthy with a 15 second timeout"
๐ "Test httpbin.org/post using POST method"
๐ "Check if my-api.com returns 201 status code"
DevOps & Monitoring
๐ "Check if our production API is responding normally"
๐ "Test all our microservices for health"
๐ "Monitor our CDN endpoints"
๐ Documentation
๐ Transparency & Learning
๐ค Built with AI Assistance: This project was created by Natasha in collaboration with Claude Sonnet 4 as a learning exercise. No prior MCP server development experience was required!
๐ Learning Goals Achieved:
- โ
MCP Protocol Implementation - From zero to working server
- โ
TypeScript Best Practices - Professional code structure
- โ
Security-First Development - Enterprise-grade SSRF protection
- โ
Open Source Standards - Community-ready documentation
- โ
Real-World Problem Solving - Filling a genuine gap in the MCP ecosystem
๐ก For Fellow Learners: If you're new to MCP development or curious about AI-assisted programming, this project demonstrates what's possible when learning with AI guidance. See our development process and contributing guidelines for insights!
โจ Why This Exists
The Goal: While learning MCP development, I wanted to build something that would be genuinely useful for monitoring services through AI conversations. This MCP server provides a convenient way for Claude (and other AI assistants) to check service health naturally through chat.
What Makes It Useful:
- ๐ Conversational monitoring - Check services through natural language
- ๐ก๏ธ Security-first design with comprehensive SSRF protection
- โก Fast and reliable with detailed diagnostics
- ๐ฏ Easy to use - works out of the box with Claude Desktop
- ๐ Professional output with actionable information
๐ Sample Output
โ
**Health Check Result**
**URL:** https://api.github.com
**Status:** HEALTHY
**Response Time:** 127ms
**HTTP Status:** 200 (OK)
**Message:** Endpoint is healthy (200) - 127ms response time
**Checked At:** 2024-07-24T21:30:00.000Z
**Interpretation:**
๐ The endpoint is working perfectly! No issues detected.
For unhealthy services:
โ **Health Check Result**
**URL:** https://down-service.com
**Status:** UNHEALTHY
**Response Time:** 5000ms
**Message:** Network error: Connection timeout
**Checked At:** 2024-07-24T21:30:00.000Z
**Interpretation:**
๐จ The endpoint has issues and may be down or misconfigured. Investigation needed.
๐ก๏ธ Security
This MCP server implements enterprise-grade security to prevent attacks:
๐จ SSRF (Server-Side Request Forgery) Protection
โ BLOCKED: localhost, 127.0.0.1
โ BLOCKED: 192.168.x.x, 10.x.x.x, 172.16-31.x.x
โ BLOCKED: 169.254.169.254 (cloud metadata)
โ BLOCKED: Non-HTTP protocols (ftp, file, etc.)
โ
ALLOWED: Public HTTP/HTTPS endpoints only
๐ Input Validation
- URL Format: RFC-compliant validation
- Parameter Types: Strict type checking with Zod
- Timeout Bounds: 1-30 second limits
- Method Restrictions: GET, POST, PUT, DELETE only
- Port Filtering: Standard web ports (80, 443, 8080, 8443)
๐ก๏ธ Safe Defaults
- 10-second timeout (prevents hanging)
- GET method (least intrusive)
- No credential storage (stateless operation)
- Minimal error details (no information leakage)
๐ง Development
Prerequisites
- Node.js 18+
- TypeScript 5+
- npm or yarn
Development Commands
npm run dev
npm run build
npm run start
npm run clean
Testing with MCP Inspector
npx @modelcontextprotocol/inspector src/server.ts
Project Structure
service-health-mcp/
โโโ src/
โ โโโ server.ts # ๐ฏ Main MCP server
โ โโโ health/
โ โ โโโ http-checker.ts # ๐ Core health logic
โ โโโ security/
โ โ โโโ url-validator.ts # ๐ก๏ธ SSRF protection
โ โโโ tools/
โ โโโ check-http.ts # ๐ ๏ธ MCP tool interface
โโโ dist/ # ๐ฆ Compiled JavaScript
โโโ docs/ # ๐ Documentation
โโโ package.json # ๐ Project config
๐ API Reference
check_http_endpoint
Description: Check if an HTTP/HTTPS endpoint is healthy and responsive.
Parameters
| Parameter |
Type |
Required |
Default |
Description |
url |
string |
โ
Yes |
- |
The URL to check (e.g., https://google.com) |
method |
"GET" | "POST" | "PUT" | "DELETE" |
โ No |
"GET" |
HTTP method to use |
timeout |
number |
โ No |
10000 |
Request timeout in milliseconds (1000-30000) |
expectedStatus |
number |
โ No |
200 |
Expected HTTP status code (100-599) |
headers |
Record<string, string> |
โ No |
{} |
Optional HTTP headers |
Example Request
{
"url": "https://api.example.com/health",
"method": "GET",
"timeout": 15000,
"expectedStatus": 200,
"headers": {
"User-Agent": "Health-Checker/1.0",
"Accept": "application/json"
}
}
Response Format
{
status: "healthy" | "unhealthy" | "warning";
responseTime: number;
statusCode?: number;
message: string;
details: {
url: string;
timestamp: string;
error?: string;
}
}
๐ Troubleshooting
โ Tool Not Appearing in Claude Desktop
Problem: Claude doesn't recognize the health check tool.
Solutions:
- Verify config syntax: Use a JSON validator
- Check file paths: Use absolute paths in config
- Restart completely: Close Claude Desktop entirely, then reopen
- Test build: Run
npm run build and check for errors
- Check permissions: Ensure Node.js can read the files
๐ Network Connection Issues
Problem: Getting network errors or timeouts.
โ Network error: Client network socket disconnected
Solutions:
- Service may be down: Try checking in browser first
- HTTPS issues: Try HTTP version of the URL
- Firewall: Check if your network blocks the service
- DNS: Verify the domain resolves correctly
๐ Security Restriction Messages
Problem: URLs being blocked for security reasons.
โ Access to internal networks and localhost is not allowed
This is intentional! The security system is working correctly:
- For local testing: Use browser or
curl directly
- For monitoring: Use external, publicly accessible URLs only
- For internal services: Deploy monitoring within your network
โก Performance Issues
Problem: Slow response times or timeouts.
Solutions:
- Increase timeout: Use 15-30 second timeouts for slow services
- Check network: Test connectivity to the target service
- Reduce load: Avoid checking too many endpoints simultaneously
๐ค Contributing
We welcome contributors of all skill levels! This project was built by a learner with AI assistance, and we're excited to grow the community.
๐ Ways to Contribute
- ๐ Bug Reports: Found an issue? Please report it!
- โจ Feature Requests: Ideas for new capabilities?
- ๐ Documentation: Help improve our guides
- ๐ง Code: Submit pull requests for enhancements
- ๐ Learning: Share your experience using this project
๐ Getting Started
- Fork the repository
- Clone your fork:
git clone https://github.com/yourusername/service-health-mcp.git
- Create branch:
git checkout -b feature/amazing-feature
- Make changes and test thoroughly
- Commit:
git commit -m "Add amazing feature"
- Push:
git push origin feature/amazing-feature
- Open Pull Request with detailed description
๐ Contribution Guidelines
- Code Style: Follow existing TypeScript patterns
- Security: Maintain SSRF protection standards
- Tests: Add tests for new features
- Documentation: Update docs for any changes
- Commit Messages: Use clear, descriptive commits
See CONTRIBUTING.md for detailed guidelines.
๐บ๏ธ Roadmap
๐ฏ Phase 1: Core Stability (Current)
- โ
HTTP/HTTPS health checking
- โ
Enterprise security (SSRF protection)
- โ
Claude Desktop integration
- โ
Professional documentation
๐ฏ Phase 2: Database Support (Next)
- ๐ PostgreSQL health checking
- ๐ MySQL/MariaDB support
- ๐ Redis connectivity testing
- ๐ MongoDB health monitoring
๐ฏ Phase 3: Advanced Features
- ๐ Multi-service dashboards
- ๐ Health history tracking
- ๐ Webhook notifications
- โฐ Scheduled monitoring
๐ฏ Phase 4: Enterprise
- โ๏ธ Cloud integration (AWS, Azure, GCP)
- ๐ณ Docker containerization
- ๐ Authentication support
- ๐ Prometheus metrics export
๐ก Community Input Welcome! Open an issue to suggest features or vote on priorities.
๐ง Technical Details
The project was developed using TypeScript, following best practices in code structure and security. It implements the MCP protocol to enable AI assistants like Claude to monitor service health. The server has comprehensive security measures, including SSRF protection and input validation, and is designed for efficient performance with minimal resource usage.
๐ License
MIT License - see LICENSE file for details.
TL;DR: You can use, modify, and distribute this project freely. Just include the license notice.