Skip to main content
Glama
Nest Protect MCP Server

Nest Protect MCP Server

Nest Protect MCP Server

📖 Installation Guide — quick start, manual setup, and troubleshooting

CI/CD codecov Status: Production Ready

Quick Start

git clone https://github.com/sandraschi/nest-protect-mcp
cd nest-protect-mcp
just

This opens an interactive dashboard showing all available commands. Run just bootstrap to install dependencies, then just serve or just dev to start.

Manual Setup

If you don't have just installed:

Related MCP server: Nordic Thingy:52 MCP Server

Overview

The Nest Protect MCP Server is a production-ready FastMCP 3.2.0 compatible server that provides seamless integration between Google Nest Protect devices and the Model Context Protocol (MCP). It offers comprehensive monitoring and control capabilities for your Nest Protect smoke and carbon monoxide detectors through Claude Desktop and other MCP clients.

Current Status: FULLY OPERATIONAL - SOTA UPGRADE COMPLETE

  • 20 Production Tools - Complete device management suite

  • Real API Integration - No mocks, authentic Google Smart Device Management API v1

  • FastMCP 3.2.0 - Sampling, agentic workflows, prompts (skills)

  • MCPB Packaging - Claude Desktop optimized deployment

  • Python 3.10+ - Modern baseline requirements

  • OAuth 2.0 Security - Complete authentication flow with token management

  • Comprehensive Assets - 22KB prompt templates and documentation

  • Ruff Linted - 100% code quality compliance

Key Components

  1. MCP Server: Implements the Model Context Protocol (MCP) v2.13.0 standard with MCPB packaging

  2. Nest API Integration: Handles OAuth 2.0 authentication and communication with Google's Smart Device Management API v1

  3. Device Management: Provides 20 production-ready tools to discover, monitor, and control Nest Protect devices

  4. MCPB Assets: Comprehensive prompt templates (22KB) and documentation for Claude Desktop integration

Architecture

graph LR
    A[MCP Client<br/>(Claude Desktop)] <--> B[Nest Protect MCP Server]
    B <--> C[Google Nest<br/>Cloud Services]
    D[Web Interface] <--> B
    E[Container Runtime] <--> B
    F[CI/CD Pipeline] --> B
    style A fill:#f9f,stroke:#333
    style B fill:#bbf,stroke:#333
    style C fill:#bfb,stroke:#333
    style D fill:#fbf,stroke:#333
    style E fill:#fbf,stroke:#333
    style F fill:#bbf,stroke:#333

Features

Core Capabilities

  • FastMCP 3.2.0 Compliance: Sampling, agentic workflows, prompts (skills)

  • Real Nest API Integration: Authentic Google Smart Device Management API v1 calls with OAuth 2.0

  • 20 Production Tools: Complete device management and control suite

  • MCPB Packaging: Claude Desktop optimized deployment with comprehensive assets

  • State-of-the-Art Security: OAuth 2.0 authentication with automatic token refresh

Nest Protect Integration

  • Device Discovery: List all Nest Protect devices in your home

  • Real-time Status: Monitor battery, connectivity, and alarm states

  • Device Control: Hush alarms, run safety checks, adjust settings

  • Alarm Testing: Sound alarms for testing purposes

  • Event History: Access device events and activity logs

Technical Features

  • OAuth 2.0 Authentication: Secure Google API integration

  • State Management: Persistent device state and configuration

  • Error Handling: Comprehensive error reporting and recovery

  • Pydantic V2 Models: Modern data validation and serialization

  • Async/Await: Full asynchronous operation for optimal performance

Quick Start

Prerequisites

  • Python 3.10 or later

  • Google Cloud Project with Smart Device Management API enabled

  • Nest Protect devices added to your Google Home/Nest account

Authentication Setup

