About
MCP speech server for macOS implemented in Go
README
A Model Context Protocol (MCP) server that provides text-to-speech functionality using macOS's built-in speech synthesis.
Features
- speak tool: Converts text to audible speech using the macOS
/usr/bin/saycommand - list_voices tool: Lists all available text-to-speech voices with their locales and descriptions
- Optional voice selection from available system voices
- Optional speech rate control (words per minute)
- Simple, lightweight implementation
- Proper error handling for permissions and invalid inputs
Requirements
- macOS (uses
/usr/bin/saycommand) - Go 1.21 or later (for building from source)
- Audio output device available
Installation
Using go install
The easiest way to install is using go install:
go install github.com/kristopherjohnson/kj-speech-mcp@latest
This will install the kj-speech-mcp binary to your $GOPATH/bin directory (typically ~/go/bin). Make sure this directory is in your PATH.
From Source
Alternatively, you can build from source:
git clone https://github.com/kristopherjohnson/kj-speech-mcp.git
cd kj-speech-mcp
go build -o kj-speech-mcp
The compiled binary kj-speech-mcp can be placed anywhere in your PATH or referenced by absolute path.
Usage with Claude Desktop
Add this server to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"kj-speech": {
"command": "/path/to/kj-speech-mcp"
}
}
}
Replace /path/to/kj-speech-mcp with the actual path to the compiled binary.
After updating the configuration:
- Restart Claude Desktop
- The
speakandlist_voicestools will be available in your conversations
Usage with Claude Code
Claude Code can automatically configure this MCP server using the claude mcp add command.
claude mcp add kj-speech /path/to/kj-speech-mcp
This will:
- Prompt you to confirm adding the server
- Update your Claude Code configuration
- Make the
speakandlist_voicestools available in all Claude Code sessions
By default claude mcp add will add the server to the local (current directory) configuration. Use the --scope user option to make it available for all of the current user's sessions, or --scope project for project-level configuration.
You can verify the server is configured by running:
claude mcp list
To remove the server:
claude mcp remove kj-speech
Usage with Codex
Codex reads MCP server configuration from its config file. By default this is:
~/.codex/config.json(ifCODEX_HOMEis not set)$CODEX_HOME/config.json(ifCODEX_HOMEis set)
{
"mcpServers": {
"kj-speech": {
"command": "/path/to/kj-speech-mcp"
}
}
}
Replace /path/to/kj-speech-mcp with the actual path to the compiled binary, then restart Codex.
If you prefer using the Codex CLI, you can add the server with
codex mcp add kj-speech /path/to/kj-speech-mcp
Usage with Gemini
Gemini can automatically configure this MCP server using the gemini mcp add command.
gemini mcp add kj-speech /path/to/kj-speech-mcp
This will:
- Prompt you to confirm adding the server
- Update your Gemini configuration
- Make the
speakandlist_voicestools available in all Gemini sessions
By default gemini mcp add will add the server to the local (current directory) configuration. Use the --scope user option to make it available for all of the current user's sessions, or --scope project for project-level configuration.
You can verify the server is configured by running:
gemini mcp list
To remove the server:
gemini mcp remove kj-speech
MCP Tool Reference
list_voices
Lists all available text-to-speech voices on the system.
Parameters: None
Returns: JSON object containing an array of voice objects, each with:
name(string): The voice name (e.g., "Samantha", "Alex", "Eddy (English (US))")locale(string): The locale code (e.g., "en_US", "fr_FR", "ja_JP")description(string): A sample phrase spoken by the voice
Example:
Use the list_voices tool to list available voices
Sample Output:
{
"voices": [
{
"name": "Albert",
"locale": "en_US",
"description": "Hello! My name is Albert."
},
{
"name": "Samantha",
"locale": "en_US",
"description": "Hello! My name is Samantha."
},
{
"name": "Amélie",
"locale": "fr_CA",
"description": "Bonjour! Je m'appelle Amélie."
}
]
}
speak
Converts text to audible speech.
Parameters:
text(string, required): The text to be spoken aloudvoice(string, optional): Voice to use for speech synthesis. If not specified, uses the system default voice.rate(number, optional): Speech rate in words per minute (valid range: 90-500). If not specified, uses the system default rate.
Limits and validation:
textis trimmed and must be non-empty after trimming.- Maximum
textlength: 10,000 characters. voicemust be a string when provided.ratemust be a positive number when provided.- Success responses include a truncated preview of the spoken text (first 100 characters).
Examples:
Basic usage with default voice and rate:
Use the speak tool to say "Hello, world!"
Using a specific voice:
Use the speak tool to say "Hello, world!" with voice "Samantha"
Using a specific rate:
Use the speak tool to say "This is slower" with rate 120
Using both voice and rate:
Use the speak tool to say "Fast speech" with voice "Alex" and rate 300
Available Voices:
Use the list_voices tool to get a complete list of available voices with their locales and descriptions. Alternatively, you can run:
/usr/bin/say -v '?'
Common voices include: Alex, Samantha, Victoria, Daniel, Karen, and many others in various languages.
Error Handling:
- Returns error if
textparameter is missing or empty - Returns error if speech synthesis fails
- Provides helpful messages for permission issues
- Invalid voice names will cause the say command to fail with an error message
Permissions
The say command typically works without special permissions in a normal user session. However, you may need to grant accessibility permissions if running in certain contexts:
- Open System Preferences → Security & Privacy → Privacy → Accessibility
- Add Claude Desktop (or the terminal application) if prompted
Troubleshooting
No audio output:
- Verify you have an audio output device connected
- Check system volume settings
- Ensure you're not in an SSH session without audio forwarding
Permission errors:
- Check System Preferences accessibility permissions
- Ensure running in a user session (not as a background daemon)
Command not found:
- Verify
/usr/bin/sayexists on your system (standard on macOS) - Try running
/usr/bin/say "test"directly in Terminal
Development
# Install dependencies
go mod download
# Build
go build -o kj-speech-mcp
# Test the say command directly
/usr/bin/say "Testing speech"
# List available voices
/usr/bin/say -v '?'
License
MIT License
Author
Kristopher Johnson
Installing Kj Speech
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/kristopherjohnson/kj-speech-mcpFAQ
Is Kj Speech MCP free?
Yes, Kj Speech MCP is free — one-click install via Unyly at no cost.
Does Kj Speech need an API key?
No, Kj Speech runs without API keys or environment variables.
Is Kj Speech hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Kj Speech in Claude Desktop, Claude Code or Cursor?
Open Kj Speech on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
GitHub
PRs, issues, code search, CI status
by GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
by mcpdotdirectCompare Kj Speech with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All development MCPs
