audio-transcription-mcp

audio-transcription-mcp

MCP server for audio transcription with speaker diarization. Transcribes MP3/WAV files using Faster-Whisper and pyannote.audio, outputs markdown with speaker labels, timestamps, summaries, and action items.

Category
访问服务器

README

Audio Transcription MCP

License: MIT Python 3.11+ Docker

MCP (Model Context Protocol) server for audio transcription with speaker diarization. Transcribes MP3/WAV files using Faster-Whisper and pyannote.audio, outputting markdown with speaker labels, timestamps, summaries, and action items.

✨ Features

  • 🎤 Speaker Diarization - Identifies and labels different speakers (Speaker 1, Speaker 2, etc.)
  • 📝 Markdown Output - Clean, formatted transcripts with timestamps
  • 🐳 Docker Ready - CPU and GPU containers for easy deployment
  • 🚀 MCP Protocol - Integrates with GitHub Copilot CLI and other MCP clients
  • 🔒 Offline Capable - Models cached locally after first run
  • GPU Acceleration - NVIDIA CUDA support for faster processing

📋 Requirements

Prerequisites

  • Python 3.11+ (for local development)
  • Docker (recommended for deployment)
  • Hugging Face Account (free, for model access)
  • NVIDIA GPU + CUDA 12.3 (optional, for GPU acceleration)

Hugging Face Setup (Required)

  1. Create a free account at huggingface.co
  2. Accept model terms:
  3. Generate a token at huggingface.co/settings/tokens

🚀 Quick Start

Option 1: Docker (Recommended)

# Clone the repository
git clone https://github.com/ebmarquez/audio-transcription-mcp.git
cd audio-transcription-mcp

# Create .env file with your HF token
echo "HF_TOKEN=hf_your_token_here" > .env

# Build and run with Docker Compose
cd docker
docker compose up -d

# Container is now running at http://localhost:8080/mcp

Option 2: Docker Run (One-Shot)

# CPU version
docker run --rm \
  -e HF_TOKEN="hf_your_token" \
  -v $(pwd)/input:/input:ro \
  -v $(pwd)/output:/output \
  -v $(pwd)/models:/root/.cache \
  -p 8080:8080 \
  audio-transcription-mcp:cpu

# GPU version (NVIDIA)
docker run --rm --gpus all \
  -e HF_TOKEN="hf_your_token" \
  -v $(pwd)/input:/input:ro \
  -v $(pwd)/output:/output \
  -v $(pwd)/models:/root/.cache \
  -p 8080:8080 \
  audio-transcription-mcp:gpu

Option 3: Local Development

# Clone and install
git clone https://github.com/ebmarquez/audio-transcription-mcp.git
cd audio-transcription-mcp
pip install -e .

# Set up environment
cp .env.example .env
# Edit .env and add your HF_TOKEN

# Run MCP server
python -m audio_transcription_mcp

🔧 MCP Client Configuration

GitHub Copilot CLI (Docker Mode)

Add to your mcp.json:

{
  "mcpServers": {
    "audio-transcription": {
      "url": "http://localhost:8080/mcp",
      "transport": "streamable-http"
    }
  }
}

GitHub Copilot CLI (Local Mode)

{
  "mcpServers": {
    "audio-transcription": {
      "command": "python",
      "args": ["-m", "audio_transcription_mcp"],
      "env": {
        "HF_TOKEN": "${HF_TOKEN}",
        "OUTPUT_DIR": "./transcriptions"
      }
    }
  }
}

🛠️ MCP Tools

transcribe_audio

Transcribe a single audio file with speaker diarization.

transcribe_audio(
    file_path="/input/meeting.mp3",
    output_dir="/output",
    model_size="large-v3",
    include_timestamps=True,
    generate_summary=True
)

transcribe_directory

Batch transcribe all audio files in a directory.

transcribe_directory(
    directory_path="/input",
    output_dir="/output",
    recursive=False
)

get_transcription_status

Check if an audio file has been transcribed.

get_transcription_status(file_path="/input/meeting.mp3")

