@botrun/mcp-audio-to-text
v2.1.0
Published
MCP Server for audio/video to text transcription using Google Gemini or NCHC TAIDE Whisper
Readme
MCP Audio to Text
一個用於語音轉文字的 MCP Server,支援 Google Gemini 與 NCHC TAIDE Whisper 作為轉錄 provider。
所有 LLM 流量改走 botrun-gate gateway。 因 Gemini 金鑰外洩,本專案不再直連任何 LLM 供應商、也不再持有真實的 Gemini / NCHC 金鑰;兩個 provider 一律透過 gateway 串接,只需設定
BOTRUN_GATE_BASE_URL與BOTRUN_GATE_API_KEY(一把br-key 共用)。
功能特色
- 支援多種音頻/影片格式:
.mp3,.m4a,.wav,.mp4,.webm,.ogg,.flac等 - 自動處理大檔案分割(超過 20MB 或 3 分鐘)
- 中文自動轉為繁體中文
- 可選擇模型(依 provider 而異;詳見下方 MCP Tool 區塊)
系統需求
- Node.js 18+
- ffmpeg(系統層級安裝)
- botrun-gate gateway 的
BOTRUN_GATE_BASE_URL與BOTRUN_GATE_API_KEY(兩個 provider 皆需,共用同一把br-key)
安裝 ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg
# macOS
brew install ffmpeg
# Windows
# 下載 https://ffmpeg.org/download.html 並加到 PATH使用方式
Claude Desktop 設定
編輯設定檔:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
使用 Google Gemini(預設):
{
"mcpServers": {
"audio-to-text": {
"command": "npx",
"args": ["-y", "@botrun/mcp-audio-to-text"],
"env": {
"BOTRUN_GATE_BASE_URL": "https://your-botrun-gate-host",
"BOTRUN_GATE_API_KEY": "br-xxxxxxxx"
}
}
}
}使用 NCHC TAIDE Whisper(需設定 TRANSCRIBER_PROVIDER=nchc,同樣走 gateway):
{
"mcpServers": {
"audio-to-text": {
"command": "npx",
"args": ["-y", "@botrun/mcp-audio-to-text"],
"env": {
"TRANSCRIBER_PROVIDER": "nchc",
"BOTRUN_GATE_BASE_URL": "https://your-botrun-gate-host",
"BOTRUN_GATE_API_KEY": "br-xxxxxxxx"
}
}
}
}Claude CLI 設定
claude mcp add audio-to-text \
-e BOTRUN_GATE_BASE_URL=https://your-botrun-gate-host \
-e BOTRUN_GATE_API_KEY=br-xxxxxxxx \
-- npx -y @botrun/mcp-audio-to-textMCP Tool
transcribe_audio
將音頻或影片檔案轉換為文字。
參數依 TRANSCRIBER_PROVIDER 而異:
Gemini 模式(預設)
| 參數 | 類型 | 必填 | 說明 |
|------|------|------|------|
| file_path | string | 是 | 音頻或影片檔案的絕對路徑 |
| output_dir | string | 是 | 輸出目錄路徑 |
| model | string | 否 | flash(較快,預設)或 pro(較準確) |
| custom_model | string | 否 | 自訂 Gemini 模型名稱(僅支援 gemini 開頭,優先於 model) |
NCHC 模式
| 參數 | 類型 | 必填 | 說明 |
|------|------|------|------|
| file_path | string | 是 | 音頻或影片檔案的絕對路徑 |
| output_dir | string | 是 | 輸出目錄路徑 |
| model | string | 否 | whisper-Breeze-ASR-25(預設)或 Whisper-Large-V3 |
環境變數
| 變數 | 說明 | 必要性 |
|------|------|--------|
| TRANSCRIBER_PROVIDER | gemini(預設)或 nchc | 選配 |
| BOTRUN_GATE_BASE_URL | botrun-gate gateway base URL(兩個 provider 共用) | 必要 |
| BOTRUN_GATE_API_KEY | gateway br- API key(兩個 provider 共用一把) | 必要 |
| TAIDE_BASE_URL | NCHC provider 在 gateway 上的 base 覆寫 | 選配,預設 ${BOTRUN_GATE_BASE_URL}/nchc(依 gateway 端 NCHC_BASE_URL 設定調整) |
License
MIT
