TTS-MCP

Integrations

  • Leverages OpenAI's TTS API to convert text to high-quality speech with multiple voice options, models, and output formats

tts-mcp

OpenAI TTS API を使用して高品質のテキスト読み上げを生成するためのモデル コンテキスト プロトコル (MCP) サーバーおよびコマンドライン ツール。

主な特徴

  • MCP サーバー: Claude Desktop やその他の MCP 対応クライアントとテキスト読み上げ機能を統合します
  • 音声オプション: 複数の音声キャラクター (アロイ、ノヴァ、エコーなど) をサポート
  • 高品質オーディオ: さまざまな出力形式をサポート (MP3、WAV、OPUS、AAC)
  • カスタマイズ可能: 音声速度、音声キャラクター、追加の指示を設定できます
  • CLIツール: 直接テキストを音声に変換するコマンドラインユーティリティとしても利用可能

インストール

方法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.mp3

MCP サーバーの使用状況

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-key

MCP サーバー オプション

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 information

MCPクライアントとの統合

MCPサーバーは、Claude Desktopおよびその他のMCP対応クライアントで使用できます。Claude Desktopとの連携については、以下をご覧ください。

  1. Claude Desktop 構成ファイルを開きます (通常は~/Library/Application Support/Claude/claude_desktop_config.jsonにあります)
  2. 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 つの方法で提供できます。

  1. 直接的な方法(テストに推奨): --api-keyパラメータを使用してargs配列に含める
  2. 環境変数メソッド(より安全):上記のようにenvオブジェクトに設定する

セキュリティに関する注意: API キーを含める場合は、必ず構成ファイルを保護してください。

  1. Claudeデスクトップを再起動します
  2. クロードに「このテキストを読み上げて」などのリクエストをすると、テキストが音声に変換されます。

利用可能な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 nova

CLIツールオプション

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

ライセンス

マサチューセッツ工科大学

-
security - not tested
A
license - permissive license
-
quality - not tested

高品質のテキスト読み上げ機能を Claude Desktop やその他の MCP 互換クライアントと統合し、複数の音声オプションとオーディオ形式をサポートするモデル コンテキスト プロトコル サーバーです。

  1. Main Features
    1. Installation
      1. Method 1: Install from Repository
      2. Method 2: Run Directly with npx (No Installation Required)
    2. MCP Server Usage
      1. Starting the MCP Server
      2. MCP Server Options
      3. Integrating with MCP Clients
      4. Available MCP Tools
    3. CLI Tool Usage
      1. CLI Tool Options
    4. Supported Voices
      1. Supported Models
        1. Output Formats
          1. Environment Variables
            1. License
              ID: giltt11bwx