Skip to main content

MCP server that speaks text through the Home Assistant text-to-speech (tts.speak) service.

Project description

homeassistant-tts-mcp

An MCP server that speaks text out loud through your Home Assistant text-to-speech setup. It wraps the Home Assistant tts.speak service so any MCP-capable AI client (Claude Desktop, Claude Code, etc.) can talk through your speakers.

Tools

Tool What it does
speak Speak a message on a media player via a TTS engine (tts.speak).
list_media_players List media_player.* entities you can target.
list_tts_engines List tts.* engines and their supported languages.
check_connection Verify the URL + token work.

Requirements

  • A running Home Assistant instance with at least one TTS engine (Piper, Google Cloud, ElevenLabs, …) and a media player.
  • A long-lived access token: Home Assistant → Profile → Security → Long-lived access tokens → Create token.
  • uv / uvx to run it (Python 3.10+).

Configuration

The server is configured entirely through environment variables:

Variable Required Description
HA_URL Base URL, e.g. http://homeassistant.local:8123
HA_TOKEN Long-lived access token
HA_DEFAULT_MEDIA_PLAYER Fallback media player for speak
HA_DEFAULT_TTS_ENTITY Fallback TTS engine, e.g. tts.piper
HA_DEFAULT_VOICE Fallback voice, e.g. en_US-hfc_female-medium
HA_DEFAULT_LANGUAGE Fallback language code, e.g. en
HA_VERIFY_SSL false to skip TLS verification (self-signed certs)
HA_TIMEOUT HTTP timeout in seconds (default 30)

See .env.example.

Run it

Once published to PyPI:

uvx homeassistant-tts-mcp

The server speaks MCP over stdio, so you normally let your MCP client launch it. Example client config:

{
  "mcpServers": {
    "home-assistant-tts": {
      "command": "uvx",
      "args": ["homeassistant-tts-mcp"],
      "env": {
        "HA_URL": "http://homeassistant.local:8123",
        "HA_TOKEN": "your-long-lived-access-token",
        "HA_DEFAULT_MEDIA_PLAYER": "media_player.living_room",
        "HA_DEFAULT_TTS_ENTITY": "tts.piper"
      }
    }
  }
}

Then ask the assistant something like "Say 'dinner is ready' in the kitchen."

What speak sends

It maps directly onto the Home Assistant service call:

domain: tts
service: speak
entity_id: tts.piper                       # tts_entity_id
data:
  media_player_entity_id: media_player.living_room
  message: "Your spoken message goes here..."
  options:
    voice: en_US-hfc_female-medium         # when voice is provided

Development

uv sync                 # create venv + install deps (incl. dev group)
uv run homeassistant-tts-mcp   # run the server locally (needs HA_URL/HA_TOKEN)
uv run pytest           # tests
uv run ruff check .     # lint

Build & publish

uv build                              # produces dist/*.whl and *.tar.gz
uvx twine upload dist/*               # publish to PyPI
# then it's runnable anywhere as: uvx homeassistant-tts-mcp

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

homeassistant_tts_mcp-0.1.0.tar.gz (73.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

homeassistant_tts_mcp-0.1.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file homeassistant_tts_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: homeassistant_tts_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 73.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for homeassistant_tts_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0622cc220ff1bdca0545a562b42c8bf3f667788128ef6ff200daedb966c0c19b
MD5 9ec389ad60b66ef83a212a2b83331d84
BLAKE2b-256 96a7851ef5f4c9167a528943470cc237ad21c245bdd00f33a54c77547fb7a282

See more details on using hashes here.

File details

Details for the file homeassistant_tts_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: homeassistant_tts_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for homeassistant_tts_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58114e030e439fd0290588f8b8638b36071e9df1b9ab188c4db3b867f390b614
MD5 aae7b118ccbb3c72a16cfa2f10bbb389
BLAKE2b-256 a68a01cf370016cc08cafe7e41b5e448dbea4dd01f8a554582c8d70735330574

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page