This directory contains various examples demonstrating the capabilities of the MCP Hardware Project.
- audio/ - Audio recording, playback, and processing examples
- automation/ - Automation scripts, pipelines, and workflow examples
- hardware_demos/ - Hardware integration demonstrations (LEDs, sensors, actuators)
- input_devices/ - Keyboard and mouse automation examples
- integrated_demo/ - Complex demos integrating multiple features
- ollama_integration/ - Examples showing integration with Ollama LLM
- rpi_control/ - Raspberry Pi GPIO and hardware control demonstrations
- security/ - Security systems and monitoring examples
- server/ - Server startup and configuration examples
- shell_cli/ - Shell CLI interface examples
- tts/ - Text-to-speech examples
- voice_assistant/ - Voice control and voice assistant implementations
Each subdirectory contains its own README with specific instructions and explanations.
To run any example, navigate to its directory and execute the Python script:
python examples/hardware_demos/led_control.py
python examples/automation/pipeline_demo.py
python examples/server/start_server.py
Make sure you have installed the required dependencies:
pip install -e .
pip install -e ".[ollama]" # For Ollama integration examples
Most examples have multiple demos. When you run them, you'll see a menu:
$ python examples/hardware_demos/led_control.py
LED Control Demo
1. Simple blink
2. LED patterns
Select demo (1-2):
Different examples require different hardware:
- GPIO Examples: Raspberry Pi with LEDs, buttons, sensors
- Audio Examples: Microphone and speakers
- Camera Examples: USB webcam or Pi Camera
- Input Examples: Any computer with keyboard/mouse
- Permission Errors: Run with appropriate permissions for hardware access
- Missing Hardware: Some examples will simulate if hardware is not present
- Server Connection: Ensure the MCP server is running before examples
Use these examples as templates for your own automation:
- Copy a similar example
- Modify the hardware setup
- Adjust the control logic
- Add error handling as needed
For more information, see the main project documentation.