mcpField
S
SelfHeal MCP

SelfHeal MCP

Local
freedomengineers.techDeveloper Tools0Updated 30w ago

About SelfHeal MCP

SelfHeal MCP is a proxy for MCP servers that adds retries, circuit breakers, and call metrics. It is intended for agent setups that need to handle transient failures and inspect target health.

Key features

  1. 01Retry transient failures with backoff
  2. 02Protect targets with circuit breakers
  3. 03Track call success, latency, and errors
  4. 04Proxy existing MCP servers
  5. 05Inspect and reset circuit status

Use cases

  1. 01Reduce interruptions from flaky API calls
  2. 02Expose an existing MCP server through a proxy
  3. 03Review call metrics and recent failures

MCP support

In proxy mode, it wraps existing MCP servers and re-exposes their tools with retry and circuit-breaker handling. Its own MCP tools provide HTTP calls, circuit controls, metrics, and recent error details.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"carsonroell-debug-selfheal": {
"command": "npx",
"args": [
"-y",
"selfheal-mcp"
],
"env": {
"SELFHEAL_CONFIG": "<SELFHEAL_CONFIG>",
"SELFHEAL_MAX_RETRIES": "<SELFHEAL_MAX_RETRIES>",
"SELFHEAL_CIRCUIT_THRESHOLD": "<SELFHEAL_CIRCUIT_THRESHOLD>"
}
}
}
}
Run commandnpx -y selfheal-mcp
Environment variables to set
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)

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmselfheal-mcp0.1.1

Tools

5

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
urlstringNoURL to call (for HTTP targets)
bodystringNoRequest body (for POST/PUT/PATCH)
methodenumNoHTTP method (default: GET)GET | POST | PUT | PATCH | DELETE
targetstringYesIdentifier for the target service (used for circuit breaker tracking)
headersobjectNoHTTP headers
timeoutMsnumberNoTimeout per attempt in ms (default: 30000)
descriptionstringYesHuman-readable description of what this call does

Details

From the project README

SelfHeal MCP

npm License: MIT MCPize

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

ToolDescription
wrap_callExecute HTTP call with retry + circuit breaker
circuit_statusCheck health of any target
circuit_resetReset circuit breaker after fixing issues
metricsSuccess rates, latency, top errors
recent_errorsRecent failures with full details
Proxy Mode Adds
ToolDescription
selfheal_metricsMetrics for all proxied calls
selfheal_circuitsCircuit status for all targets
selfheal_recent_errorsRecent errors across all targets

Configuration

Environment Variables
VariableDefaultDescription
SELFHEAL_CONFIG./selfheal.config.jsonConfig file path
SELFHEAL_MAX_RETRIES3Max retry attempts
SELFHEAL_BASE_DELAY_MS1000Base delay for backoff
SELFHEAL_MAX_DELAY_MS30000Max delay cap
SELFHEAL_CIRCUIT_THRESHOLD5Failures before circuit opens
SELFHEAL_CIRCUIT_COOLDOWN_MS120000Cooldown before half-open test

How It Works

Agent → SelfHeal MCP → [Retry + Circuit Breaker] → Target API/MCP Server
                ↓
          Metrics Collector
  1. Request arrives — Agent calls a tool
  2. Circuit check — If target has failed too many times, reject immediately
  3. Execute with retry — Try the call, retry on transient errors with exponential backoff
  4. Record metrics — Log success/failure, duration, attempts
  5. 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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.