Skip to main content
Glama

TTS-MCP

by nakamurau1
index.ts1.38 kB
import { textToSpeech } from './api'; import { readTextFile, ensureOutputDirectory, validateOptions, getOutputPath } from './utils'; import { CommandLineOptions } from './types'; /** * メインのアプリケーションロジック * @param {CommandLineOptions} options - コマンドラインオプション * @returns {Promise<void>} */ export async function run(options: CommandLineOptions): Promise<void> { try { // オプションの検証 validateOptions(options); // 出力パスの取得 const outputPath = getOutputPath(options); // 出力ディレクトリの確認 await ensureOutputDirectory(outputPath); // テキストの取得(ファイルまたは直接入力) let text = options.text || ''; if (options.file) { text = await readTextFile(options.file); } // テキストを音声に変換 await textToSpeech({ text, outputPath, model: options.model || 'gpt-4o-mini-tts', voice: options.voice || 'alloy', speed: options.speed || 1.0, format: options.format || 'mp3', instructions: options.instructions, apiKey: options.apiKey || process.env.OPENAI_API_KEY || '' }); console.log('処理が完了しました。'); } catch (error) { console.error('エラー:', (error as Error).message); process.exit(1); } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nakamurau1/tts-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server