tts-mcp
OpenAI TTS API を使用して高品質のテキスト読み上げを生成するためのモデル コンテキスト プロトコル (MCP) サーバーおよびコマンドライン ツール。
主な特徴
MCP サーバー: Claude Desktop やその他の MCP 対応クライアントとテキスト読み上げ機能を統合します
音声オプション: 複数の音声キャラクター (アロイ、ノヴァ、エコーなど) をサポート
高品質オーディオ: さまざまな出力形式をサポート (MP3、WAV、OPUS、AAC)
カスタマイズ可能: 音声速度、音声キャラクター、追加の指示を設定できます
CLIツール: 直接テキストを音声に変換するコマンドラインユーティリティとしても利用可能
Related MCP server: MCP Memory Server
インストール
方法1: リポジトリからインストールする
# Clone the repository
git clone https://github.com/nakamurau1/tts-mcp.git
cd tts-mcp
# Install dependencies
npm install
# Optional: Install globally
npm install -g .方法2: npx で直接実行する(インストール不要)
# Start the MCP server directly
npx tts-mcp tts-mcp-server --voice nova --model tts-1-hd
# Use the CLI tool directly
npx tts-mcp -t "Hello, world" -o hello.mp3MCP サーバーの使用状況
MCP サーバーを使用すると、Claude Desktop などの Model Context Protocol (MCP) 互換クライアントとテキスト読み上げ機能を統合できます。
MCPサーバーの起動
# Start with default settings
npm run server
# Start with custom settings
npm run server -- --voice nova --model tts-1-hd
# Or directly with API key
node bin/tts-mcp-server.js --voice echo --api-key your-openai-api-keyMCP サーバー オプション
Options:
-V, --version Display version information
-m, --model <model> TTS model to use (default: "gpt-4o-mini-tts")
-v, --voice <voice> Voice character (default: "alloy")
-f, --format <format> Audio format (default: "mp3")
--api-key <key> OpenAI API key (can also be set via environment variable)
-h, --help Display help informationMCPクライアントとの統合
MCPサーバーは、Claude Desktopおよびその他のMCP対応クライアントで使用できます。Claude Desktopとの連携については、以下をご覧ください。
Claude Desktop 構成ファイルを開きます (通常は
~/Library/Application Support/Claude/claude_desktop_config.jsonにあります)OpenAI API キーを含む次の構成を追加します。
{
"mcpServers": {
"tts-mcp": {
"command": "node",
"args": ["full/path/to/bin/tts-mcp-server.js", "--voice", "nova", "--api-key", "your-openai-api-key"],
"env": {
"OPENAI_API_KEY": "your-openai-api-key"
}
}
}
}あるいは、npx を使用するとセットアップが簡単になります。
{
"mcpServers": {
"tts-mcp": {
"command": "npx",
"args": ["-p", "tts-mcp", "tts-mcp-server", "--voice", "nova", "--model", "gpt-4o-mini-tts"],
"env": {
"OPENAI_API_KEY": "your-openai-api-key"
}
}
}
}API キーは次の 2 つの方法で提供できます。
直接的な方法(テストに推奨):
--api-keyパラメータを使用してargs配列に含める環境変数メソッド(より安全):上記のように
envオブジェクトに設定する
セキュリティに関する注意: API キーを含める場合は、必ず構成ファイルを保護してください。
Claudeデスクトップを再起動します
クロードに「このテキストを読み上げて」などのリクエストをすると、テキストが音声に変換されます。
利用可能なMCPツール
テキスト読み上げ: テキストを音声に変換して再生するツール
CLIツールの使用
tts-mcp をスタンドアロンのコマンドライン ツールとして使用することもできます。
# Convert text directly
tts-mcp -t "Hello, world" -o hello.mp3
# Convert from a text file
tts-mcp -f speech.txt -o speech.mp3
# Specify custom voice
tts-mcp -t "Welcome to the future" -o welcome.mp3 -v novaCLIツールオプション
Options:
-V, --version Display version information
-t, --text <text> Text to convert
-f, --file <path> Path to input text file
-o, --output <path> Path to output audio file (required)
-m, --model <n> Model to use (default: "gpt-4o-mini-tts")
-v, --voice <n> Voice character (default: "alloy")
-s, --speed <number> Speech speed (0.25-4.0) (default: 1)
--format <format> Output format (default: "mp3")
-i, --instructions <text> Additional instructions for speech generation
--api-key <key> OpenAI API key (can also be set via environment variable)
-h, --help Display help informationサポートされている音声
次の音声キャラクターがサポートされています:
合金(デフォルト)
灰
コーラル
エコー
寓話
オニキス
新星
セージ
きらめき
サポートされているモデル
tts-1
tts-1-hd
gpt-4o-mini-tts(デフォルト)
出力形式
次の出力形式がサポートされています。
mp3(デフォルト)
作品
AAc
フラック
ウェーブ
PCM
環境変数
システム環境変数を使用してツールを構成することもできます。
OPENAI_API_KEY=your-api-key-hereライセンス
マサチューセッツ工科大学
This server cannot be installed
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.