Kokoro Text to Speech MCP Server
Kokoro 文本转语音 (TTS) MCP 服务器
Kokoro 文本到语音 MCP 服务器可生成 .mp3 文件,并可选择上传到 S3。
用途: https://huggingface.co/spaces/hexgrad/Kokoro-TTS
Related MCP server: Speech MCP Server
配置
克隆到本地仓库。
下载kokoro-v1.0.onnx和voices-v1.0.bin的Kokoro Onnx Weights并存储在同一个 repo 中。
将以下内容添加到您的 MCP 配置中。请使用您自己的值进行更新。
"kokoro-tts-mcp": {
"command": "uv",
"args": [
"--directory",
"/path/toyourlocal/kokoro-tts-mcp",
"run",
"mcp-tts.py"
],
"env": {
"TTS_VOICE": "af_heart",
"TTS_SPEED": "1.0",
"TTS_LANGUAGE": "en-us",
"AWS_ACCESS_KEY_ID": "",
"AWS_SECRET_ACCESS_KEY": "",
"AWS_REGION": "us-east-1",
"AWS_S3_FOLDER": "mp3",
"S3_ENABLED": "true",
"MP3_FOLDER": "/path/to/mp3"
}
}安装 ffmmeg
这是将 .wav 文件转换为 .mp3 文件所必需的
对于Mac:
brew install ffmpeg要在本地运行,请将这些添加到你的 .env 文件中。请参阅 env.example 并复制到 .env 文件,然后使用你自己的值进行修改。
支持的环境变量
AWS_ACCESS_KEY_ID:您的 AWS 访问密钥 IDAWS_SECRET_ACCESS_KEY:您的 AWS 秘密访问密钥AWS_S3_BUCKET_NAME:S3 存储桶名称AWS_S3_REGION:S3 区域(例如,us-east-1)AWS_S3_FOLDER:S3 bucket 内的文件夹路径AWS_S3_ENDPOINT_URL:S3 兼容存储的可选自定义端点 URLMCP_HOST:绑定服务器的主机(默认值:0.0.0.0)MCP_PORT:监听端口(默认值:9876)MCP_CLIENT_HOST:客户端连接到服务器的主机名(默认值:localhost)DEBUG:启用调试模式(设置为“true”或“1”)S3_ENABLED:启用 S3 上传(设置为“true”或“1”)MP3_FOLDER:存储 MP3 文件的路径(默认为脚本目录中的“mp3”文件夹)MP3_RETENTION_DAYS:自动删除前保留 MP3 文件的天数DELETE_LOCAL_AFTER_S3_UPLOAD:S3 上传成功后是否删除本地 MP3 文件(设置为“true”或“1”)TTS_VOICE:TTS 客户端的默认语音(默认值:af_heart)TTS_SPEED:TTS 客户端的默认速度(默认值:1.0)TTS_LANGUAGE:TTS 客户端的默认语言(默认值:en-us)
本地运行服务器
首选方法是使用紫外线
uv run mcp-tts.py使用 TTS 客户端
mcp_client.py脚本允许你向服务器发送 TTS 请求。它的使用方法如下:
连接设置
在同一台机器上运行服务器和客户端时:
服务器应绑定到
0.0.0.0(所有接口)或127.0.0.1(仅限本地主机)客户端应连接到
localhost或127.0.0.1
基本用法
python mcp_client.py --text "Hello, world!"从文件读取文本
python mcp_client.py --file my_text.txt自定义语音和速度
python mcp_client.py --text "Hello, world!" --voice "en_female" --speed 1.2禁用 S3 上传
python mcp_client.py --text "Hello, world!" --no-s3命令行选项
python mcp_client.py --helpMP3文件管理
TTS 服务器会生成 MP3 文件,这些文件存储在本地,也可以选择上传到 S3。您可以配置这些文件的管理方式:
本地存储
在
.env文件中设置MP3_FOLDER来指定 MP3 文件的存储位置文件保存在此文件夹中,除非自动删除
自动清理
设置
MP3_RETENTION_DAYS=30(或任意数字)以自动删除超过该天数的文件设置
DELETE_LOCAL_AFTER_S3_UPLOAD=true以在 S3 上传成功后立即删除本地文件
S3 集成
使用
S3_ENABLED=true或DISABLE_S3=true启用/禁用 S3 上传在
.env文件中配置 AWS 凭证和存储桶设置可以使用客户端的
--no-s3选项按请求禁用 S3 上传
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- Flicense-qualityDmaintenanceA server providing text-to-speech and speech-to-text functionalities using Windows' native speech services without external dependencies.6
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides text-to-speech capabilities using the Kokoro TTS model, offering multiple voice options and customizable speech parameters.4311MIT
- Alicense-qualityCmaintenanceA text-to-speech MCP server with 48 voices across 9 languages, supporting emotion spans, SFX tags, and multi-speaker dialogue. Deployable via a single npx command with built-in guardrails and swappable backends.MIT
- Alicense-qualityDmaintenanceAn OpenAI-compatible text-to-speech API server that enables voice cloning, long-form generation, and can be used as a Claude Code tool for speech synthesis.MIT
Related MCP Connectors
MCP server exposing the AceDataCloud Fish Audio API (text-to-speech with voice conditioning)
Hosted pay-per-use TTS: 54 neural voices, 9 languages incl. Brazilian Portuguese. $10 free credits.
AI-manageable audio CDN: upload, transcode, normalize, stream & deliver audio, plus grounded docs.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mberg/kokoro-tts-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server