Troubleshooting Guide 🔧
This guide helps you diagnose and resolve common issues with MCP Server.
Quick Diagnostics
Health Check
First, verify the server's health:
Expected response:
{
"status": "healthy",
"version": "1.0.0",
"uptime": 3600,
"homeAssistant": {
"connected": true,
"version": "2024.1.0"
}
}
Common Issues
1. Connection Issues
Cannot Connect to MCP Server
Symptoms: - Server not responding - Connection refused errors - Timeout errors
Solutions:
-
Check if the server is running:
-
Verify port availability:
-
Check logs:
Home Assistant Connection Failed
Symptoms: - "Connection Error" in health check - Cannot control devices - State updates not working
Solutions:
-
Verify Home Assistant URL and token in
.env
: -
Test Home Assistant connection:
-
Check network connectivity:
2. Authentication Issues
Invalid Token
Symptoms: - 401 Unauthorized responses - "Invalid token" errors
Solutions:
-
Generate a new token:
-
Verify token format:
Rate Limiting
Symptoms: - 429 Too Many Requests - "Rate limit exceeded" errors
Solutions:
-
Check current rate limit status:
-
Adjust rate limits in configuration:
3. Real-time Updates Issues
SSE Connection Drops
Symptoms: - Frequent disconnections - Missing state updates - EventSource errors
Solutions:
-
Implement proper reconnection logic:
class SSEClient { constructor() { this.connect(); } connect() { this.eventSource = new EventSource('/subscribe_events'); this.eventSource.onerror = this.handleError.bind(this); } handleError(error) { console.error('SSE Error:', error); this.eventSource.close(); setTimeout(() => this.connect(), 1000); } }
-
Check network stability:
4. Performance Issues
High Latency
Symptoms: - Slow response times - Command execution delays - UI lag
Solutions:
-
Enable Redis caching:
-
Monitor system resources:
-
Optimize database queries and caching:
5. Device Control Issues
Commands Not Executing
Symptoms: - Commands appear successful but no device response - Inconsistent device states - Error messages from Home Assistant
Solutions:
-
Verify device availability:
-
Check command syntax:
-
Review Home Assistant logs:
Debugging Tools
Log Analysis
Enable debug logging:
Network Debugging
Monitor network traffic:
Performance Profiling
Enable performance monitoring:
Getting Help
If you're still experiencing issues:
- Check the GitHub Issues
- Search Discussions
- Create a new issue with:
- Detailed description
- Logs
- Configuration (sanitized)
- Steps to reproduce
Maintenance
Regular Health Checks
Run periodic health checks:
Log Rotation
Configure log rotation:
Backup Configuration
Regularly backup your configuration:
FAQ
General Questions
Q: What is MCP Server?
A: MCP Server is a bridge between Home Assistant and Language Learning Models, enabling natural language control and automation of your smart home devices.
Q: What are the system requirements?
A: MCP Server requires: - Node.js 16 or higher - Home Assistant instance - 1GB RAM minimum - 1GB disk space
Q: How do I update MCP Server?
A: For Docker installation:
For manual installation:Integration Questions
Q: Can I use MCP Server with any Home Assistant instance?
A: Yes, MCP Server works with any Home Assistant instance that has the REST API enabled and a valid long-lived access token.
Q: Does MCP Server support all Home Assistant integrations?
A: MCP Server supports all Home Assistant devices and services that are accessible via the REST API.
Security Questions
Q: Is my Home Assistant token secure?
A: Yes, your Home Assistant token is stored securely and only used for authenticated communication between MCP Server and your Home Assistant instance.
Q: Can I use MCP Server remotely?
A: Yes, but we recommend using a secure connection (HTTPS) and proper authentication when exposing MCP Server to the internet.
Troubleshooting Questions
Q: Why are my device states not updating?
A: Check: 1. Home Assistant connection 2. WebSocket connection status 3. Device availability in Home Assistant 4. Network connectivity
Q: Why are my commands not working?
A: Verify: 1. Command syntax 2. Device availability 3. User permissions 4. Home Assistant API access