smarthome-port
Provides tools for interacting with a Home Assistant instance via its REST API, including listing entities and services, reading entity states, calling services, retrieving recent history, reading core configuration, rendering Jinja templates, and firing events.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
smarthome-port
smarthome-port talks to a Home Assistant instance through its
REST API. Everything in Home Assistant is an entity —
light.kitchen, sensor.temp, switch.porch — and the API
reflects that shape: you read entity states, call services on a
domain (light.turn_on, switch.toggle), look back at recent
history, read the core configuration, render Jinja templates on
the server, and fire events onto the event bus. smarthome-port
exposes those six operations, plus listings of entities and
services, through one binary that serves a command-line interface
and a stdio MCP server.
Two settings are required, and there is no built-in default for either:
HOME_ASSISTANT_URL— the base URL of the instance, for examplehttp://homeassistant.local:8123. A trailing slash is stripped.HOME_ASSISTANT_TOKEN— a long-lived access token (create one in Home Assistant under your profile). It is sent as anAuthorization: Bearerheader and never appears in output.
When either variable is missing, every call fails with an error that names the missing variable, before any request is made.
Only the REST API is covered. The websocket API is not implemented.
Install
npx @reneturcios/smarthome-port entitiesOr run the container image:
docker run -i -e HOME_ASSISTANT_URL -e HOME_ASSISTANT_TOKEN ghcr.io/cloudcorprecords/smarthome-portThe container defaults to the MCP server (see below). Pass CLI arguments to use it as a CLI instead.
Related MCP server: hass-mcp
CLI
export HOME_ASSISTANT_URL=http://homeassistant.local:8123
export HOME_ASSISTANT_TOKEN=<your long-lived access token>
smarthome-port entities
smarthome-port entities --domain light
smarthome-port state sensor.temp
smarthome-port call light turn_on --entity light.kitchen --data '{"brightness_pct":50}'
smarthome-port services
smarthome-port services --domain light
smarthome-port history sensor.temp --hours 6
smarthome-port config
smarthome-port render "{{ states('sensor.temp') }}"
smarthome-port fire my_event --data '{"device":"kitchen"}'
smarthome-port --versionEach command prints the upstream JSON payload (template rendering
prints {"rendered": "..."}). Exit codes: 0 on success, 1
when a call fails (including missing configuration or an API
error), 2 for usage errors.
MCP server
One bin serves both faces. The mcp subcommand starts a stdio MCP
server:
npx -y @reneturcios/smarthome-port mcpMCP client configuration:
{
"mcpServers": {
"smarthome-port": {
"command": "npx",
"args": ["-y", "@reneturcios/smarthome-port", "mcp"],
"env": {
"HOME_ASSISTANT_URL": "http://homeassistant.local:8123",
"HOME_ASSISTANT_TOKEN": "..."
}
}
}
}Tools
Tool | Input | What it returns |
|
| Entity states, filtered client-side to one domain when given. |
|
| The full state of one entity. |
|
| The service call result; |
|
| Services by domain, or only one domain's entry when given. |
|
| Recent history for the entity over the window ending now. |
| (none) | The core configuration. |
|
|
|
|
| The upstream reply; |
All calls go to {HOME_ASSISTANT_URL}/api. An entity_id must
contain a dot (domain.object_id), and domain, service, and
event_type must be non-empty — both are checked before any
request. History timestamps are computed client-side from the
current time. HTTP failures surface the status plus the upstream
message when Home Assistant provides one.
Development
npm install
npm run build # tsc -> dist/
npm test # node test runner over test/*.test.ts, no network (fake fetch fixtures)
npm run dev # run the CLI from source via tsxLicense
MIT — see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Control your Tesla from your AI assistant - climate, charging, access, and security.
Enable interaction with Slack workspaces. Supports subscribing to Slack events through Resources.
Home energy for AI assistants: live Power flow, Energy history, solar forecast, and device control.
Tesla data for your AI: battery, range, charging, tires, alerts, history. Controls off by default.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAccess Home Assistant data and control devices (lights, switches, thermostats, etc).6 npm574Apache 2.0
- AlicenseAqualityFmaintenanceEnables controlling and querying Home Assistant devices and services via natural language. Supports state retrieval, listing states, and calling any Home Assistant service.13154 npm5MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Home Assistant through the REST API, allowing users to query states, call services, and manage entities via natural language.76 PyPIMIT
- AlicenseAqualityBmaintenanceEnables controlling Home Assistant from an MCP client, allowing users to read device states, call services, and run configuration commands via REST and WebSocket.5MIT