npm selfheal-mcpstdioupdated 5mo ago
Self-healing proxy for MCP servers. Wraps any MCP tool call with automatic retry, circuit breaker protection, and call observability.
What can you do with SelfHeal MCP?
SelfHeal MCP
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
Features
- Retry with backoff — Exponential backoff + jitter on transient failures (5xx, timeouts, rate limits)
- Circuit breaker — Per-target circuit breaker stops hammering dead services
- Call metrics — Success rates, latency, error frequency, broken down by tool and target
- Proxy mode — Wrap any existing MCP server transparently
- Zero config — Works standalone out of the box, config file for proxy mode
Quick Start
Standalone Mode
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"
Proxy Mode
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.
Tools
| 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 |
Proxy Mode Adds
| Tool | Description |
|---|---|
selfheal_metrics |
Metrics for all proxied calls |
selfheal_circuits |
Circuit status for all targets |
selfheal_recent_errors |
Recent errors across all targets |
Configuration
Environment Variables
| 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 |
How It Works
Agent → SelfHeal MCP → [Retry + Circuit Breaker] → Target API/MCP Server
↓
Metrics Collector
- Request arrives — Agent calls a tool
- Circuit check — If target has failed too many times, reject immediately
- Execute with retry — Try the call, retry on transient errors with exponential backoff
- Record metrics — Log success/failure, duration, attempts
- Update circuit — Track consecutive failures per target
Install
MCPize (Recommended)
One-click install with managed hosting: Install on MCPize
npm
npx selfheal-mcp
PyPI
Not applicable — this is a TypeScript server. For Python alternatives, see LeadEnrich MCP.
License
MIT — Built by Freedom Engineers
Related
- SiteHealth MCP — Full website health audit
- LeadEnrich MCP — Waterfall lead enrichment
Install
Add SelfHeal MCP to your client. Pick the one you use.
claude mcp add selfheal-mcp -- npx -y selfheal-mcpcodex mcp add selfheal-mcp -- npx -y selfheal-mcpamp mcp add selfheal-mcp -- npx -y selfheal-mcp{
"mcpServers": {
"selfheal-mcp": {
"command": "npx",
"args": [
"-y",
"selfheal-mcp"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"selfheal-mcp": {
"command": "npx",
"args": [
"-y",
"selfheal-mcp"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"selfheal-mcp","command":"npx","args":["-y","selfheal-mcp"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"selfheal-mcp": {
"command": "npx",
"args": [
"-y",
"selfheal-mcp"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"selfheal-mcp": {
"command": "npx",
"args": [
"-y",
"selfheal-mcp"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"selfheal-mcp": {
"command": "npx",
"args": [
"-y",
"selfheal-mcp"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"selfheal-mcp": {
"type": "local",
"command": "npx",
"args": [
"-y",
"selfheal-mcp"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"selfheal-mcp": {
"command": {
"path": "npx",
"args": [
"-y",
"selfheal-mcp"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y selfheal-mcpRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
4 tools
SelfHeal MCP exposes 4 tools to a connected agent.
- wrap_call
- Execute HTTP call with retry + circuit breaker
- circuit_status
- Check health of any target
- circuit_reset
- Reset circuit breaker after fixing issues
- recent_errors
- Recent failures with full details
Score
58 / 100
Adequate
- Documentation21/25
- Maintenance13/25
- Trust6/20
- Capability6/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 147 days ago
- Has a release history
- Repository is not archived
- No licence detected
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 4 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
Version history
| Versions | Published |
|---|---|
| 0.1.1Latest | Apr 6, 2026 |