语音模型协议服务器

一个用于语音处理的MCP服务器实现,支持自动语音识别(ASR)和文本转语音(TTS)功能,适用于需要语音处理的应用场景。

  • by thundersoft-td
  • Python
  • 本地部署
  • 2 星标
  • 更新于
在 GitHub 查看 thundersoft-td/mcp-server-speech

使用说明

语音模型上下文协议服务器

一种用于volcengine语音的MCP服务器实现

特性

工具

  • 自动语音识别 自动语音识别:将音频转换为文本。
    • Args:
      • content:要转录的音频文件的url或绝对路径。
    • 退货:
      • Asr文本
  • 文本转语音 文本转语音:将文本合成为音频。
    • Args:
      • 文本:合成语音的文本。
      • speed:语音速度(例如,正常情况下为1.0)。默认值:1.0。
      • 编码:所需的音频输出格式(例如“mp3”、“wav”)。默认值:“mp3”。
    • 退货:
      • 返回音频文件的路径。

配置

服务器要求设置以下环境变量:

  • VOLC_APPID:必填,VolcEngine的APP ID。
  • VOLC_TOKEN:必填,VolcEngine的访问令牌。
  • VOLC_VOICE_TYPE:可选,大语音合成模型服务voice_type,默认为“zh_female_milinvyou_moon_bigtts”
  • VOLC_CLUSTER:必填,大型语音合成模型服务集群ID

需要在Volcengine上激活的服务包括: 大型语音合成模型、流式语音识别大模型、用于音频文件识别的大型模型

您可以在shell中设置这些环境变量。

MCP设置配置

要将此服务器添加到MCP配置中,请将以下内容添加到MCP设置文件中:

{
  "mcpServers": {
    "speech-mcp-server": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/PARENT/FOLDER/src/mcp_server_speech",
        "run",
        "main.py"
      ]
    }
  }
}

或

{
    "mcpServers": {
        "speech-mcp-server": {
            "command": "uvx",
            "args": [
                "--from",
                "git+https://github.com/thundersoft-td/mcp-server-speech",
                "mcp-server-speech"
            ],
            "env": {
                "VOLC_APPID": "your appid",
                "VOLC_TOKEN": "your token",
                "VOLC_VOICE_TYPE": "tts voice type",
                "VOLC_CLUSTER": "tts cluster id",
            }
        }
    }
}

用法

运行服务器

# Run the server with stdio transport (default)
python -m mcp_server_speech [--transport/-t {sse,stdio}]

许可证

此库根据MIT-0许可证获得许可。请参阅LICENSE文件。