Before using the Nest Protect MCP server, you need to set up authentication with Google's API:

  1. Create a Google Cloud Project (if you don't have one):

    • Go to Google Cloud Console

    • Create a new project

    • Enable the Smart Device Management API

    • Configure OAuth consent screen (select "External" user type)

    • Create OAuth 2.0 credentials (Desktop app type)

    • Download the credentials as client_secret_*.json

  2. Set up environment variables in a .env file:

    # Copy the example .env file
    cp .env.example .env
    
    # Edit the .env file with your credentials
    NEST_CLIENT_ID=your_client_id
    NEST_CLIENT_SECRET=your_client_secret
    NEST_PROJECT_ID=your_project_id

Installation

Prerequisites

  • uv installed (RECOMMENDED)

  • Python 3.12+

Quick Start

Run immediately via uvx:

uvx nest-protect-mcp

Claude Desktop Integration

Add to your claude_desktop_config.json:

"mcpServers": {
  "nest-protect-mcp": {
    "command": "uv",
    "args": ["--directory", "D:/Dev/repos/nest-protect-mcp", "run", "nest-protect-mcp"]
  }
}
  1. Download the .mcpb package from GitHub Releases

  2. Drag the .mcpb file into Claude Desktop settings

  3. Install Python dependencies (run in terminal):

    pip install FastMCP 3.2.0 pydantic>=2.0.0 aiohttp>=3.8.0 httpx>=0.24.0 websockets>=11.0.0 python-dotenv>=1.0.0 tomli>=0.10.2 python-dateutil>=2.8.2 anyio>=4.5.0 structlog>=23.1.0
  4. Configure Google Nest API credentials in Claude Desktop settings:

    • nest_client_id: Your Google OAuth Client ID

    • nest_client_secret: Your Google OAuth Client Secret

    • nest_project_id: Your Google Cloud Project ID

    • nest_refresh_token: Your OAuth refresh token

  5. Start using - Claude will automatically connect to your Nest Protect devices

Installation

Prerequisites

  • uv installed (RECOMMENDED)

  • Python 3.12+

Quick Start

Run immediately via uvx:

uvx nest-protect-mcp

Claude Desktop Integration

Add to your claude_desktop_config.json:

"mcpServers": {
  "nest-protect-mcp": {
    "command": "uv",
    "args": ["--directory", "D:/Dev/repos/nest-protect-mcp", "run", "nest-protect-mcp"]
  }
}

Running the Server

# Start the server in MCP mode
python -m nest_protect_mcp

HTTP Mode (For Web Interfaces)

# Start the HTTP server on port 8000
python -m nest_protect_mcp --http

Development Mode (With Auto-Reload)

# Start in development mode with auto-reload
python -m nest_protect_mcp --reload

Docker Mode

# Run with Docker
docker run -d \
  --name nest-protect-mcp \
  -p 8080:8080 \
  -v $(pwd)/config:/app/config \
  -v $(pwd)/data:/app/data \
  sandraschi/nest-protect-mcp:latest

Available MCP Tools

The server provides 20 production-ready tools organized into categories:

Device Status Tools

  1. get_devices - Get a list of all Nest Protect devices

  2. get_device - Get detailed information about a specific device

  3. get_alarm_state - Get current alarm states and battery health

Device Control Tools

  1. silence_alarm - Hush active alarms on devices

  2. run_test - Execute device tests and diagnostics

System Status Tools

  1. Enhanced logging - Comprehensive debugging and monitoring

  2. State management - Persistent configuration and device state

MCPB Package

MCPB Deployment - State of the Art

The Nest Protect MCP server includes a production-ready MCPB package optimized for Claude Desktop and modern MCP environments:

# Download from GitHub Releases:
# nest-protect-mcp-1.0.0.mcpb

MCPB Features:

  • 20 Production Tools - Complete device management suite

  • 22KB Comprehensive Assets - Extensive prompt templates and documentation

  • FastMCP 3.2.0 - Latest MCP specification compliance

  • OAuth 2.0 Security - Secure authentication with automatic token refresh

  • Claude Desktop Optimized - Seamless drag-and-drop installation

MCPB Assets Included

The MCPB package includes comprehensive prompt templates and documentation:

Prompt Templates (22KB total)

  • system.md (8.2KB) - Comprehensive Claude Desktop integration guide

  • user.md (6.3KB) - Interactive usage examples and templates

  • examples.json (9.9KB) - Structured usage examples with 12 detailed scenarios

Visual Assets

  • icon.png - Professional branding and recognition

  • screenshots/ - Usage documentation screenshots

    • dashboard.png - Main interface overview

    • configuration.png - Setup and configuration guide

    • usage.png - Tool usage examples

Tool Categories (20 Tools)

  1. Device Status (3 tools): list_devices, get_device_status, get_device_events

  2. Device Control (5 tools): hush_alarm, run_safety_check, set_led_brightness, sound_alarm, arm_disarm_security

  3. System Status (3 tools): get_system_status, get_process_status, get_api_status

  4. Authentication (3 tools): initiate_oauth_flow, handle_oauth_callback, refresh_access_token

  5. Configuration (5 tools): get_config, update_config, reset_config, export_config, import_config

  6. Help & About (5 tools): list_available_tools, get_tool_help, search_tools, about_server, get_supported_devices

CI/CD Pipeline

Automated Workflows

The repository includes a comprehensive CI/CD pipeline with modern practices:

Quality Assurance

  • Multi-OS testing (Ubuntu, Windows, macOS)

  • Multi-Python support (3.10-3.13)

  • Security scanning (vulnerability checks)

  • Code quality analysis (mypy, bandit, radon)

  • Performance benchmarking

Automated Deployment

  • Semantic versioning with automated releases

  • PyPI publishing for stable releases

  • GitHub releases with changelog generation

  • Docker container builds (multi-architecture)

  • Documentation deployment (GitHub Pages)

Maintenance & Monitoring

  • Dependency updates (automated security patches)

  • Repository cleanup (workflow run management)

  • Notification system (Slack/Discord integration)

  • Performance tracking (benchmarking)

Modern Development Practices

Version Management

# .bumpversion.toml
[bumpversion]
current_version = 0.1.0
commit = True
tag = True

[bumpversion:file:pyproject.toml]
search = version = "{current_version}"
replace = version = "{new_version}"

Container Definition

# Multi-stage build for optimal size
FROM python:3.11-slim as base
# ... optimized production container

Package Configuration

{
  "dependencies": ["FastMCP 3.2.0,<4.0.0"],
  "configuration": {
    "nest_client_id": {"type": "string", "required": true},
    "nest_client_secret": {"type": "string", "required": true, "secret": true},
    "nest_project_id": {"type": "string", "required": true},
    "nest_refresh_token": {"type": "string", "required": true, "secret": true}
  }
}

Troubleshooting

Recent Fixes Applied

  • FastMCP 3.2.0: Sampling, agentic workflows, prompts (skills); see docs/AUTH_SETUP.md for auth.

  • MCPB Packaging: Claude Desktop optimized; run scripts/get_nest_refresh_token.py for refresh token.

  • Webapp: Onboarding page and Help modal with setup steps.

Common Issues & Solutions

Server Disconnects from Claude Desktop

Symptom: Server starts but disconnects after a few seconds Solution: Check your claude_desktop_config.json - ensure no --kill arguments:

{
  "mcpServers": {
    "nest protect": {
      "command": "py",
      "args": ["-3.13", "-m", "nest_protect_mcp"],
      "cwd": "D:/Dev/repos/nest-protect-mcp"
    }
  }
}

Authentication Issues

Symptom: "No refresh token available" or authentication errors Solution:

  1. Get a refresh token: run python scripts/get_nest_refresh_token.py (see docs/AUTH_SETUP.md)

  2. Put NEST_CLIENT_ID, NEST_CLIENT_SECRET, NEST_PROJECT_ID, NEST_REFRESH_TOKEN in .env in the repo root

  3. Ensure Smart Device Management API is enabled in Google Cloud Console

Tool Help Not Working

Symptom: "get tool help" has difficulties with parameters Solution: FIXED - Updated FastMCP tool registration with proper syntax

Device Not Found

Symptom: No devices appear in tool responses Solution:

  1. Verify devices are set up in Google Home app

  2. Check authentication permissions

  3. Restart server after authentication

Enhanced Debugging

The server now includes comprehensive logging:

 === FASTMCP SERVER INITIALIZED ===
 Tool registration complete
 Authentication state loaded
 Device discovery started

If you see errors, check the detailed logs for specific failure points.

Documentation

** Complete Documentation**

For detailed documentation, please refer to the docs directory:

** Quick Reference**

Installation

Prerequisites

  • uv installed (RECOMMENDED)

  • Python 3.12+

Quick Start

Run immediately via uvx:

uvx nest-protect-mcp

Claude Desktop Integration

Add to your claude_desktop_config.json:

"mcpServers": {
  "nest-protect-mcp": {
    "command": "uv",
    "args": ["--directory", "D:/Dev/repos/nest-protect-mcp", "run", "nest-protect-mcp"]
  }
}

Server Commands

# MCP mode (default)
python -m nest_protect_mcp

# HTTP mode
python -m nest_protect_mcp --http

# Development mode
python -m nest_protect_mcp --reload

# Help
python -m nest_protect_mcp --help

Authentication

# Start OAuth flow
python -m nest_protect_mcp.auth

# Verify authentication
python -m nest_protect_mcp --status

REST API Reference

When running in HTTP mode, the following endpoints are available:

  • GET /health - Health check

  • GET /api/devices - List all devices

  • GET /api/devices/{device_id} - Get device details

  • POST /api/devices/{device_id}/command - Send command to device

Security

  • OAuth 2.0 Authentication - Secure Google API integration

  • Token Management - Automatic refresh with secure storage

  • HTTPS Support - Optional SSL/TLS encryption

  • Input Validation - Pydantic V2 model validation

  • Security Scanning - Automated vulnerability checks

Deployment

** MCPB Package**

# Deploy MCPB package (Claude Desktop)
# Download and drag nest-protect-mcp-1.0.0.mcpb into Claude Desktop

** Docker Container**

# Run container
docker run -d \
  --name nest-protect-mcp \
  -p 8080:8080 \
  sandraschi/nest-protect-mcp:latest

** Cloud Deployment**

  • Railway - One-click deployment available

  • Heroku - Container-based deployment

  • AWS/GCP - Container orchestration support

Contributing

Contributions are welcome! Please read our Contributing Guide for details.

Development Setup

# Clone repository
git clone https://github.com/sandraschi/nest-protect-mcp.git
cd nest-protect-mcp

# Install development dependencies
uv pip install -e .[dev]

# Run tests
pytest

# Run linting
pre-commit run --all-files

Performance

  • Multi-threaded API calls for optimal performance

  • Connection pooling for efficient HTTP requests

  • State caching for reduced API calls

  • Async/await patterns for non-blocking operations

  • Memory efficient device state management

Updates & Maintenance

The repository includes automated maintenance workflows:

  • Weekly dependency updates for security patches

  • Automated testing across multiple environments

  • Performance monitoring and benchmarking

  • Documentation updates with each release

Changelog

See CHANGELOG.md for detailed version history.

Support

For support, please:

  1. Check the troubleshooting guide

  2. Search existing issues

  3. Open a new issue with detailed information

🛡️ Industrial Quality Stack

This project adheres to SOTA 14.1 industrial standards for high-fidelity agentic orchestration:

  • Python (Core): Ruff for linting and formatting. Zero-tolerance for print statements in core handlers (T201).

  • Webapp (UI): Biome for sub-millisecond linting. Strict noConsoleLog enforcement.

  • Protocol Compliance: Hardened stdout/stderr isolation to ensure crash-resistant JSON-RPC communication.

  • Automation: Justfile recipes for all fleet operations (just lint, just fix, just dev).

  • Security: Automated audits via bandit and safety.

License

MIT License - see LICENSE file for details.


Made with for the smart home community

Available Tools

32 tools
analyze_home_safetyD

Assess Home Safety AI.

Perform comprehensive safety evaluation using advanced AI orchestration and sampling patterns.

Inputs: focus_areas, assessment_scope, include_recommendations.

check_api_connectivityB

Check API Connection Health.

Verify real-time connectivity and latency to the Google Smart Device Management API.

Inputs: params (required).

configure_smart_automationC

Configure Smart Safety Automation.

Set up adaptive automation rules that learn your lifestyle patterns for proactive safety.

Inputs: automation_type (required), learning_period, confidence_threshold.

coordinate_emergency_aiC

Coordinate Emergency AI Response.

Execute intelligent coordination during safety incidents using sampling for complex decisions.

Inputs: emergency_type (required), affected_devices (required), response_priority.

export_config_fileC

Export Config To File.

Save the current active configuration to a local file in TOML or JSON format.

Inputs: params (required).

finish_google_oauthB

Complete Google OAuth Callback.

Process the authorization code and exchange it for persistent access and refresh tokens.

Inputs: params (required).

forecast_maintenance_needsB

Forecast Device Maintenance Needs.

Predict future battery replacements and sensor failures using environmental AI analysis.

Inputs: time_horizon, analysis_depth, include_cost_estimates.

get_device_healthC

Get Device Health Status.

Real-time battery, smoke, CO, and connectivity metrics with visual health indicators in chat.

Inputs: device_id (required).

get_mcp_configA

Get Current Server Configuration.

Retrieve the active configuration values for API endpoints, timeouts, and device filters.

Inputs: params (required).

get_mcp_processA

Get MCP Process Metrics.

Retrieve detailed memory and CPU consumption for the specific Nest Protect MCP process.

Inputs: params (required).

get_nest_auth_statusA

Get Nest Auth Configuration Status.

Summarize whether NEST_* credentials and tokens are loaded (masked); reads repo .env when needed.

Inputs: params (required).

get_nest_eventsB

Get Recent Device Events.

Retrieve a list of recent smoke, CO, or connectivity events for a specific device.

Inputs: params (required).

get_oauth_redirect_referenceA

Get OAuth Redirect URI Reference.

Return example redirect URIs (CLI vs web wizard), doc links, and just auth hints for PCM setup.

Inputs: params (required).

get_pcm_authorize_urlB

Get PCM Authorize URL.

Build the Partner Connections Manager authorization URL (same as start_google_oauth); optional browser.

Inputs: params (required).

get_server_infoB

Get Server Information.

Retrieve version, capabilities, and operational documentation for this Nest Protect MCP instance.

Inputs: level.

get_server_statusA

Get Server System Status.

Retrieve host CPU, memory, and disk usage metrics for the MCP server process.

Inputs: params (required).

get_tool_detailsA

Get Tool Practical Help.

Retrieve detailed parameters, usage examples, and safety constraints for a specific tool.

Inputs: params (required).

hush_active_alarmA

Silence Active Alarm Device.

Temporarily hush smoke or CO alarms for maintenance or false triggers (30-300 seconds).

Inputs: params (required).

import_config_fileA

Import Config From File.

Load configuration settings from a local file and merge them into the server state.

Inputs: params (required).

list_nest_devicesA

Discover Nest Protect Devices.

List all detectors, room locations, and online status with rich UI cards for home safety overview.

Inputs: no named parameters.

list_server_toolsB

List Available MCP Tools.

Retrieve a comprehensive list of all registered tools and their functional descriptions.

Inputs: params (required).

list_supported_hardwareB

List Supported Nest Hardware.

Retrieve detailed technical specifications for supported Nest Protect generations and models.

Inputs: params (required).

refresh_nest_tokenC

Refresh Nest Access Token.

Force or verify the renewal of the current OAuth 2.0 access token for API calls.

Inputs: params (required).

reset_mcp_configA

Reset Configuration to Defaults.

Revert all server settings to their original factory values (requires confirmation).

Inputs: params (required).

run_safety_testC

Execute Device Safety Test.

Trigger full, smoke, or CO self-tests on the device to verify alarm functionality.

Inputs: params (required).

search_mcp_toolsA

Search Tools by Keyword.

Discovery helper to find relevant tools based on name, description, or capability keywords.

Inputs: params (required).

set_device_ledA

Set Device LED Brightness.

Adjust the brightness level (0-100) of the Nest Protect status light ring.

Inputs: params (required).

set_security_modeA

Set Guard Security Mode.

Arm (home/away) or disarm the Nest security system using an optional passcode.

Inputs: params (required).

start_google_oauthB

Initiate Google OAuth Flow.

Start the secure OAuth 2.0 authorization process to link your Nest account.

Inputs: params (required).

trigger_test_alarmA
🚨 **Test Alarm Systems (Use Responsibly!)**

Trigger real alarm sounds on your Nest Protect devices for testing purposes.

**⚠️ IMPORTANT SAFETY NOTES:**
• Only use for testing and maintenance
• Warn household members before testing
• Verify alarms work properly in emergencies
• Keep duration short to avoid false emergency responses

**Alarm Types:**
• 🔥 **Smoke**: Fire detection alarm (loud, pulsing)
• ☁️ **CO**: Carbon monoxide alarm (distinct pattern)
• 🔒 **Security**: Intrusion/breach alarm (continuous)
• 🆘 **Emergency**: Panic button (immediate response)

**Parameters:**
• device_id: Target Nest Protect device ID (enterprises/project-id/devices/device-id)
• alarm_type: Type of alarm (smoke, co, security, emergency) - default: smoke
• duration_seconds: How long to sound alarm (5-60 seconds) - default: 10
• volume: Alarm volume percentage (50-100%) - default: 100

Inputs: device_id (required), volume, alarm_type, duration_seconds.

update_mcp_configA

Update Server Configuration Values.

Modify active settings and optionally persist them to the config.toml file.

Inputs: params (required).

validate_nest_credentialsA

Validate Nest SDM Credentials.

Optionally refresh the access token, then call SDM devices?pageSize=1 to verify the stack works.

Inputs: params (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 32 tools

    Disambiguation3/5

    Several tools have overlapping purposes, particularly the AI-related tools (analyze_home_safety, coordinate_emergency_ai, forecast_maintenance_needs, configure_smart_automation) which are vaguely described and difficult to distinguish. Additionally, there are multiple OAuth and configuration tools that, while distinct, could confuse agents due to their number.

    Naming Consistency5/5

    All 32 tools follow a consistent verb_noun pattern in snake_case (e.g., list_nest_devices, get_device_health, hush_active_alarm). The naming is predictable and clear across the entire set.

    Tool Count2/5

    With 32 tools, the server has far more than is typical for a focused home safety domain. Many tools are meta or overlap, suggesting scope creep. This exceeds the recommended range and may overwhelm agents.

    Completeness3/5

    The server covers device management, OAuth, configuration, and system info reasonably well, but includes vague AI features that are not clearly integrated. Missing essential operations like firmware update or device removal, and includes an out-of-scope security mode tool.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      A production-ready Model Context Protocol (MCP) server that enables Claude to control Philips Hue lights through natural language commands.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that integrates popular productivity tools like Gmail, Google Calendar, Google Drive, Google Sheets, Notion, and Microsoft Outlook, allowing Claude Desktop to interact with them via natural language commands.
      -
    • A
      license
      A
      quality
      C
      maintenance
      An MCP server that enables Claude to control SmartRent smart home devices such as locks, thermostats, light switches, and sensors through natural conversation.
      5
      MIT