Content
## Project Introduction
This project aims to encapsulate the official TTS API of Volc Engine into a standard MCP protocol tool, supporting natural language parameter calls on platforms like Cursor and Claude, and enabling one-click voice synthesis. It is suitable for developer scenarios that require custom voice, parameter mapping, and automated batch voice generation.
# doubao_tts_mcp Usage Instructions
## Quick Start
### 0. Clone Project Code
```bash
git clone https://github.com/lxy2109/doubao-tts-mcp.git
cd doubao-tts-mcp
```
## Python Environment Preparation
- This project requires Python 3.8 or higher.
- It is recommended to download and install the latest version from the [Python official website](https://www.python.org/downloads/).
- After installation, enter `python --version` or `python3 --version` in the command line to check the version.
### 1. Install Dependencies
```bash
pip install -r requirements.txt
```
### 2. Install Local Package (Support Command Line Call)
```bash
pip install -e .
```
### 3. Configure Environment Variables
Can be set in `.env` or the `env` field of `mcp.json`:
(Get method: https://console.volcengine.com/speech/service/10007)
- VOLC_APPID
- VOLC_TOKEN
- PORT (if custom port is required)
- OUTPUT_DIR (audio output directory)
### 4. Start Service from Command Line
```bash
doubao-tts-mcp
```
### 5. cursor mcp.json Configuration Example
```json
{
"mcpServers": {
"doubao_tts_mcp": {
"command": "doubao-tts-mcp",
"args": [],
"env": {
"VOLC_APPID": "your appid",
"VOLC_TOKEN": "your token",
"PORT": "5001",
"OUTPUT_DIR": "D:/doubao_tts_mcp/output"
}
}
}
}
```
### 6. Use on Cursor/Claude and Other Platforms
- The platform will automatically read `mcp.json` and start the MCP service using the command line.
- Fill in parameters on the MCP panel to synthesize audio with one click.
- The synthesis result will return the absolute path of the audio file, and the file will be saved in the specified directory.
### 7. Frequently Asked Questions
- **Q: How to make MCP tool support command line call?**
- A: Please ensure that `pyproject.toml` is configured with `entry_points`, and install the local package with `pip install -e .`.
- **Q: Bit rate and sampling rate cannot be adjusted?**
- A: Due to MCP tool schema type verification restrictions, `bitrate` and `rate` parameters are currently not available, and it is recommended to use default values.
- **Q: How to fill in parameters like voice, emotion, and speech rate?**
- A: Supports natural language keywords (such as "girl" and "lolita"), which will be intelligently mapped to official voice.
## Example Call
```json
{
"text": "Test voice parameters",
"voice_type": "girl",
"speed_ratio": 0.8,
"emotion": "happy",
"output_filename": "Girl voice test"
}
```
## Reference
- [Volc Engine Speech Synthesis API Documentation](https://www.volcengine.com/docs/6561/1257584)
- [Model Context Protocol Python SDK](https://github.com/modelcontextprotocol/python-sdk)