SelfHeal MCP

io.github.carsonroell-debug由 GitHub 帳號 carsonroell-debug 發布v0.1.1更新於 Oct 24, 2026

Self-healing proxy for MCP servers with retry, circuit breaker, and observability

概覽

AI 產生的概覽

本機 MCP 代理,為 HTTP 呼叫與其他 MCP 伺服器加上自動重試、斷路器保護與呼叫指標。

可以做什麼
  • 透過具備重試與斷路器保護的自癒封裝發出 HTTP 請求
  • 查看某個目標的斷路器狀態,並在問題修復後重設斷路器
  • 讀取成功率、延遲與主要錯誤,並檢視近期失敗的詳細資訊
  • 在代理模式下,把設定好的 MCP 伺服器所有工具重新暴露,並附上同樣的重試、斷路器與指標能力
適用情境
當助手依賴不穩定或受速率限制的 API、MCP 伺服器,而你想在不改動原有工具的情況下取得重試、退避與故障隔離時適用。也適合用來統計這些呼叫依工具區分的成功率與延遲。
執行需求
以 stdio 在本機執行,通常用 npx selfheal-mcp 啟動,因此需要 Node.js。代理模式需要 selfheal.config.json 列出目標伺服器,並以 SELFHEAL_CONFIG 指定路徑。可選的調校變數包括 SELFHEAL_MAX_RETRIES 與 SELFHEAL_CIRCUIT_THRESHOLD。未宣告任何身分驗證。
安裝前請注意
wrap_call 工具會依助手提供的位址發出對外 HTTP 請求,因此傳入的 URL 與內容會送給該第三方。代理模式會把呼叫轉送到設定的目標伺服器。重試可能重複執行非冪等請求,寫入操作可能被執行多次。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 SelfHeal MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

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:

json
{  "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:

json
{  "mode": "proxy",  "targets": [    {      "name": "my-server",      "transport": "streamable-http",      "url": "https://my-mcp-server.com/mcp"    }  ]}
json
{  "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

bash
npx selfheal-mcp

PyPI

Not applicable — this is a TypeScript server. For Python alternatives, see LeadEnrich MCP.

License

MIT — Built by Freedom Engineers

Related

來源:README.md,提交 cb405ae

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。