Skip to main content

美团语音 MCP服务器 - 提供文本转语音和语音识别等语音功能

Project description

美团语音 MCP服务器

本项目是基于 MCP 协议的美团语音服务 Server,适用于中文开发者,支持通过 MCP 控制器(如 cursor)调用美团 TTS 能力,实现文本转语音等功能。


目录


项目简介

本项目实现了一个 MCP 标准服务端,封装美团语音能力,适合对接 windsurf、Claude Desktop 等 MCP 控制器。支持标准的文本转语音接口,便于集成到各类自动化、AI 工具链。


功能特性

  • 文本转语音(TTS):支持指定文本、音色、语速、音量、采样率、音频格式等参数
  • 语音转文本(ASR): 支持指定音频文件格式、采样率、声道数、采样位数等参数
  • 标准 MCP 协议,兼容 windsurf 等主流控制器
  • 环境变量灵活配置,适合多环境部署

使用

依赖环境

  • Python 3.10 及以上
  • 已安装依赖包(见 requirements.txt)

获取APPKEY和SECRETKEY

变量名 说明 是否必须
MEITUAN_TTS_APP_KEY 美团TTS服务AppKey
MEITUAN_TTS_SECRET_KEY 美团TTS服务SecretKey
MEITUAN_ASR_APP_KEY 美团ASR服务AppKey
MEITUAN_ASR_SECRET_KEY 美团ASR服务SecretKey

安装uv

执行curl -LsSf https://astral.sh/uv/install.sh | sh或按照官网文档安装

配置MCP

已windsurf为例,在mcp_config.json中配置如下内容:

{
  "mcpServers": {
    "meituan-speech-mcp-server": {
      "command": "uvx",
      "args": ["mt-speech-mcp-server", "-y"],
      "env": {
        "MEITUAN_TTS_APP_KEY": "你的TTS_AppKey",
        "MEITUAN_TTS_SECRET_KEY": "你的TTS_SecretKey",
        "MEITUAN_ASR_APP_KEY": "你的ASR_AppKey",
        "MEITUAN_ASR_SECRET_KEY": "你的ASR_SecretKey"
      }
    }
  }
}

具体位置参考:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

开发与调试

开发与调试

  1. 同步依赖并更新锁文件:

    git clone <repository-url>
    cd speech-mcp-server
    
  2. 安装依赖

    pip install -r requirements.txt
    
  3. 配置环境变量(见上文)

  4. 配置 MCP 控制器(windsurf 或 Claude Desktop,见上文)

  5. 启动服务:在 windsurf/Claude Desktop 中启动本服务,即可使用相关工具。


构建与发布

如需将本项目打包发布,可参考如下流程(需已安装 uv 工具):

  1. 同步依赖并更新锁文件:
    uv sync
    
  2. 构建分发包:
    uv build
    
    构建结果将在 dist/ 目录下生成。
  3. 发布到 PyPI:
    uv publish
    
    发布前请配置好 PyPI 凭证,可用环境变量或命令行参数设置。

调试建议

由于 MCP Server 采用 stdio 通信,调试建议使用 MCP Inspector 工具。 可通过 npm 安装并运行:

npm install -g @modelcontextprotocol/inspector
mcp-inspector
  • 认证失败:检查 API 密钥是否正确配置
  • 文件不存在:确认音频文件路径是否正确
  • 网络错误:检查网络连接和 URL 有效性
  • 格式不支持:尝试使用其他音频格式或转换音频文件格式

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mt_speech_mcp_server-0.0.2.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mt_speech_mcp_server-0.0.2-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file mt_speech_mcp_server-0.0.2.tar.gz.

File metadata

File hashes

Hashes for mt_speech_mcp_server-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4d0928f78cca989cdef289e7c3df31816c002fb78a2aff252432ce9fc34cd372
MD5 7a06cfa9a5d66121e7dd063414f467f2
BLAKE2b-256 c01ceb671e76b2d15b910a2e40d41fcaf6c5b0d20ab0d422070db781b2a92914

See more details on using hashes here.

File details

Details for the file mt_speech_mcp_server-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mt_speech_mcp_server-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6de5a85f849c3190d53c998fd11f79c27d81ab358806c9545d98669fd7c4520f
MD5 6423fb55e3dbc56dfb52c1418097c3ef
BLAKE2b-256 185f278653fe0d931fe470d561f7050cc712c8e396bf477d8b612bcf9ae1e189

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page