Content
[](https://mseep.ai/app/cengsin-fishaudio-mcp)
# Fish Audio Python MCP Service
This is a text-to-speech MCP service implemented using the Fish Audio API. With this service, you can convert text into natural human speech, supporting various configuration options.
## Features
- Basic text-to-speech: Convert any text into natural human voice
- Advanced text-to-speech: Supports custom audio formats, bitrates, and other parameters
- MCP protocol compatibility: Seamlessly integrates with applications that support MCP
## Install Dependencies
```bash
pip install -r requirements.txt
```
Or install using Python package manager:
```bash
pip install fish-audio-sdk mcp python-dotenv
```
## Configuration
Create a `.env` file in the root directory of the project, containing the following content:
```
API_KEY=your_fish_audio_api_key
MODEL_ID=your_fish_audio_model_id
```
You need to replace it with your Fish Audio API key and model ID.
## Usage
### Start the Service
```bash
python app.py
```
Or use the MCP CLI tool:
```bash
mcp run --file app.py
```
### Run Example
```bash
python example.py
```
### Call the Service Using MCP Client
```python
# Sample code
from mcp.client import MCPClient
client = MCPClient("subprocess://python app.py")
result = client.call("text_to_speech", {"text": "你好,世界!"})
print(result) # Print the generated audio file path
```
## API Function Description
### text_to_speech
Basic text-to-speech functionality.
Parameters:
- `text`: The text to be converted to speech
- `output_path` (optional): The output file path; if not provided, a temporary file will be created
Returns: The path of the generated audio file
### advanced_text_to_speech
Advanced text-to-speech functionality, supporting more configuration options.
Parameters:
- `text`: The text to be converted to speech
- `output_path` (optional): The output file path; if not provided, a temporary file will be created
- `format`: Output audio format (mp3, wav, pcm), default is mp3
- `mp3_bitrate`: MP3 bitrate (64, 128, 192 kbps), default is 128
- `chunk_length`: Chunk length (100-300), default is 200
- `normalize`: Whether to normalize the text, default is True
- `latency`: Latency mode (normal, balanced), default is normal
Returns: The path of the generated audio file
### get_model_info
Get information about the currently used model.
Returns: A dictionary containing the model ID and API key prefix
### get_available_models
Get a list of available Fish Audio models.
Returns: A list of available model information
## License
MIT
Connection Info
You Might Also Like
semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
repomix
📦 Repomix is a powerful tool that packs your entire repository into a...
Serena
A powerful coding agent toolkit providing semantic retrieval and editing...
Blender
BlenderMCP integrates Blender with Claude AI for enhanced 3D modeling.
pydantic-ai
GenAI Agent Framework, the Pydantic way
cua
Open-source infrastructure for Computer-Use Agents. Sandboxes, SDKs, and...