gpt-sovits-mcp-server
FastAPI-MCP server for GPT-SoVITS integration with cross-platform support and character voice presets
Documentation
GPT-SoVITS MCP Server
このプロジェクトは、GPT-SoVITSのAPIサーバーをModel Context Protocol (MCP) ツールとして利用できるようにするMCPサーバーです。FastAPI-MCPを使用してSwagger仕様から自動的にMCPツール定義を生成します。
機能
- Text-to-Speech合成: テキストから音声を生成
- 音声クローニング: 参照音声を使用した声質の複製
- マルチ言語対応: 中国語、英語、日本語、韓国語、粤語をサポート
- モデル管理: GPT/SoVITSモデルの動的切り替え
- ストリーミング対応: リアルタイム音声配信
- MCP統合: AI エージェントとの統合
必要な環境
- Python 3.11以上(Windows/macOS/Linux対応)
- GPT-SoVITS API サーバー(ポート9880で実行中)
インストール
Windows
1. Python のインストール:
2. 依存関係をインストール:
python -m pip install -r requirements.txt3. GPT-SoVITS API サーバーを起動:
cd GPT-SoVITS
python api.pymacOS/Linux
1. 依存関係をインストール:
python3.11 -m pip install -r requirements.txt
# または
pip install -r requirements.txt2. GPT-SoVITS API サーバーを起動:
cd GPT-SoVITS
python3.11 api.py
# または
python api.py使用方法
簡単起動(推奨)
Windows
start_server.batmacOS/Linux
./start_server.sh手動起動
Windows
python fastapi_mcp_server.pymacOS/Linux
python3.11 fastapi_mcp_server.pyオプション
- `--host`: バインドするホスト (デフォルト: 0.0.0.0)
- `--port`: バインドするポート (デフォルト: 8000)
- `--gpt-sovits-url`: GPT-SoVITS APIのURL (デフォルト: http://localhost:9880)
- `--reload`: 自動リロードを有効化
環境変数
- `SOVITS_VOICES_PATH`: 音声ファイルのベースパス
- `HOST`: サーバーのホスト
- `PORT`: サーバーのポート
エンドポイント
サーバー起動後、以下のエンドポイントが利用可能になります:
- API ドキュメント: http://localhost:8000/docs
- MCP エンドポイント: http://localhost:8000/mcp
- ヘルスチェック: http://localhost:8000/health
利用可能なMCPツール
1. text_to_speech (`/tts`)
2. set_model (`/set_model`)
3. set_reference (`/set_reference`)
4. control_server (`/control`)
API 使用例
テキストから音声合成
curl -X POST "http://localhost:8000/tts" \
-H "Content-Type: application/json" \
-d '{
"text": "こんにちは、世界",
"text_lang": "ja",
"refer_wav_path": "path/to/reference.wav",
"prompt_text": "参照音声のテキスト"
}'モデルの設定
curl -X POST "http://localhost:8000/set_model" \
-H "Content-Type: application/json" \
-d '{
"gpt_model_path": "path/to/gpt.ckpt",
"sovits_model_path": "path/to/sovits.pth"
}'MCP統合
このサーバーは Model Context Protocol (MCP) に対応しており、Claude等のAIエージェントから直接音声合成機能を利用できます。
Claude Desktopでの設定
設定ファイルの場所
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
Windows用設定
{
"mcpServers": {
"gpt-sovits": {
"command": "python",
"args": ["C:\\path\\to\\sovits_mcp\\fastapi_mcp_server.py"],
"env": {
"HOST": "127.0.0.1",
"PORT": "8000",
"SOVITS_VOICES_PATH": "C:\\voices\\characters"
}
}
}
}macOS/Linux用設定
{
"mcpServers": {
"gpt-sovits": {
"command": "python3.11",
"args": ["/path/to/sovits_mcp/fastapi_mcp_server.py"],
"env": {
"HOST": "127.0.0.1",
"PORT": "8000",
"SOVITS_VOICES_PATH": "/voices/characters"
}
}
}
}SSE (Server-Sent Events) を使用する場合
FastAPI-MCPは自動的に `/mcp` エンドポイントでSSE接続を提供します。SSEプロキシを使用する場合:
{
"mcpServers": {
"gpt-sovits-sse": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-fetch", "http://127.0.0.1:8000/mcp"],
"env": {}
}
}
}設定ファイルの場所
プロジェクトには複数の設定例が含まれています:
Windows用
- `claude_desktop_config_windows.json` - Claude Desktop用の設定
- `mcp_windows.json` - 基本的なMCP設定
- `mcp_sse_windows.json` - SSE プロキシを使用した設定
- `start_server.bat` - Windows用起動スクリプト
macOS/Linux用
- `claude_desktop_config.json` - Claude Desktop用の設定
- `mcp.json` - 基本的なMCP設定
- `mcp_sse.json` - SSE プロキシを使用した設定
- `start_server.sh` - macOS/Linux用起動スクリプト
トラブルシューティング
Windows固有の問題
Python が見つからない
python --version- エラーが出る場合は、Python がPATHに追加されていない
- Python インストール時に「Add Python to PATH」をチェックする
- または `py` コマンドを使用する
音声ファイルパスのエラー
- Windowsではバックスラッシュ(`\`)を使用
- または環境変数 `SOVITS_VOICES_PATH` を設定
set SOVITS_VOICES_PATH=C:\voices\characters共通の問題
GPT-SoVITS APIサーバーに接続できない
- GPT-SoVITS APIサーバーが起動していることを確認
- ポート9880が使用可能であることを確認
- ファイアウォールの設定を確認
依存関係のエラー
- Python 3.11以上を使用していることを確認
- `pip install -r requirements.txt` で依存関係をインストール
音声ファイルが見つからない
- `SOVITS_VOICES_PATH` 環境変数を正しく設定
- 音声ファイルが指定されたパスに存在することを確認
- デフォルトでは `voices/characters/` フォルダを使用
ライセンス
このプロジェクトはMITライセンスの下で公開されています。
Frequently asked questions
What is gpt-sovits-mcp-server?
gpt-sovits-mcp-server is FastAPI-MCP server for GPT-SoVITS integration with cross-platform support and character voice presets
How do I install gpt-sovits-mcp-server?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is gpt-sovits-mcp-server open source?
Yes — it is hosted on GitHub at https://github.com/ganpare/gpt-sovits-mcp-server.
Related MCP tools
🙌 OpenHands: Code Less, Make More for the Model Context Protocol. Enhance AI assistants with powerful integrations. Python-based implementation.
Universal memory layer for AI Agents; Announcing OpenMemory MCP - local and secure memory management. Python-based implementation.
基于大模型搭建的聊天机器人,同时支持 微信公众号、企业微信应用、飞书、钉钉 等接入,可选择ChatGPT/Claude/DeepSeek/文心一言/讯飞星火/通义千问/ Gemini/GLM-4/Kimi/LinkAI,能处理文本、语音和图片,访问操作系统和互联网,支持基于自有知识库进行定制企业智能客服。
An LLM agent that conducts deep research (local and web) on any given topic and generates a long report with citations. Built for the Model Context Protocol to
🚀 The fast, Pythonic way to build MCP servers and clients Trusted by 19900+ developers. Trusted by 19900+ developers. Trusted by 19900+ developers.
🔥 MaxKB is an open-source platform for building enterprise-grade agents. MaxKB 是强大易用的开源企业级智能体平台。 for the Model Context Protocol. Enhance AI assistants with po
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP