SuperAPI AI Directory

speech.sh

Let the agent speak out loud and notify you with a quick summary when it finishes working.

Open website

About this tool

speech.sh is a text-to-speech (TTS) command-line tool and also an MCP server, using the Groq TTS API (compatible with the OpenAI interface). Its core goal is to convert text into speech and play it through a simple command; it can also let AI agents read content aloud after completing work, or provide voice notifications with brief summaries.

Purpose The project is positioned as a simple and easy-to-use text-to-speech solution. The original description mentions that it was initially a simple curl script used to read aloud the content you input, and was especially useful when your voice suddenly could not make a sound. On this basis, it developed into a voice tool supporting MCP, which can be integrated into AI assistants.

Main capabilities

  • Convert text to speech through a simple command.
  • Provide multiple voice options: troy, austin, hannah, autumn.
  • Adjustable speech speed.
  • Hash-based caching to avoid repeated API calls, with automatic cache cleanup after 24 hours.
  • Retry with exponential backoff on failure.
  • Play audio through ffplay, mplayer, or VLC.
  • Provide an MCP server that can be integrated with AI assistants (Claude Desktop, Claude Code).
  • The MCP server exposes a single speak tool externally.

Usage Before use, the following conditions must be met:

  • Depends on curl and jq (for the shell version).
  • Requires an audio player: ffplay (from ffmpeg), mplayer, or vlc.
  • Requires a Groq API key, with three methods, in priority order:
    1. --api_key "your-key"
    2. export OPENAI_API_KEY="your-key"
    3. Place a file named API_KEY in the script's directory

The project provides two implementations:

  1. Python (recommended): uses the FastMCP SDK, requires Python 3.10+ and uv.
  2. The original shell-based MCP server (mcp.sh): can work in environments without Python, but may encounter macOS sandbox issues in Claude Desktop.

The main files in the repository include:

  • speech.sh: the shell-based TTS engine (responsible for API calls, caching, playback).
  • mcp.sh: the shell-based MCP wrapper, wrapping speech.sh (using JSON-RPC 2.0 over stdio).
  • server.py: the Python MCP server, a self-contained alternative to the above two scripts.

Applicable scenarios

  • Read aloud any input text on the command line.
  • Serve as the voice output capability of an AI assistant/agent, for example reading out results after a task is completed or giving a brief voice summary notification.
  • Serve as an auxiliary voice tool when your throat is uncomfortable and you cannot speak.

Limitations Specific information such as billing, pricing, platform support scope, and voice quality is not yet provided. Before use, you need to prepare a Groq API key yourself; the shell version may have macOS sandbox-related issues in Claude Desktop, and the official recommendation is to prefer the Python implementation.