google-home-blade-mcp
Security-first, token-efficient MCP server for Google Home and Nest devices via the Smart Device Management API.
Control thermostats, stream cameras, monitor doorbells, and pull device events — all through a hardened MCP interface designed for LLM-driven home automation.
Why This Exists
| ghome-mcp-server | Google's Cloud MCPs | google-home-blade-mcp | |
|---|---|---|---|
| Device coverage | Smart plugs only | No Google Home MCP | Full SDM: thermostats, cameras, doorbells, displays |
| Security model | None | IAM-only | Write gates + confirm gates + credential scrubbing |
| Token efficiency | Verbose JSON | N/A | Pipe-delimited, null-omission, ~25 tokens/device |
| Thermostat control | No | No | Mode, setpoint, eco, fan — all with safety gates |
| Camera streams | No | No | WebRTC/RTSP with 5-min session management |
| Event streaming | No | No | Pub/Sub integration for motion, person, doorbell events |
| Batch operations | No | N/A | ghome_status dashboard, ghome_thermostats overview |
| Marketplace ready | No | No | stallari-plugin.yaml, home-v1 contract, SKILL.md |
Design Principles
- Security-first — Every device command requires explicit write enablement. Destructive operations require double confirmation. OAuth tokens never appear in output. Access tokens live in memory only.
- Token efficiency — Compact pipe-delimited output. Null fields omitted. Dashboard views compress entire device fleets into minimal tokens. One
ghome_statuscall replaces N individual queries. - Event-driven — Pub/Sub integration enables webhook-style triggers for motion detection, doorbell presses, and state changes. No polling required.
Quick Start
# Install
git clone https://github.com/groupthink-dev/google-home-blade-mcp.git
cd google-home-blade-mcp
make install-dev
# Set up OAuth (one-time interactive flow)
export GOOGLE_HOME_CLIENT_ID="your-client-id"
export GOOGLE_HOME_CLIENT_SECRET="your-client-secret"
export GOOGLE_HOME_PROJECT_ID="your-sdm-project-id"
make auth
# → Opens browser → Google consent → prints refresh token
# Configure
export GOOGLE_HOME_REFRESH_TOKEN="the-refresh-token-from-above"
export GOOGLE_HOME_WRITE_ENABLED=true # optional: enable device commands
# Run
make run
Prerequisites
- Google Cloud project with Smart Device Management API enabled
- Device Access Console registration at console.nest.google.com/device-access ($5 USD one-time fee)
- OAuth 2.0 credentials (Web application type) in GCP Console
- At least one Nest device linked to your Google account
Tools (15)
Read (8 tools)
| Tool | Purpose | Tokens |
|---|---|---|
ghome_info |
Health check: API status, device counts, write gate | ~30 |
ghome_structures |
List homes | ~15/structure |
ghome_rooms |
List rooms in a structure | ~10/room |
ghome_devices |
List all devices (filterable by type) | ~25/device |
ghome_device |
Full device detail with all traits | ~80-120 |
ghome_status |
Compact dashboard — all devices, one line each | ~25/device |
ghome_thermostats |
All thermostats at a glance | ~30/thermostat |
ghome_events |
Pull recent events from Pub/Sub | ~20/event |
Write (7 tools, gated)
| Tool | Purpose | Gate |
|---|---|---|
ghome_thermostat_mode |
Set mode: HEAT, COOL, HEATCOOL, OFF | write |
ghome_thermostat_setpoint |
Set target temperature (heat, cool, or range) | write |
ghome_thermostat_eco |
Toggle eco mode | write |
ghome_fan_set |
Fan timer control | write |
ghome_camera_stream |
Generate live stream URL (WebRTC/RTSP) | write |
ghome_camera_image |
Get snapshot from camera event | write |
ghome_command |
Execute any SDM command (escape hatch) | write + confirm |
Output Format
Token-efficient pipe-delimited output with null-field omission:
# ghome_status
## Devices: 4 total, 4 online
Living Room | Thermostat | room=Living Room | online | 21.5°C | mode=HEAT | hvac=HEATING | id=abc123
Master Bedroom | Thermostat | room=Bedroom | online | 19.8°C | mode=ECO | hvac=OFF | id=def456
Front Door | Doorbell | room=Entry | online | events=motion,person,chime | id=ghi789
Garden | Camera | room=Outdoor | online | events=motion,person | id=jkl012
# ghome_thermostats
Living Room | Living Room | ambient=21.5°C | humidity=45% | mode=HEAT | heat→22.0°C | hvac=HEATING | online | id=abc123
Master Bedroom | Bedroom | ambient=19.8°C | humidity=52% | mode=HEAT | eco=MANUAL_ECO | hvac=OFF | online | id=def456
Security Model
Three-layer protection
- Write gate — All device commands blocked unless
GOOGLE_HOME_WRITE_ENABLED=true. Read operations always allowed. - Confirm gate —
ghome_command(raw SDM command execution) requiresconfirm=trueas an additional parameter. - Credential scrubbing — OAuth access tokens (
ya29.*), refresh tokens (1//*), Bearer headers, and client secrets are stripped from all error messages before output.
Token lifecycle
- Refresh token stored in env var (never in code, never on disk beyond env)
- Access tokens refreshed automatically, kept in memory only, 60-second pre-expiry buffer
- 401 responses trigger automatic token invalidation and re-auth on next request
- Bearer auth available for HTTP transport (optional
GOOGLE_HOME_MCP_API_TOKEN)
Claude Code Integration
Add to your settings.json or claude.nix:
{
"mcpServers": {
"google-home": {
"command": "uv",
"args": ["--directory", "/path/to/google-home-blade-mcp", "run", "google-home-blade-mcp"],
"env": {
"GOOGLE_HOME_CLIENT_ID": "your-client-id",
"GOOGLE_HOME_CLIENT_SECRET": "your-secret",
"GOOGLE_HOME_REFRESH_TOKEN": "your-refresh-token",
"GOOGLE_HOME_PROJECT_ID": "your-project-id",
"GOOGLE_HOME_WRITE_ENABLED": "false"
}
}
}
}
Pub/Sub Event Streaming
For event-driven automation (motion alerts, doorbell presses, temperature changes):
- Create a Pub/Sub topic in GCP Console linked to your Device Access project
- Create a subscription for the topic
- Set
GOOGLE_HOME_PUBSUB_SUBSCRIPTION=projects/{project}/subscriptions/{name} - Use
ghome_eventsto pull and acknowledge events
Events include device trait updates, camera motion/person detection, and doorbell chime events — enabling webhook-style triggers without polling.
Supported Devices
| Device | Read | Control | Stream | Events |
|---|---|---|---|---|
| Nest Thermostat | ambient, humidity, mode, setpoint, HVAC, eco | mode, setpoint, eco, fan | — | trait updates |
| Nest Camera | status, capabilities | — | WebRTC, RTSP | motion, person, sound |
| Nest Doorbell | status, capabilities | — | WebRTC | motion, person, chime |
| Nest Hub Max | status | — | — | — |
Development
make install-dev # Install with dev + test dependencies
make test # Run unit tests
make test-cov # Run with coverage report
make lint # Ruff linter
make format # Ruff formatter
make type-check # MyPy strict mode
make check # All quality checks
Architecture
src/google_home_blade_mcp/
├── server.py # 15 FastMCP tools (read + write-gated)
├── client.py # SDM API client (httpx, error classification)
├── auth.py # OAuth2 token manager (memory-only access tokens)
├── traits.py # Trait parsing + command builders
├── formatters.py # Token-efficient output (pipe-delimited, null-omission)
├── models.py # Config, device types, exceptions, credential scrubbing
└── auth_setup.py # Interactive OAuth2 setup (make auth)
Rate Limits
| Operation | Limit |
|---|---|
| Device commands | 5/min per device |
| API aggregate | 6,000 req/60s per project |
| Camera streams | 5-min sessions (extendable) |
| Sandbox users | 25 max across 5 structures |
Stallari Marketplace
This blade ships with full marketplace scaffolding:
stallari-plugin.yaml— Plugin manifest withhome-v1contract, OAuth2 setup block, conformance declarationSKILL.md— Token efficiency rules, workflow examples, tool reference for Claude- Security model aligned with Stallari trust tiers (write gates, confirm gates, credential scrubbing)
License
MIT
Metadata
Release files for google-home-blade-mcp 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| google_home_blade_mcp-0.4.0.tar.gz | 123.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| google_home_blade_mcp-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 149.3 kB
Release files / google_home_blade_mcp-0.4.0.tar.gz
| Download URL | google_home_blade_mcp-0.4.0.tar.gz |
|---|---|
| Size | 123.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c73df83869bda1b04634baebceaceed3fad5434b37cc35208453cf0a5bdd6a83
|
|
BLAKE2b-256 checksum How to use checksums |
0b2d06cc0aa60582596b787a1c763690a8e91fcd4042f9ee391fdc7ddfbdef8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 11, 2026.
Transparency logRelease files / google_home_blade_mcp-0.4.0-py3-none-any.whl
| Download URL | google_home_blade_mcp-0.4.0-py3-none-any.whl |
|---|---|
| Size | 25.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c022e8c7f37467941eb219396958c3291082c181875dbfa19b48d33dcba2b90
|
|
BLAKE2b-256 checksum How to use checksums |
b43102a6cc684b369231e56e042ee784c3937166dd6a76f37ccb68ed549ef4cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 11, 2026.
Transparency log