--- layout: default title: Quick Start parent: Getting Started nav_order: 2 --- # Quick Start Guide 🚀 This guide will help you get started with MCP Server after installation. We'll cover basic usage, common commands, and simple integrations. ## First Steps ### 1. Verify Connection After installation, verify your MCP Server is running and connected to Home Assistant: ```bash # Check server health curl http://localhost:3000/health # Verify Home Assistant connection curl http://localhost:3000/api/state ``` ### 2. Basic Voice Commands Try these basic voice commands to test your setup: ```bash # Example using curl for testing curl -X POST http://localhost:3000/api/command \ -H "Content-Type: application/json" \ -d '{"command": "Turn on the living room lights"}' ``` Common voice commands: - "Turn on/off [device name]" - "Set [device] to [value]" - "What's the temperature in [room]?" - "Is [device] on or off?" ## Real-World Examples ### 1. Smart Lighting Control ```javascript // Browser example using fetch const response = await fetch('http://localhost:3000/api/command', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ command: 'Set living room lights to 50% brightness and warm white color' }) }); ``` ### 2. Real-Time Updates Subscribe to device state changes using Server-Sent Events (SSE): ```javascript const eventSource = new EventSource('http://localhost:3000/subscribe_events?token=YOUR_TOKEN&domain=light'); eventSource.onmessage = (event) => { const data = JSON.parse(event.data); console.log('Device state changed:', data); // Update your UI here }; ``` ### 3. Scene Automation Create and trigger scenes for different activities: ```javascript // Create a "Movie Night" scene const createScene = async () => { await fetch('http://localhost:3000/api/scene', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ name: 'Movie Night', actions: [ { device: 'living_room_lights', action: 'dim', value: 20 }, { device: 'tv', action: 'on' }, { device: 'soundbar', action: 'on' } ] }) }); }; // Trigger the scene with voice command: // "Hey MCP, activate movie night scene" ``` ## Integration Examples ### 1. Web Dashboard Integration ```javascript // React component example function SmartHomeControl() { const [devices, setDevices] = useState([]); useEffect(() => { // Subscribe to device updates const events = new EventSource('http://localhost:3000/subscribe_events'); events.onmessage = (event) => { const data = JSON.parse(event.data); setDevices(currentDevices => currentDevices.map(device => device.id === data.id ? {...device, ...data} : device ) ); }; return () => events.close(); }, []); return (