convez.ai
MCP ServerIntegração & APIsIntermediário
jrolstad

Mysa MCP Server

jrolstad/mysa-mcp

Consulte termostatos Mysa conversacionalmente via Claude

Ver no GitHub
InicialPluginScore · de 0 a 100

Servidor MCP que integra termostatos Mysa ao Claude, permitindo consultas conversacionais sobre temperatura ambiente, setpoints e estado dos dispositivos. Funcionalidade somente leitura com cache inteligente e suporte a múltiplos clientes MCP.

Instalação

$npx convez-ai jrolstad/mysa-mcp

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 5 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Monitorar temperatura e umidade de ambientes em tempo real
  • Consultar estado de termostatos durante automações ou fluxos de trabalho
  • Integrar dados de aquecimento em sistemas de home automation

Veredito

Integração prática com API reversa do Mysa, bem estruturada com autenticação Cognito e cache eficiente. Limitação clara: somente leitura e sem histórico, mas adequada para monitoramento em tempo real.

README

A tradução para o português deste README ainda está na fila.

mysa-mcp

License: MIT

An MCP (Model Context Protocol) server that wraps the Mysa thermostat cloud API. Query your Mysa thermostats conversationally from Claude Code, Claude.ai, or any MCP-compatible client.

Read-only. This server only fetches data; it never changes a setpoint, mode, or lock.

Mysa has no official public API. This wraps the reverse-engineered endpoints the Mysa mobile app uses (canonical reference: dlenski/mysotherm). They are unsupported and could change without notice.

Tools

ToolDescription
get_devicesList thermostats on the account (name, model, time zone, device ID)
get_current_stateCurrent state (ambient temp, setpoint, humidity, duty cycle, current/voltage) for all thermostats in one call
get_device_stateSingle-thermostat state — served from the cached all-states response, no extra API call
get_homesHomes/locations on the account
reset_cacheClear the in-process cache

Temperatures are in °C. Mysa is heat-only — there is no mode field. A value of -1 means missing/invalid.

Why no historical data?

Mysa's legacy /users/readingsForUser history endpoint currently returns HTTP 500, so there is no working REST source for past readings. The only granular history source is an MQTT/WebSockets stream, which would require a long-lived background collector and a local database — out of scope for this server.

Configuration

MYSA_USERNAME=your_mysa_account_email
MYSA_PASSWORD=your_mysa_account_password

Auth uses AWS Cognito (USER_SRP_AUTH) against the Mysa user pool; tokens are cached in memory and refreshed automatically.

The server keeps an in-process cache with a 5-minute TTL.

Run locally (stdio)

python -m venv .venv
.venv\Scripts\pip install -r requirements.txt
copy .env.example .env  # then fill in credentials
.venv\Scripts\python server.py

Connect to Claude Code

Add to ~/.claude.json under mcpServers:

{
  "mcpServers": {
    "mysa": {
      "type": "stdio",
      "command": "C:\\code\\rolstad-home-workspace\\repos\\mysa-mcp\\.venv\\Scripts\\python.exe",
      "args": ["C:\\code\\rolstad-home-workspace\\repos\\mysa-mcp\\server.py"],
      "env": {
        "MYSA_USERNAME": "your_mysa_account_email",
        "MYSA_PASSWORD": "your_mysa_account_password"
      }
    }
  }
}

Run hosted (HTTP)

Set MCP_TRANSPORT=streamable-http and the server exposes a Streamable HTTP endpoint on PORT (default 8000). The included Dockerfile defaults to this mode.

docker build -t mysa-mcp .
docker run --rm -p 8000:8000 \
  -e MYSA_USERNAME=... \
  -e MYSA_PASSWORD=... \
  mysa-mcp

Project structure

mysa_client.py   # Cognito auth + httpx REST client
server.py        # FastMCP tool definitions + in-process cache + transport toggle
requirements.txt
Dockerfile       # python:3.11-slim, streamable-http transport by default
.env.example
Ver o original no GitHub

Bom para

Relacionados