mcp-rime
v0.1.0
Published
ModelContextProtocol server for Rime text-to-speech API
Readme
MCP Rime Server
A Model Context Protocol (MCP) server that provides text-to-speech capabilities using the Rime API. This server downloads audio and plays it using the system's native audio player.
Features
- Exposes a
speaktool that converts text to speech and plays it through system audio - Uses Rime's high-quality voice synthesis API
- Supports various voice options and customization parameters
- Cross-platform audio playback support
Requirements
- Node.js 16.x or higher
- A working audio output device
- One of the following audio players (automatically detected):
- Linux: mpg123, mplayer, aplay, or ffplay
- macOS: Built-in afplay (included with macOS)
- Windows: Built-in Media.SoundPlayer (PowerShell)
MCP Configuration
"ref": {
"command": "npx",
"args": ["rime-mcp"],
"env": {
RIME_API_KEY=your_api_key_here
# Optional configuration
RIME_GUIDANCE="<guide how the agent speaks>"
RIME_WHO_TO_ADDRESS="<your name>"
RIME_WHEN_TO_SPEAK="<tell the agent when to speak>"
RIME_VOICE="cove"
}
}All of the optional env vars are part of the tool definition and are prompts to
All voice options are listed here.
You can get your API key from the Rime Dashboard.
The following environment variables can be used to customize the behavior:
RIME_GUIDANCE: The main description of when and how to use the speak toolRIME_WHO_TO_ADDRESS: Who the speech should address (default: "user")RIME_WHEN_TO_SPEAK: When the tool should be used (default: "when asked to speak or when finishing a command")RIME_VOICE: The default voice to use (default: "cove")
Example usage 1: Coding agent announcement
Have Cursor/Windsurf/Zed announce when multi-file changes it complete and list the files that were edited.
RIME_WHEN_TO_SPEAK="Speak when you complete a multi-file code change."
RIME_GUIDANCE="Say a 1 sentance overview of the change and list all files that were edited."Example usage 2: Learn how the kids talk these days
Have Claude talk to you like you're Gen Alpha.
RIME_GUIDANCE="Use phrases and slang common among Gen Alpha."
RIME_WHO_TO_ADDRESS="Matt"
RIME_WHEN_TO_SPEAK="when asked to speak"Usage
- Start the server:
npx mcp-rime- The server exposes a
speaktool with the following parameters:
text(required): The text to speak aloudspeaker(optional): The voice to use (defaults to "cove")speedAlpha(optional): Speech speed multiplier (default: 1.0)reduceLatency(optional): Whether to optimize for lower latency (default: false)
- When the
speaktool is called, it will:- Connect to Rime's API and download the speech audio
- Save the audio to a temporary file
- Play the audio using your system's native audio player
- Clean up temporary files automatically
How It Works
- The server makes an HTTP request to Rime's TTS API
- The audio data is streamed into a temporary file
- Once the download is complete, the appropriate audio player for your OS is used to play the file
- After playback is complete, temporary files are cleaned up
Development
- Install dependencies:
npm install- Build the server:
npm run build- Run in development mode with hot reload:
npm run devLicense
MIT