📄 Output Format

Transcriptions are saved as markdown files:

# Audio Transcription: meeting-recording.mp3

## Metadata
- **Source File**: meeting-recording.mp3
- **Duration**: 45:32
- **Speakers Detected**: 3
- **Transcription Date**: 2026-01-29
- **Model**: faster-whisper large-v3

---

## Transcript

### [00:00:00] **Speaker 1**
Good morning everyone. Let's get started with our weekly sync.

### [00:00:05] **Speaker 2**
Thanks for organizing this. I have a few updates on the project.

...

---

## Summary
[AI-generated summary placeholder]

## Key Points
- Point 1 extracted from conversation
- Point 2 extracted from conversation

## Action Items
- [ ] Action item 1 - Assigned to: Speaker 1
- [ ] Action item 2 - Assigned to: Speaker 2

⚙️ Configuration

Environment Variables

Variable Description Default
HF_TOKEN Hugging Face token (required) -
WHISPER_MODEL Model size: tiny/base/small/medium/large-v3 large-v3
LANGUAGE Transcription language (ISO 639-1) en
MAX_FILE_SIZE_GB Maximum file size in GB 1
INPUT_DIR Input directory for audio files ./input
OUTPUT_DIR Output directory for transcriptions ./output
MCP_TRANSPORT Transport mode: stdio/streamable-http streamable-http
MCP_PORT HTTP port (for streamable-http) 8080
CUDA_VISIBLE_DEVICES GPU device ID (-1 for CPU) 0

Model Size Comparison

Model Accuracy Speed Memory
tiny Fastest ~1GB
base ⭐⭐ Fast ~1GB
small ⭐⭐⭐ Moderate ~2GB
medium ⭐⭐⭐⭐ Slow ~5GB
large-v3 ⭐⭐⭐⭐⭐ Slowest ~10GB

📁 Project Structure

audio-transcription-mcp/
├── docker/
│   ├── Dockerfile.cpu          # CPU container
│   ├── Dockerfile.gpu          # GPU container (NVIDIA)
│   ├── docker-compose.yml      # Development compose
│   ├── docker-compose.prod.yml # Production compose
│   └── entrypoint.sh           # Container startup
├── src/
│   └── audio_transcription_mcp/
│       ├── __init__.py
│       ├── __main__.py         # Entry point
│       ├── server.py           # MCP server
│       ├── config.py           # Configuration
│       ├── audio_processor.py  # File handling
│       ├── transcriber.py      # Faster-Whisper
│       ├── diarizer.py         # pyannote.audio
│       ├── segment_merger.py   # Align segments
│       └── markdown_generator.py
├── tests/
├── input/                      # Audio files (mount point)
├── output/                     # Transcriptions (mount point)
├── models/                     # Model cache (mount point)
├── .env.example
├── pyproject.toml
└── requirements.txt

🐳 Docker Volumes

Mount Point Purpose Mode
/input Audio files to transcribe Read-only
/output Transcription results Read-write
/root/.cache Model cache (persistent) Read-write

⚠️ Known Limitations

  • Speaker Diarization: Works best with 2-6 distinct speakers
  • Audio Quality: May struggle with background noise, overlapping speech, or phone/video call audio
  • Large Files: Files over 30 minutes may take significant processing time
  • First Run: Initial model download requires internet connection (~3GB)

🔒 Security

  • HF_TOKEN: Store securely, never commit to repository
  • Input Validation: Strict file type and size validation
  • Path Traversal: All file paths are sanitized
  • Container Isolation: Runs with minimal privileges

📜 License

MIT License - see LICENSE for details.

🙏 Acknowledgments

  • Faster-Whisper - Fast Whisper implementation
  • pyannote.audio - Speaker diarization
  • Model Context Protocol - MCP specification MCP server for audio transcription with speaker diarization. Transcribes MP3/WAV files using Faster-Whisper and pyannote.audio, outputs markdown with speaker labels, timestamps, summaries, and action items. Dockerized for easy deployment (CPU/GPU).

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选