Skip to content

Commit e8495aa

Browse files
authored
feat: add MCP health-check hook (anomalyco#711)
1 parent 3507115 commit e8495aa

4 files changed

Lines changed: 920 additions & 0 deletions

File tree

‎hooks/hooks.json‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@
9595
}
9696
],
9797
"description": "Capture governance events (secrets, policy violations, approval requests). Enable with ECC_GOVERNANCE_CAPTURE=1"
98+
},
99+
{
100+
"matcher": "*",
101+
"hooks": [
102+
{
103+
"type": "command",
104+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/run-with-flags.js\" \"pre:mcp-health-check\" \"scripts/hooks/mcp-health-check.js\" \"standard,strict\""
105+
}
106+
],
107+
"description": "Check MCP server health before MCP tool execution and block unhealthy MCP calls"
98108
}
99109
],
100110
"PreCompact": [
@@ -210,6 +220,18 @@
210220
"description": "Capture tool use results for continuous learning"
211221
}
212222
],
223+
"PostToolUseFailure": [
224+
{
225+
"matcher": "*",
226+
"hooks": [
227+
{
228+
"type": "command",
229+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/run-with-flags.js\" \"post:mcp-health-check\" \"scripts/hooks/mcp-health-check.js\" \"standard,strict\""
230+
}
231+
],
232+
"description": "Track failed MCP tool calls, mark unhealthy servers, and attempt reconnect"
233+
}
234+
],
213235
"Stop": [
214236
{
215237
"matcher": "*",

0 commit comments

Comments
 (0)