Wraps any MCP server or HTTP endpoint with automatic retry logic, circuit breakers, and observability. Run it standalone to get a wrap_call tool that adds exponential backoff and failure tracking to arbitrary API requests, or use proxy mode to transparently wrap existing MCP servers so all their tools inherit self-healing behavior. Includes tools to check circuit breaker status, reset failed circuits, and pull metrics on success rates and recent errors. Useful when your agents are hitting flaky third-party APIs or you want to add resilience to an MCP server that doesn't handle transient failures gracefully. Configure retry counts, backoff delays, and circuit thresholds through environment variables.
Self-healing proxy for MCP servers. Wraps any MCP tool call with automatic retry, circuit breaker protection, and call observability.
Your AI agents stop breaking on flaky APIs.
One-click install: Install on MCPize |
npx selfheal-mcp
Add to your Claude Desktop / Claude Code config:
{
"mcpServers": {
"selfheal": {
"command": "npx",
"args": ["-y", "selfheal-mcp"]
}
}
}
Then use wrap_call to make any HTTP request with self-healing:
Use the wrap_call tool to GET https://api.example.com/data with target "example-api"
Create selfheal.config.json:
{
"mode": "proxy",
"targets": [
{
"name": "my-server",
"transport": "streamable-http",
"url": "https://my-mcp-server.com/mcp"
}
]
}
{
"mcpServers": {
"selfheal": {
"command": "npx",
"args": ["-y", "selfheal-mcp"],
"env": {
"SELFHEAL_CONFIG": "/path/to/selfheal.config.json"
}
}
}
}
All tools from my-server are re-exposed with self-healing built in.
| Tool | Description |
|---|---|
wrap_call | Execute HTTP call with retry + circuit breaker |
circuit_status | Check health of any target |
circuit_reset | Reset circuit breaker after fixing issues |
metrics | Success rates, latency, top errors |
recent_errors | Recent failures with full details |
| Tool | Description |
|---|---|
selfheal_metrics | Metrics for all proxied calls |
selfheal_circuits | Circuit status for all targets |
selfheal_recent_errors | Recent errors across all targets |
| Variable | Default | Description |
|---|---|---|
SELFHEAL_CONFIG | ./selfheal.config.json | Config file path |
SELFHEAL_MAX_RETRIES | 3 | Max retry attempts |
SELFHEAL_BASE_DELAY_MS | 1000 | Base delay for backoff |
SELFHEAL_MAX_DELAY_MS | 30000 | Max delay cap |
SELFHEAL_CIRCUIT_THRESHOLD | 5 | Failures before circuit opens |
SELFHEAL_CIRCUIT_COOLDOWN_MS | 120000 | Cooldown before half-open test |
Agent → SelfHeal MCP → [Retry + Circuit Breaker] → Target API/MCP Server
↓
Metrics Collector
One-click install with managed hosting: Install on MCPize
npx selfheal-mcp
Not applicable — this is a TypeScript server. For Python alternatives, see LeadEnrich MCP.
MIT — Built by Freedom Engineers
SELFHEAL_CONFIGPath to selfheal.config.json (optional, defaults to cwd)
SELFHEAL_MAX_RETRIESMax retry attempts per call (default: 3)
SELFHEAL_CIRCUIT_THRESHOLDFailures before circuit opens (default: 5)
io.github.infoinlet-marketplace/mcp-observability
betterdb-inc/monitor
com.mcparmory/datadog
thotischner/observability-mcp
io.github.tantiope/datadog-mcp
io.github.us-all/datadog