Back to MCP directory
publicPublicdnsLocal runtime

Mcp_cosyvoice

基于Python的Mcp服务,调用Ali CosyVoice1接口实现文本转音频

article

README

🚀 [Mcp服务器应用程序]

本项目是一个基于Python的Mcp服务器应用程序,它可以调用Ali CosyVoice1接口,将文本转换为音频,并把生成的音频保存到指定目录,为文本转音频需求提供了便利的解决方案。

🚀 快速开始

📦 安装指南

创建Python 3.12虚拟环境

uv venv .venv -p 3.12

激活虚拟环境(Windows)

.venv\Scripts\activate

安装项目依赖

uv sync

💻 使用示例

基础用法

shiciToAudio = await mcp_server_tools(
        StdioServerParams(
            command="uv",
            args=[
                "--directory",
                "../../Mcp/Mcp_cosyvoice",
                "run",
                "server_json.py"
            ],
            env={
                "DASHSCOPE_API_KEY": "API_KEY",
            }
        )
    )
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