sandraschi/tapo-camera-mcp
If you are the rightful owner of tapo-camera-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Tapo Camera MCP is a FastMCP 2.10-compliant server designed to control TP-Link Tapo cameras, offering a unified interface for seamless integration with other MCP-compliant systems.
Tapo Camera MCP Server
A FastMCP 2.12.0-compliant MCP server for TP-Link Tapo cameras, providing a unified interface for camera control and monitoring through the MCP protocol.
š Gold Status Achievement
This project has achieved Gold Status on Glama.ai, the premier MCP server directory, with a perfect quality score of 85/100 points. This certification represents:
- ā Production Ready: Enterprise-grade MCP server
- ā Quality Validated: Comprehensive testing and documentation
- ā Security Compliant: Automated vulnerability scanning
- ā Professional Standards: Full CI/CD pipeline and structured logging
Platform Recognition: Featured in Glama.ai's directory of 5,000+ MCP servers with premium placement and enterprise credibility.
š Features
š· Supported Camera Types
- Tapo Cameras: Full support for TP-Link Tapo series
- Webcams: Basic support for local webcams
- Ring Cameras: Experimental support for Ring devices
- Furbo Cameras: Support for Furbo pet cameras
šÆ Core Features
- Unified Camera Interface: Consistent API across different camera types
- Modular Architecture: Easy to extend with new camera types and features
- Asynchronous I/O: Built on asyncio for high performance
- Type Annotations: Full type hints for better development experience
š„ Camera Controls
- Live Streaming: RTSP, RTMP, and HLS streaming support
- PTZ Control: Pan, tilt, and zoom (where supported)
- Motion Detection: Configurable motion detection settings
- Snapshot Capture: Capture still images from video streams
- Audio Support: Two-way audio where available
š Integrations
- Grafana Dashboards: Real-time monitoring and visualization
- MCP 2.12.0 Protocol: Seamless integration with MCP ecosystem
- REST API: HTTP endpoints for remote control and monitoring
- Web Dashboard: Real-time video streaming interface
šŗ Video Streaming Dashboard
- Live Video Streams: Real-time MJPEG streaming from USB webcams
- RTSP Integration: Direct streaming from Tapo cameras
- Dynamic Camera Management: Add/remove cameras on the fly
- Stream Controls: Start/stop streaming per camera
- Responsive Design: Works on desktop and mobile browsers
- Real-time Status: Live camera status and health monitoring
- Snapshot Capture: Instant image capture from any camera
- Multi-camera View: Grid layout for multiple camera feeds
š Development Tools
- CLI Interface: Command-line tools for administration
- Mock Camera: Simulated camera for testing
- Comprehensive Logging: Structured logging throughout codebase
- Unit Tests: Complete test suite with 100% pass rate
- CI/CD Pipeline: GitHub Actions with multi-version testing (Python 3.8-3.13)
- Security Scanning: Automated vulnerability and dependency scanning
- Code Quality: Black formatting, isort imports, mypy type checking, pylint linting
š Getting Started
Prerequisites
- Python 3.8 or higher
- pip (Python package manager)
- OpenCV (for webcam support)
- TP-Link Tapo camera(s) or USB webcam
Installation
-
Install from source (recommended):
git clone https://github.com/yourusername/tapo-camera-mcp.git cd tapo-camera-mcp pip install -e .
-
Install dependencies:
pip install -r requirements.txt
Configuration
-
Copy the example configuration file:
cp config.example.yaml config.yaml
-
Edit
config.yaml
with your camera details:cameras: living_room: type: tapo host: 192.168.1.100 username: your_username password: your_password webcam: type: webcam device_id: 0
š Usage
Starting the MCP Server
# Start MCP server for Claude Desktop integration
python -m tapo_camera_mcp.server_v2 --direct
# Start with debug logging
python -m tapo_camera_mcp.server_v2 --direct --debug
Starting the Web Dashboard
# Start the web dashboard (separate terminal)
python -m tapo_camera_mcp.web.server
# Dashboard will be available at: http://localhost:7777
Quick Start Script
# Check dependencies
python start.py check
# Test webcam
python start.py test
# Start MCP server only
python start.py mcp
# Start web dashboard only
python start.py dashboard
# Start both services
python start.py both
# Test webcam and start dashboard
python start.py webcam
Using the CLI
# List all available commands
tapo-camera-mcp --help
# Camera Management
tapo-camera-mcp camera list # List all cameras
tapo-camera-mcp camera status <camera_name> # Get camera status
tapo-camera-mcp camera info <camera_name> # Get detailed camera info
# PTZ Controls
tapo-camera-mcp camera ptz move --direction up --speed 0.5
tapo-camera-mcp camera ptz preset save --name "Home"
tapo-camera-mcp camera ptz preset goto --name "Home"
# Media Controls
tapo-camera-mcp camera snapshot # Take a snapshot
tapo-camera-mcp camera record start # Start recording
tapo-camera-mcp camera record stop # Stop recording
# System Management
tapo-camera-mcp system status # Check system status
tapo-camera-mcp system restart # Restart the server
tapo-camera-mcp system update # Update to the latest version
API Reference
Web Dashboard Endpoints
GET /
- Main dashboard pageGET /api/cameras
- Get list of all camerasGET /api/cameras/{camera_id}/stream
- Get video stream (MJPEG/RTSP)GET /api/cameras/{camera_id}/snapshot
- Get camera snapshotGET /api/status
- Get server status
MCP Tools
Camera Management
list_cameras
- List all registered camerasadd_camera
- Add a new camera to the systemconnect_camera
- Connect to a specific cameradisconnect_camera
- Disconnect from cameraget_camera_info
- Get detailed camera informationget_camera_status
- Get camera status and health
PTZ Controls
move_ptz
- Move PTZ camera (pan, tilt, zoom)get_ptz_position
- Get current PTZ positionsave_ptz_preset
- Save current position as presetrecall_ptz_preset
- Move to saved preset positiongo_to_home_ptz
- Return to home positionstop_ptz
- Stop PTZ movement
Media Operations
capture_image
- Capture still image from camerastart_recording
- Start video recordingstop_recording
- Stop video recordingget_recording_status
- Get recording status
System Management
get_system_info
- Get camera system informationreboot_camera
- Reboot the cameraget_logs
- Get system logsset_motion_detection
- Configure motion detectionset_led_enabled
- Control LED statusset_privacy_mode
- Enable/disable privacy mode
š Development
Project Structure
src/tapo_camera_mcp/
āāā core/ # Core server implementation
āāā camera/ # Camera implementations
ā āāā base.py # Base camera class
ā āāā tapo.py # Tapo camera implementation
ā āāā ...
āāā api/ # API endpoints
ā āāā v1/ # API version 1
āāā tools/ # MCP tools
ā āāā camera/ # Camera-related tools
ā āāā ptz/ # PTZ controls
ā āāā system/ # System tools
āāā web/ # Web interface
āāā cli_v2.py # Command-line interface
Setting Up Development Environment
-
Fork and clone the repository:
git clone https://github.com/yourusername/tapo-camera-mcp.git cd tapo-camera-mcp
-
Create and activate a virtual environment:
# On Windows python -m venv venv .\venv\Scripts\activate # On macOS/Linux python3 -m venv venv source venv/bin/activate
-
Install development dependencies:
pip install -e ".[dev]" pre-commit install
Running Tests
# Run unit tests with coverage
pytest tests/unit/ --cov=tapo_camera_mcp --cov-report=html
# Run all tests
pytest tests/ -v
# Run MCP protocol tests
pytest tests/test_mcp_protocol.py
# Run with specific Python version (in CI/CD)
python -m pytest --cov=tapo_camera_mcp --cov-report=xml
Code Style
This project uses black
for code formatting and isort
for import sorting. Before committing, run:
black .
isort .
pylint tapo_camera_mcp/
License
This project is licensed under the MIT License - see the file for details.
Acknowledgments
- TP-Link for their Tapo camera products
- FastMCP for the MCP protocol implementation
- aiohttp for the async HTTP client/server
- ONVIF for the camera control protocol
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.