Skip to main content

/mcp-health - MCP Tool Health Check

Health check for all 9 CODITECT MCP tools. Verifies server availability, database connectivity, tool counts, and backend status.

System Prompt

EXECUTION DIRECTIVE: When /mcp-health is invoked, IMMEDIATELY execute the MCP health check script.

Usage

/mcp-health              # Full health check of all MCP tools
/mcp-health --quick # Quick check (server availability only)
/mcp-health --json # JSON output for automation
/mcp-health --verbose # Detailed output with tool listings
/mcp-health --fix # Attempt to fix common issues (restart servers, recreate indexes)
/mcp-health --risk <fn> # Run risk assessment for a specific function

Execution

# Run the health check script
python3 ~/.coditect/scripts/mcp-health-check.py

# Quick mode
python3 ~/.coditect/scripts/mcp-health-check.py --quick

# JSON output
python3 ~/.coditect/scripts/mcp-health-check.py --json

# Verbose with tool listing
python3 ~/.coditect/scripts/mcp-health-check.py --verbose

# Fix mode
python3 ~/.coditect/scripts/mcp-health-check.py --fix

# Risk assessment shortcut
python3 ~/.coditect/scripts/mcp-health-check.py --risk process_payment

Health Categories

1. Server Availability

ServerCheckExpected
mcp-semantic-searchImport + stats8 tools, databases accessible
mcp-call-graphImport + stats7 tools, tree-sitter available
mcp-impact-analysisImport + stats5 tools, call graph indexed
mcp-context-graphImport + stats17 tools, kg_nodes populated
mcp-cross-llm-bridgeImport + stats15 tools
mcp-skill-serverImport + stats18 tools, skills directory found
mcp-unified-gatewayImport + list74 tools, 8 backends
mcp-backupImport + validate5 tools, GCS accessible
transcript-normalizationImport checkCLI available

2. Database Connectivity

DatabaseCheckExpected
org.dbRead kg_nodes count> 0 nodes
org.dbRead decisions count> 0 decisions
org.dbRead error_solutions count> 0 solutions
sessions.dbRead messages count> 0 messages
sessions.dbRead embeddings count> 0 embeddings
call_graph.dbRead functions count> 0 functions

3. Tool Counts

BackendExpected ToolsStatus
backup5Verify all 5 present
call_graph7Verify all 7 present
context_graph17Verify all 17 present
cross_llm15Verify all 15 present
git_status5Verify all 5 present
impact_analysis5Verify all 5 present
semantic_search8Verify all 8 present
skill_server18Verify all 18 present

4. Dependency Health

DependencyCheckRequired By
mcp SDKimport mcpAll MCP servers
sentence-transformersimport sentence_transformerssemantic-search
tree-sitterimport tree_sittercall-graph
gcloud CLIwhich gcloudbackup

Output Format

MCP Tool Health Check
=====================

Server Availability:
[OK] mcp-semantic-search 8 tools, 143K embeddings
[OK] mcp-call-graph 7 tools, 2,341 functions indexed
[OK] mcp-impact-analysis 5 tools, risk engine ready
[OK] mcp-context-graph 17 tools, 16,932 kg nodes
[OK] mcp-cross-llm-bridge 15 tools, 5 providers configured
[OK] mcp-skill-server 18 tools, 315 skills
[OK] mcp-unified-gateway 74 tools, 8 backends
[OK] mcp-backup 5 tools, GCS connected
[OK] transcript-norm CLI available

Database Health:
[OK] org.db 16,932 nodes, 7,118 edges, 1,856 decisions
[OK] sessions.db 143K embeddings, 52K messages
[OK] call_graph.db 2,341 functions, 5,892 edges

Dependencies:
[OK] mcp v0.9.2
[OK] sentence-transformers v2.2.2
[OK] tree-sitter v0.21.3
[OK] gcloud 458.0.0

Summary: 9/9 servers healthy, 3/3 databases healthy, 4/4 dependencies OK

Error Output Examples

Server Availability:
[OK] mcp-semantic-search 8 tools
[!!] mcp-call-graph FAILED: tree-sitter not installed
[OK] mcp-impact-analysis 5 tools (degraded: call graph unavailable)
...

Fix suggestions:
1. Install tree-sitter: pip install tree-sitter tree-sitter-python
2. Re-index call graph: python3 ~/.coditect/tools/mcp-call-graph/server.py index ~/.coditect/scripts
  • /health-check — General system health (Python, Node, Docker)
  • /health-status — Agent health monitoring (ADR-110)
  • /orient — Session orientation with tool discovery
  • Script: scripts/mcp-health-check.py
  • Guide: docs/guides/MCP-TOOLS-QUICKSTART.md
  • Tools: tools/mcp-*/ (all 9 MCP tools)
  • Hooks: hooks/mcp-auto-risk-assessment.py, hooks/mcp-blast-radius-warn.py