Skip to content

Add Home Security MCP Server for cameras and smart locks#3

Draft
nfaggian wants to merge 1 commit into
mainfrom
cursor/home-automation-mcp-f9c4
Draft

Add Home Security MCP Server for cameras and smart locks#3
nfaggian wants to merge 1 commit into
mainfrom
cursor/home-automation-mcp-f9c4

Conversation

@nfaggian

@nfaggian nfaggian commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

This PR implements a comprehensive MCP (Model Context Protocol) server for home security automation, enabling AI agents to manage security cameras and smart door locks.

Features

Camera Management

  • Device Management: List and manage multiple security cameras
  • Recording: Start/stop recording, capture snapshots
  • Motion Detection: Configure with sensitivity levels (low/medium/high)
  • Streaming: Get RTSP streaming URLs
  • History: View motion events and recordings
  • Storage: Monitor storage usage and limits

Smart Lock Management

  • Remote Control: Lock/unlock front door remotely
  • PIN Access: Code validation with secure hashing
  • Access Codes: Add, remove, deactivate temporary codes
  • Scheduling: Time-restricted and one-time codes
  • Audit Trail: Complete access logging
  • Auto-lock: Configurable automatic locking
  • Alerts: Tamper detection and battery monitoring

Security Features

  • Centralized alert system across all devices
  • Multiple failed attempt detection
  • Event acknowledgment workflow
  • Secure code storage (SHA-256 hashed)

MCP Server

  • Built with FastMCP for clean tool/resource definitions
  • Supports both stdio (local) and SSE (remote) transports
  • 10 resource endpoints for data queries
  • 20+ tools for device actions
  • Pre-defined prompts for common tasks (security check, vacation prep, guest access)

Files Changed

File Description
src/mcp_servers/home_security/server.py Main MCP server with all tools and resources
src/mcp_servers/home_security/camera.py Camera management logic
src/mcp_servers/home_security/lock.py Smart lock management logic
src/mcp_servers/home_security/models.py Data models (Camera, Lock, Events, etc.)
tests/test_home_security_mcp.py Comprehensive test suite (37 tests)
README.md Updated documentation
pyproject.toml Added mcp dependency, Python 3.12+ support

Usage

# Run with stdio transport (for local LLM clients)
python -m src.mcp_servers.home_security.server

# Run with SSE transport (for remote access)
python -m src.mcp_servers.home_security.server --transport sse --port 8000

Claude Desktop Integration

{
  "mcpServers": {
    "home-security": {
      "command": "python",
      "args": ["-m", "src.mcp_servers.home_security.server"],
      "cwd": "/path/to/this/project"
    }
  }
}

Testing

All 37 tests pass:

  • 14 Camera manager tests
  • 19 Smart lock manager tests
  • 4 Model tests
python -m pytest tests/test_home_security_mcp.py -v

Demo Data

The server includes demo devices for testing:

  • 4 cameras: Front Door (4K), Backyard, Garage, Driveway
  • 1 smart lock: Front Door Lock with master and guest codes
Open in Web Open in Cursor 

Implements a comprehensive MCP (Model Context Protocol) server for home
security automation with the following features:

Cameras:
- List and manage multiple security cameras
- Start/stop recording, capture snapshots
- Configure motion detection with sensitivity levels
- Get streaming URLs (RTSP)
- View motion events and recordings
- Storage management

Smart Locks:
- Lock/unlock front door remotely
- PIN code access with validation
- Manage access codes (add, remove, deactivate)
- Time-restricted and one-time codes
- Access logging with audit trail
- Auto-lock configuration
- Tamper detection alerts
- Battery status monitoring

Security:
- Centralized alert system
- Multiple failed attempt detection
- Event acknowledgment workflow

Server:
- FastMCP-based with tools and resources
- Supports stdio and SSE transports
- Pre-defined prompts for common tasks
- Demo data for testing

Also includes:
- Comprehensive test suite (37 tests)
- Updated README with usage documentation
- Python 3.12+ support

Co-authored-by: Nathan Faggian <nathan.faggian@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants