Fish Audio MCP Server Integrating Claude for Text-to-Speech
Integrate Fish Audio with Claude using an MCP server to convert natural language into premium text-to-speech for seamless speech synthesis.
npx -y @da-okazaki/mcp-fish-audio-serverOverview
This MCP (Model Context Protocol) server connects Fish Audio’s text-to-speech (TTS) capabilities with LLMs such as Claude. Running the server alongside your LLM lets the model request high-quality speech synthesis directly from natural-language prompts. The server translates MCP tool calls into Fish Audio API requests, returning generated audio files or streaming audio for low-latency use cases.
Use this server when you want to add premium, multilingual voice output to chatbot agents, voice assistants, demos, or accessibility features. It supports single-voice and multi-voice setups, streaming or batch synthesis, and common audio formats (MP3, WAV, PCM, Opus).
Repository: https://github.com/da-okazaki/mcp-fish-audio-server
Features
- High-fidelity TTS via Fish Audio models
- Low-latency streaming (HTTP/WebSocket) for real-time playback
- Support for reference voice models (voice cloning / custom voices)
- Select voices by ID, name, or tags
- Multiple audio formats: mp3, wav, pcm, opus
- Configurable MP3 bitrate and latency mode
- Simple environment-variable configuration for MCP deployments
- Outputs audio files to disk and can auto-play locally for debugging
Installation / Configuration
Install and run with npx (no global install required):
Or install globally:
Basic environment setup (single voice):
Example MCP server entry (for an MCP-enabled LLM such as Claude via an MCP manager):
Environment Variables
| Variable | Description | Default | Required |
|---|---|---|---|
| FISH_API_KEY | Fish Audio API key | - | Yes |
| FISH_MODEL_ID | TTS model (e.g., s1, speech-1.5, speech-1.6) | s1 | No |
| FISH_REFERENCE_ID | Default voice reference ID (single) | - | No |
| FISH_REFERENCES | JSON array of voice references (multi) | - | No |
| FISH_DEFAULT_REFERENCE | Default reference when multiple provided | - | No |
| FISH_OUTPUT_FORMAT | mp3, wav, pcm, opus | mp3 | No |
| FISH_STREAMING | Enable streaming (true/false) | false | No |
| FISH_LATENCY | Latency mode (normal, balanced) | balanced | No |
| FISH_MP3_BITRATE | MP3 bitrate (64,128,192) | 128 | No |
| FISH_AUTO_PLAY | Auto-play generated audio locally | false | No |
| AUDIO_OUTPUT_DIR | Directory for saved audio files | ~/.fish-audio-mcp/audio_output | No |
Configuring Multiple Voice References
Recommended: set FISH_REFERENCES as a JSON array:
Backward-compatible option: number individual environment variables:
Available Tools / Resources
The MCP server exposes tools that LLMs can call.
fish_audio_tts
- Converts text to speech using Fish Audio.
- Input parameters:
- text (string, required, up to ~10,000 chars)
- reference_id (string, optional) — voice reference ID
- reference_name (string, optional) — match voice by name
- reference_tag (string, optional) — match voice by tag
- streaming (bool, optional) — request streaming output
- format (string, optional) — mp3, wav, pcm, opus
- mp3_bitrate (number, optional) — 64, 128, or 192
- normalize (bool, optional) — normalize audio loudness
- Output:
- Non-streaming: path to generated audio file (AUDIO_OUTPUT_DIR)
- Streaming: streaming URL or chunked audio via MCP streaming channel
fish_audio_list_references
- Returns configured voice references (IDs, names, tags) so the LLM can choose voices programmatically.
Use Cases
- Voice-enabled chatbots: Have Claude generate textual responses and call fish_audio_tts to return spoken output in a selected voice.
- Example: User asks for a Japanese explanation; the model calls fish_audio_tts with reference_tag=“japanese” and format=“mp3”.
- Dynamic multi-voice narration: Select different reference_ids to create multi-character narration for audiobooks or interactive fiction.
- Real-time assistants: Enable FISH_STREAMING=true and FISH_AUTO_PLAY to stream responses with minimal latency for live agents or demos.
- Accessibility: Convert long-form instructions into spoken audio files stored in AUDIO_OUTPUT_DIR for offline use.
Example tool call (JSON representation)
Non-streaming synthesis:
Expected result: the MCP server returns a path like /home/user/.fish-audio-mcp/audio_output/tts-2026-04-09-1234.mp3
Streaming synthesis:
The server will provide a streaming endpoint or stream audio chunks through the MCP client.
Notes and best practices
- Keep your FISH_API_KEY secret and scope it appropriately.
- For production low-latency use, enable streaming and tune FISH_LATENCY.
- Use FISH_REFERENCES to centralize voice management and let the model choose