Skip to main content

ConnectLife MCP Server

A standalone Model Context Protocol (MCP) server that exposes ConnectLife smart appliance control as MCP tools over HTTP.

This project was inspired by and initially based on the ConnectLife integration for Home Assistant by oyvindwe.

It is published as a separate container image to GHCR and has no dependency on Home Assistant.

Quick start (Docker / Podman)

The safest and easiest way to run the server is to pass your ConnectLife credentials as environment variables. The server authenticates automatically on startup, so you can call tools directly without a manual login.

# Pull the latest image
docker pull ghcr.io/<owner>/connectlife-mcp-server:latest

# Run with credentials (recommended)
docker run --rm -p 127.0.0.1:8000:8000 \
  -e MCP_CONNECTLIFE_USERNAME="your@email.com" \
  -e MCP_CONNECTLIFE_PASSWORD="yourpassword" \
  ghcr.io/<owner>/connectlife-mcp-server:latest

⚠️ Why env vars? LLM backends (OpenAI, Claude, Copilot, etc.) routinely log the parameters of every tool call. If you use the login tool, your username and password may be captured in plaintext in those logs. Passing credentials via environment variables keeps them out of tool-call telemetry.

Without environment variables (manual login)

If you prefer not to store credentials in env vars, start the container without them and authenticate via the login tool each time:

docker run --rm -p 127.0.0.1:8000:8000 \
  ghcr.io/<owner>/connectlife-mcp-server:latest

The server binds to 0.0.0.0:8000 inside the container.

MCP endpoint

http://localhost:8000/mcp

Use this URL in your MCP client (e.g., Claude Desktop, Copilot Chat) with transport streamable-http.

Authentication flow

When environment variables are set, authentication is fully automatic:

  1. The server calls the ConnectLife API on startup.
  2. A default session is created and maintained for the lifetime of the container.
  3. If the session token expires, the server silently re-authenticates in the background.
  4. All tools work without passing a session_id.

When environment variables are NOT set (multi-tenant or testing mode):

  1. Call the login tool with your ConnectLife username and password.
  2. Use the returned session_id as a parameter in every subsequent tool call.
  3. Call logout when done to release server resources.

⚠️ Do not expose this server publicly without an additional authentication proxy.

Available tools

Tool Description
login Log in and obtain a session_id
logout Invalidate a session
whoami Return session info
auto_login Get or create a valid session ID using env vars
list_appliances List all linked appliances
get_appliance Get details for one appliance
get_status Get all current property values
get_daily_energy Get today's energy usage in kWh
update_property Update a single property
update_properties Update multiple properties at once

When a default session is configured, the session_id parameter is optional for all tools.

Environment variables

Variable Default Description
FASTMCP_HOST 127.0.0.1 Bind host (0.0.0.0 for container use)
FASTMCP_PORT 8000 Bind port
MCP_CONNECTLIFE_USERNAME (none) ConnectLife username for auto-login
MCP_CONNECTLIFE_PASSWORD (none) ConnectLife password for auto-login
CONNECTLIFE_SESSION_TTL 86400 Session idle TTL in seconds (24 h)
CONNECTLIFE_POLL_INTERVAL 60 Appliance poll interval in seconds
CONNECTLIFE_MAX_SESSIONS 100 Max concurrent sessions
LOG_LEVEL INFO Python log level

Session lifecycle

  • The default auto-login session is created on server startup and persists for the full lifetime of the container.
  • If the ConnectLife auth token expires, the server automatically re-authenticates using the stored credentials.
  • Each explicit login call starts a background polling task that refreshes appliance state every CONNECTLIFE_POLL_INTERVAL seconds.
  • Explicit sessions expire after CONNECTLIFE_SESSION_TTL seconds of inactivity.
  • logout cancels polling immediately.

Credentials

  • Only username + password login is supported — the same restriction as the Home Assistant integration.
  • SSO (Google, Apple, etc.) is not supported.
  • If you use SSO, create a separate ConnectLife account and share your devices with it.

Rootless container

The image runs as a non-root user (uid 1000). It is compatible with rootless Docker and Podman without any special configuration.

# Podman rootless example with env vars
podman run --rm -p 127.0.0.1:8000:8000 \
  -e MCP_CONNECTLIFE_USERNAME="your@email.com" \
  -e MCP_CONNECTLIFE_PASSWORD="yourpassword" \
  ghcr.io/<owner>/connectlife-mcp-server:latest

Building locally

cd mcp_server
docker build -t connectlife-mcp-server .
docker run --rm -p 127.0.0.1:8000:8000 \
  -e MCP_CONNECTLIFE_USERNAME="your@email.com" \
  -e MCP_CONNECTLIFE_PASSWORD="yourpassword" \
  connectlife-mcp-server

Versioning

This project follows Semantic Versioning 2.0.0:

Change type Version bump Example
Bug fix PATCH (x.x.Y) 1.0.1
New tool or feature MINOR (x.Y.0) 1.1.0
Breaking change MAJOR (Y.0.0) 2.0.0

See RELEASE.md for the full release policy and automation details.

Metadata

Release files for connectlife-mcp-server 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for connectlife-mcp-server 1.0.0
File Size Uploaded Provenance
connectlife_mcp_server-1.0.0.tar.gz 49.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for connectlife-mcp-server 1.0.0
File Interpreter ABI Platform
connectlife_mcp_server-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 73.8 kB

Release files / connectlife_mcp_server-1.0.0.tar.gz

Download URL connectlife_mcp_server-1.0.0.tar.gz
Size 49.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2b834a4420f36ea19d2cd6554103d73557f0a701fb53a2320a6b444b82770f8c
BLAKE2b-256 checksum
How to use checksums
f46517bed2caa6c4ab91424b630e475f0a9d54938e23da354f47eff195915632
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 May 31, 2026.

Transparency log

Release files / connectlife_mcp_server-1.0.0-py3-none-any.whl

Download URL connectlife_mcp_server-1.0.0-py3-none-any.whl
Size 24.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c225bd07d55be5122c96ced9416503324afa7947605659f180995f1f3884703
BLAKE2b-256 checksum
How to use checksums
9c15949862a49acfe368a06645f1d67a14e76480b97775c21990792d7c03bfef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 May 31, 2026.

Transparency log

Security for connectlife-mcp-server 1.0.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for connectlife_mcp_server-1.0.0.tar.gz

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 May 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page