GPT-SoVITS MCP Server
Enables text-to-speech synthesis and voice cloning through GPT-SoVITS API integration. Supports multiple languages (Chinese, English, Japanese, Korean, Cantonese), dynamic model switching, and reference audio-based voice quality replication.
README
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
-
Python のインストール:
- Python公式サイトからPython 3.11以上をダウンロード
- インストール時に「Add Python to PATH」をチェック
-
依存関係をインストール:
python -m pip install -r requirements.txt -
GPT-SoVITS API サーバーを起動:
cd GPT-SoVITS python api.py
macOS/Linux
-
依存関係をインストール:
python3.11 -m pip install -r requirements.txt # または pip install -r requirements.txt -
GPT-SoVITS API サーバーを起動:
cd GPT-SoVITS python3.11 api.py # または python api.py
使用方法
簡単起動(推奨)
Windows
start_server.bat
macOS/Linux
./start_server.sh
手動起動
Windows
python fastapi_mcp_server.py
macOS/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ツール
-
text_to_speech (
/tts)- テキストから音声を合成
- 参照音声による音声クローニング対応
- 複数の音声フォーマット対応 (wav, ogg, aac)
-
set_model (
/set_model)- GPT/SoVITSモデルの重みを設定
- 動的なモデル切り替え
-
set_reference (
/set_reference)- デフォルトの参照音声とプロンプトテキストを設定
- 音声クローニングの基準となる声質を設定
-
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ライセンスの下で公開されています。
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.