- Reorganize MkDocs navigation structure with new sections - Add configuration, security, and development environment documentation - Remove outdated development and getting started files - Update requirements and plugin configurations - Improve overall documentation layout and content
2.2 KiB
2.2 KiB
System Configuration
This document provides detailed information about configuring the Home Assistant MCP Server.
Configuration File Structure
The MCP Server uses a hierarchical configuration structure:
server:
host: 0.0.0.0
port: 8123
log_level: INFO
security:
jwt_secret: YOUR_SECRET_KEY
allowed_origins:
- http://localhost:3000
- https://your-domain.com
devices:
scan_interval: 30
default_timeout: 10
Server Settings
Basic Server Configuration
host: Server binding address (default: 0.0.0.0)port: Server port number (default: 8123)log_level: Logging level (INFO, DEBUG, WARNING, ERROR)
Security Settings
jwt_secret: Secret key for JWT token generationallowed_origins: CORS allowed origins listssl_cert: Path to SSL certificate (optional)ssl_key: Path to SSL private key (optional)
Device Management
scan_interval: Device state scan interval in secondsdefault_timeout: Default device command timeoutretry_attempts: Number of retry attempts for failed commands
Environment Variables
Environment variables override configuration file settings:
MCP_HOST=0.0.0.0
MCP_PORT=8123
MCP_LOG_LEVEL=INFO
MCP_JWT_SECRET=your-secret-key
Advanced Configuration
Rate Limiting
rate_limit:
enabled: true
requests_per_minute: 100
burst: 20
Caching
cache:
enabled: true
ttl: 300 # seconds
max_size: 1000 # entries
Logging
logging:
file: /var/log/mcp-server.log
max_size: 10MB
backup_count: 5
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
Best Practices
- Always use environment variables for sensitive information
- Keep configuration files in a secure location
- Regularly backup your configuration
- Use SSL in production environments
- Monitor log files for issues
Validation
The server validates configuration on startup:
- Required fields are checked
- Value types are verified
- Ranges are validated
- Security settings are assessed
Troubleshooting
Common configuration issues:
- Permission denied accessing files
- Invalid YAML syntax
- Missing required fields
- Type mismatches in values
See the Troubleshooting Guide for solutions.