概要
What is Mcp_cosyvoice?
Mcp_cosyvoice is a Python-based MCP server that calls the Ali CosyVoice1 API to convert text input into audio and saves the resulting file to a user-specified directory. It is intended for developers who need to integrate text-to-speech functionality into MCP-compatible AI workflows.
How to use Mcp_cosyvoice?
Create and activate a Python virtual environment with uv venv .venv, then install dependencies with uv sync. The server is invoked via stdio, for example in Autogen by passing StdioServerParams with command="uv", args=["--directory", "../../Mcp/Mcp_cosyvoice", "run", "main.py"], and the environment variable ALI_KEY set to your API key.
Key features of Mcp_cosyvoice
- Converts text to audio using the Ali CosyVoice1 API.
- Saves generated audio files to a specified directory.
- Runs as an MCP server for easy integration with AI frameworks.
- Managed via
uvfor dependency and environment setup.
Use cases of Mcp_cosyvoice
- Generating voiceovers or narrations from text within MCP‑enabled agents.
- Adding text-to-speech capabilities to automated content pipelines.
- Producing audio files for accessibility or multi‑modal outputs.
FAQ from Mcp_cosyvoice
What dependencies does Mcp_cosyvoice require?
It requires Python, the uv package manager, and access to the Ali CosyVoice1 API via an API key.
How do I provide the API key for Mcp_cosyvoice?
Set the environment variable ALI_KEY to your Ali CosyVoice1 API key when starting the server (e.g., in the env dictionary of StdioServerParams).
What transport protocol does Mcp_cosyvoice use?
It uses stdio transport. The server is launched as a subprocess via the uv command, as shown in the Autogen example.
Where are the generated audio files saved?
The server saves the audio files to a directory specified by the user (exact path configuration is not detailed in the README, but the description states it converts text to audio and saves to a specified directory).