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.1.tar.gz (74.0 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.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: homeassistant_tts_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 74.0 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.1.tar.gz
Algorithm Hash digest
SHA256 c452dc220c11d1766580b79701e3845b06164e4c08e4a5b562b6a55fddfb27d1
MD5 6a3ba1e7f60a800d7771c238d23d662d
BLAKE2b-256 d4ee3e01bc49a87c820f465983cd277ac00ef513acbf63c6c5f0b35cacd5d33a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: homeassistant_tts_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aeca035e354bbe69fe2443f30773964fbdae32690c2c01dd26d08019792dd2c5
MD5 8f3edbb7e6edc1939b7feb5728114b44
BLAKE2b-256 738ee5f78b9850e9d870ed060570115b98be2545bea3e48e18cf3637008baf06

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