Back to MCP directory
publicPublicdnsLocal runtime

mcp-tts-server

基于MCP协议的文本转语音服务器项目,通过Groq API实现语音合成功能,支持多种音频格式输出。

article

README

🚀 mcp-tts-server

该项目提供了一个基于模型上下文协议(MCP)的文本转语音(TTS)服务器,借助Groq平台实现语音生成,为文本转语音需求提供了高效且功能丰富的解决方案。

🚀 快速开始

本项目是一个基于模型上下文协议(MCP)的文本转语音(TTS)服务器,使用Groq平台进行语音生成。通过简单配置和安装依赖,即可快速运行服务器实现文本转语音功能。

✨ 主要特性

  • 实现了MCP协议的TTS功能,为文本转语音提供了标准化的解决方案。
  • 与Groq API (https://api.groq.com/openai/v1/audio/speech)连接以生成逼真的语音音频,保证了语音的高质量。
  • 提供generate_speech工具,可通过MCP协议访问,方便快捷地实现语音生成。
  • 支持多种音频输出格式(wav、mp3、aac、opus、flac),满足不同场景的需求。
  • 使用@tropicbliss/symphonia库在服务器端直接播放生成的音频(可选功能),增加了使用的灵活性。
  • 需要通过环境变量设置Groq API密钥(GROQ_API_KEY),确保访问的安全性。

📦 安装指南

运行以下命令安装所有必要的依赖项:

bun install

💻 使用示例

基础用法

要使用标准输入输出传输协议运行服务器,请在配置文件中添加以下内容:

{
  "mcpServers": {
    "mcp-tts-server": {
      "command": "bunx",
      "args": [
        "--bun",
        "mcp-tts-server",
      ],
      "env": {
        "GROQ_API_KEY": "gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}

📚 详细文档

项目结构

  • src/server.ts:定义了MCP服务器的核心逻辑,包括generate_speech工具以及与Groq API的交互。
  • src/cli.ts:提供用于运行MCP服务器的标准控制台接口。
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client