Skip to main content

A MCP server for transcribing audio and video files to text

Project description

Transcriber MCP

音声・動画ファイルをテキストに変換するMCP(Model Context Protocol)準拠のサーバー「Transcriber MCP」です。faster-whisperを利用し、CPU環境で動作する軽量かつ実用的な文字起こしサーバーを提供します。

機能

  • MCPプロトコルに準拠したサーバーの実装
  • 音声・動画ファイル(mp3, mp4, wav, mov, avi)を受け取り、文字起こしを実施
  • 結果をテキストファイル形式で出力
  • MCPクライアントとの通信インターフェースを提供

インストール方法

必要条件

  • Python 3.8以上
  • faster-whisper
  • ffmpeg(音声・動画ファイル処理用)

インストール手順

  1. リポジトリをクローン
git clone https://github.com/yourusername/transcriber-mcp.git
cd transcriber-mcp
  1. 仮想環境の作成と依存パッケージのインストール
# uvを使用して仮想環境を作成
uv venv

# 依存パッケージをインストール
uv pip install -r requirements.txt

使用方法

サーバーの起動

# uvを使用してサーバーを起動
uv run -m src.main

クライアント例を使用した動作確認

# テスト用の音声ファイルを作成
uv pip install gtts
uv run -c "from gtts import gTTS; tts = gTTS('これはテスト用の音声ファイルです。文字起こしが正しく機能するかを確認します。', lang='ja'); tts.save('test_audio.mp3')"

# 文字起こしを実行
uv run -m src.client_example test_audio.mp3

MCPクライアントからの利用

MCPプロトコルに準拠したクライアントから以下のようにリクエストを送信します:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "transcribe",
  "params": {
    "file_path": "/path/to/your/audio_or_video_file.mp3"
  }
}

レスポンス例

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "result": "/path/to/output/audio_or_video_file_transcribed.txt"
  }
}

Clineでの設定方法

Clineと連携して使用することで、LLMとの対話を通じて文字起こしを実行できます。

Clineの設定

Clineの設定ファイル(通常は~/.config/cline/settings/mcp_settings.json)に以下の設定を追加します:

{
  "transcribe": {
    "command": "uv",
    "args": [
      "run",
      "--directory",
      "/path/to/transcriber-mcp",
      "python",
      "-m",
      "src.main",
      "--model-size=base"
    ]
  }
}

--directoryのパスは実際の環境に合わせて変更してください。

--model-sizeは "tiny, "base", "small", "medium", "large" から選択できます。

サポートするファイル形式

  • 音声ファイル: mp3, wav
  • 動画ファイル: mp4, mov, avi

モデルサイズの変更

文字起こしの精度を向上させるために、モデルサイズを変更することができます。

# src/transcriber.py を編集
self.model_size = "medium"  # tiny, base, small, medium, large から選択

より大きなモデルを使用すると精度が向上しますが、メモリ使用量とロード時間が増加します。

将来的な拡張予定

  • タイムスタンプ付き文字起こし
  • 多言語対応
  • モデル切り替え機能

ライセンス

このプロジェクトはMITライセンスの下で公開されています。詳細はLICENSEファイルを参照してください。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_karaage0703_transcriber_mcp-0.1.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_karaage0703_transcriber_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_karaage0703_transcriber_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_karaage0703_transcriber_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 83d3fefaa64743dd3ba3940681911f434528ae961992c1500bffa951661f95a7
MD5 6f04bc6ec56d8f9f33ef6304da7f2201
BLAKE2b-256 77ba0993d38d650f5d78f43ef7aef48d60e9d59dfb0492a2ef7d5a61de0054e4

See more details on using hashes here.

File details

Details for the file iflow_mcp_karaage0703_transcriber_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_karaage0703_transcriber_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_karaage0703_transcriber_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c3cb020e6a3deaac796a67fb952c6dd9c57cad14933de821be9efd92329e240
MD5 bf6d0f62ad6fe12fc61f72367f51207e
BLAKE2b-256 da7e0f6fdac2bfed4f4b08c805800fb909ea5817a5b979c798ceea0c82c6eac7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page