mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-06 05:23:08 +00:00
Enhanced health check and diagnostic tools with environment-specific troubleshooting guidance based on telemetry analysis of 632K events from 5,308 users. Key improvements: - Environment-aware debugging suggestions for http/stdio modes - Docker-specific troubleshooting when IS_DOCKER=true - Cloud platform detection (Railway, Render, Fly, Heroku, AWS, K8s, GCP, Azure) - Platform-specific configuration paths (macOS, Windows, Linux) - MCP_MODE and platform tracking in telemetry events - Comprehensive integration tests for environment detection Addresses 59% session abandonment by providing actionable, context-specific next steps based on user's deployment environment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
86 lines
4.1 KiB
TypeScript
86 lines
4.1 KiB
TypeScript
import { ToolDocumentation } from '../types';
|
|
|
|
export const n8nHealthCheckDoc: ToolDocumentation = {
|
|
name: 'n8n_health_check',
|
|
category: 'system',
|
|
essentials: {
|
|
description: 'Check n8n instance health, API connectivity, version status, and performance metrics',
|
|
keyParameters: [],
|
|
example: 'n8n_health_check({})',
|
|
performance: 'Fast - single API call (~150-200ms median)',
|
|
tips: [
|
|
'Use before starting workflow operations to ensure n8n is responsive',
|
|
'Automatically checks if n8n-mcp version is outdated',
|
|
'Returns version info, performance metrics, and next-step recommendations',
|
|
'New: Shows cache hit rate and response time for performance monitoring'
|
|
]
|
|
},
|
|
full: {
|
|
description: `Performs a comprehensive health check of the configured n8n instance through its API.
|
|
|
|
This tool verifies:
|
|
- API endpoint accessibility and response time
|
|
- n8n instance version and build information
|
|
- Authentication status and permissions
|
|
- Available features and enterprise capabilities
|
|
- Database connectivity (as reported by n8n)
|
|
- Queue system status (if configured)
|
|
|
|
Health checks are crucial for:
|
|
- Monitoring n8n instance availability
|
|
- Detecting performance degradation
|
|
- Verifying API compatibility before operations
|
|
- Ensuring authentication is working correctly`,
|
|
parameters: {},
|
|
returns: `Health status object containing:
|
|
- status: Overall health status ('healthy', 'degraded', 'error')
|
|
- n8nVersion: n8n instance version information
|
|
- instanceId: Unique identifier for the n8n instance
|
|
- features: Object listing available features and their status
|
|
- mcpVersion: Current n8n-mcp version
|
|
- supportedN8nVersion: Recommended n8n version for compatibility
|
|
- versionCheck: Version status information
|
|
- current: Current n8n-mcp version
|
|
- latest: Latest available version from npm
|
|
- upToDate: Boolean indicating if version is current
|
|
- message: Formatted version status message
|
|
- updateCommand: Command to update (if outdated)
|
|
- performance: Performance metrics
|
|
- responseTimeMs: API response time in milliseconds
|
|
- cacheHitRate: Cache efficiency percentage
|
|
- cachedInstances: Number of cached API instances
|
|
- nextSteps: Recommended actions after health check
|
|
- updateWarning: Warning if version is outdated (if applicable)`,
|
|
examples: [
|
|
'n8n_health_check({}) - Complete health check with version and performance data',
|
|
'// Use in monitoring scripts\nconst health = await n8n_health_check({});\nif (health.status !== "ok") alert("n8n is down!");\nif (!health.versionCheck.upToDate) console.log("Update available:", health.versionCheck.updateCommand);',
|
|
'// Check before critical operations\nconst health = await n8n_health_check({});\nif (health.performance.responseTimeMs > 1000) console.warn("n8n is slow");\nif (health.versionCheck.isOutdated) console.log(health.updateWarning);'
|
|
],
|
|
useCases: [
|
|
'Pre-flight checks before workflow deployments',
|
|
'Continuous monitoring of n8n instance health',
|
|
'Troubleshooting connectivity or performance issues',
|
|
'Verifying n8n version compatibility with workflows',
|
|
'Detecting feature availability (enterprise features, queue mode, etc.)'
|
|
],
|
|
performance: `Fast response expected:
|
|
- Single HTTP request to /health endpoint
|
|
- Typically responds in <100ms for healthy instances
|
|
- Timeout after 10 seconds indicates severe issues
|
|
- Minimal server load - safe for frequent polling`,
|
|
bestPractices: [
|
|
'Run health checks before batch operations or deployments',
|
|
'Set up automated monitoring with regular health checks',
|
|
'Log response times to detect performance trends',
|
|
'Check version compatibility when deploying workflows',
|
|
'Use health status to implement circuit breaker patterns'
|
|
],
|
|
pitfalls: [
|
|
'Requires N8N_API_URL and N8N_API_KEY to be configured',
|
|
'Network issues may cause false negatives',
|
|
'Does not check individual workflow health',
|
|
'Health endpoint might be cached - not real-time for all metrics'
|
|
],
|
|
relatedTools: ['n8n_diagnostic', 'n8n_list_available_tools', 'n8n_list_workflows']
|
|
}
|
|
}; |