Content
[](https://mseep.ai/app/cengsin-fishaudio-mcp)
# Fish Audio Python MCP Server
This is a text-to-speech MCP server implemented using the Fish Audio API. Through this service, you can convert text into natural human voices, supporting various configuration options.
## Features
- Basic Text-to-Speech: Convert any text into natural human voices
- Advanced Text-to-Speech: Supports custom audio formats, bitrates, and other parameters
- MCP Protocol Compatible: Seamlessly integrates with MCP-enabled applications
## Installation
```bash
pip install -r requirements.txt
```
Or use a Python package manager to install:
```bash
pip install fish-audio-sdk mcp python-dotenv
```
## Configuration
Create a `.env` file in the project root directory with 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 the example
```bash
python example.py
```
### Call the service using the MCP client
```python
# Example 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 Functionality Description
### text_to_speech
Basic text-to-speech function.
Parameters:
- `text`: The text to convert to speech
- `output_path` (optional): Output file path. If not provided, a temporary file will be created.
Returns: The path to the generated audio file
### advanced_text_to_speech
Advanced text-to-speech function, supporting more configuration options.
Parameters:
- `text`: The text to convert to speech
- `output_path` (optional): Output file path. If not provided, a temporary file will be created.
- `format`: Output audio format (mp3, wav, pcm), defaults to mp3
- `mp3_bitrate`: MP3 bitrate (64, 128, 192 kbps), defaults to 128
- `chunk_length`: Chunk length (100-300), defaults to 200
- `normalize`: Whether to normalize the text, defaults to True
- `latency`: Latency mode (normal, balanced), defaults to normal
Returns: The path to the generated audio file
### get_model_info
Get the model information currently in use.
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
markitdown
Python tool for converting files and office documents to Markdown.
Fetch
Retrieve and process content from web pages by converting HTML into markdown format.
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...
chatbox
User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)
continue
Continue is an open-source project for seamless server management.
semantic-kernel
Build and deploy intelligent AI agents with Semantic Kernel's orchestration...