whisper-telegram-mcp
whisper-telegram-mcp
Transkribieren und sprechen — Zwei-Wege-Sprachkommunikation für Claude via Telegram

Ein MCP-Server, der Claude Zwei-Wege-Sprachfunktionen via Telegram verleiht: Transkribieren eingehender Sprachnachrichten mit Whisper und Antworten mit synthetisierter Sprache. Funktioniert mit Claude Desktop, Claude Code und jedem MCP-kompatiblen Client.
Was er kann
Lokale Audiodateien transkribieren -- OGG, WAV, MP3, FLAC und mehr
Telegram-Sprachnachrichten transkribieren -- übergeben Sie eine
file_id, erhalten Sie Text zurückText als Sprachnachricht ausgeben -- Sprache synthetisieren und als OGG zurücksenden (wird in Telegram als Sprachnachricht abgespielt)
Zwei Transkriptions-Backends -- lokales faster-whisper (kostenlos, privat) oder OpenAI Whisper API (Cloud)
Auto-Modus -- versucht zuerst lokal, greift bei Fehlern auf OpenAI zurück
Spracherkennung -- automatisch oder durch Angabe eines ISO-639-1-Codes
Zeitstempel auf Wortebene -- optionales, fein abgestimmtes Timing
Related MCP server: MCP Video & Audio Text Extraction Server
Voraussetzungen
Funktion | Anforderung |
Transkription (lokal) | Keine — faster-whisper gebündelt via |
Transkription (Cloud) |
|
Sprachantworten — Kokoro (beste Qualität) | Docker — führen Sie |
Sprachantworten — OpenAI TTS (Fallback) |
|
Sprachantworten — macOS say (letzter Ausweg) | Nur Mac, keine Einrichtung |
Kokoro erfordert Docker. Wenn Docker nicht läuft, greifen Sprachantworten automatisch auf OpenAI TTS oder macOS
sayzurück.
Schnellstart
Einrichtung in 30 Sekunden mit Claude Code
Der schnellste Weg zum Start — sagen Sie Claude Code einfach, dass es die Einrichtung für Sie übernehmen soll:
Fügen Sie dies zu Ihrer
.mcp.json(Claude Code) oderclaude_desktop_config.json(Claude Desktop) hinzu:
{
"mcpServers": {
"whisper-telegram-mcp": {
"command": "uvx",
"args": ["whisper-telegram-mcp"],
"env": {
"TELEGRAM_BOT_TOKEN": "your-bot-token-here"
}
}
}
}Starten Sie Claude neu und sagen Sie: "Set up my Telegram bot for voice transcription" — Claude führt Sie durch die Erstellung des Bots mit BotFather und die Konfiguration.
Ein Befehl mit uvx
uvx whisper-telegram-mcpKeine Installation erforderlich -- uvx erledigt alles.
Oder Installation mit pip
pip install "whisper-telegram-mcp[all]"
whisper-telegram-mcpTelegram-Bot-Einrichtung
Öffnen Sie Telegram und schreiben Sie @BotFather
Senden Sie
/newbotund folgen Sie den Anweisungen, um einen Bot zu erstellenKopieren Sie das Token (sieht aus wie
1234567890:ABCdef...)Fügen Sie
TELEGRAM_BOT_TOKENzu Ihrer MCP-Konfigurationsumgebung hinzu (siehe unten)Schreiben Sie Ihrem Bot, um zu starten — er antwortet nur autorisierten Benutzern
Das Claude Telegram-Plugin übernimmt die Zugriffskontrolle. Siehe dessen Dokumentation für die Einrichtung von Pairing/Allowlist.
Integration
Claude Desktop
Fügen Sie dies zu Ihrer Claude Desktop-Konfiguration hinzu (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"whisper-telegram-mcp": {
"command": "uvx",
"args": ["whisper-telegram-mcp"],
"env": {
"WHISPER_MODEL": "base",
"WHISPER_BACKEND": "auto",
"TELEGRAM_BOT_TOKEN": "your-bot-token-here"
}
}
}
}Claude Code
Fügen Sie dies zu Ihrer .mcp.json im Projekt hinzu:
{
"mcpServers": {
"whisper-telegram-mcp": {
"command": "uvx",
"args": ["whisper-telegram-mcp"],
"env": {
"WHISPER_MODEL": "base",
"WHISPER_BACKEND": "auto",
"TELEGRAM_BOT_TOKEN": "your-bot-token-here"
}
}
}
}Tools
Tool | Beschreibung |
| Transkribiert eine lokale Audiodatei (OGG, WAV, MP3, etc.) in Text |
| Lädt eine Telegram-Sprachnachricht per |
| Konvertiert Text in Sprache → OGG/Opus-Datei (wird als Sprachnachricht in Telegram abgespielt) |
| Listet verfügbare Whisper-Modellgrößen mit Geschwindigkeits-/Genauigkeitsinformationen auf |
| Überprüft, welche Backends (lokal/OpenAI) verfügbar und konfiguriert sind |
transcribe_audio
file_path: str # Absolute path to audio file
language: str | None # ISO-639-1 code (e.g. "en"), None = auto-detect
word_timestamps: bool # Include word-level timestamps (default: false)transcribe_telegram_voice
file_id: str # Telegram voice message file_id
bot_token: str | None # Bot token (falls back to TELEGRAM_BOT_TOKEN env var)
language: str | None # ISO-639-1 code, None = auto-detect
word_timestamps: bool # Include word-level timestamps (default: false)speak_text
Konvertiert Text in eine OGG/Opus-Audiodatei. Wählt automatisch das beste verfügbare TTS-Backend aus.
text: str # Text to synthesise
voice: str # Voice name (default: "af_sky")
output_path: str|None # Optional path for output .ogg fileTTS-Backends (in Prioritätsreihenfolge):
Backend | Kosten | Qualität | Einrichtung |
Kokoro (lokal) | Kostenlos | Natürlich, hohe Qualität | Manuell starten (siehe unten) |
OpenAI TTS (Cloud) | ~$0.015/1k Zeichen | Hohe Qualität |
|
macOS say (Fallback) | Kostenlos | Robotisch | Nur Mac, keine Einrichtung |
Im auto-Modus (Standard) versucht der Server zuerst Kokoro, dann OpenAI, dann macOS say. Konfigurieren Sie dies mit der Umgebungsvariable TTS_BACKEND.
Kokoro lokal starten:
Kokoro FastAPI ist nicht auf PyPI — starten Sie es, bevor Sie den MCP-Server ausführen:
# Docker (simplest, recommended)
docker run -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-cpu:latest
# Apple Silicon (GPU-accelerated)
docker run -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-gpu-mac:latest
# From source
git clone https://github.com/remsky/Kokoro-FastAPI && cd Kokoro-FastAPI && ./start-cpu.shSobald es läuft, erkennt der MCP-Server es automatisch unter http://127.0.0.1:8880/v1. Überschreiben Sie dies mit der Umgebungsvariable KOKORO_BASE_URL.
Kokoro-Stimmen (primär):
Stimme | Akzent | Stil |
| US | Weiblich (Standard) |
| US | Weiblich |
| US | Weiblich |
| US | Weiblich |
| US | Männlich |
| US | Männlich |
| UK | Weiblich |
| UK | Weiblich |
| UK | Männlich |
| UK | Männlich |
OpenAI-Stimmen (Fallback):
Stimme | Stil |
| Neutral |
| Männlich |
| Narrativ |
| Tiefer männlich |
| Weiblich |
| Sanft weiblich |
Kokoro-Stimmennamen werden beim Fallback automatisch auf das nächste OpenAI- oder macOS-Äquivalent gemappt.
Rückgabe:
{
"file_path": "/tmp/tmpXXX.ogg",
"size_bytes": 16555,
"backend": "kokoro",
"voice": "af_sky",
"success": true,
"error": null
}Senden Sie den zurückgegebenen file_path als Telegram-Anhang, und er erscheint als native Sprachnachricht.
Transkriptions-Antwortformat
Alle Transkriptionstools geben Folgendes zurück:
{
"text": "Hello, this is a voice message.",
"language": "en",
"language_probability": 0.98,
"duration": 3.5,
"segments": [
{"start": 0.0, "end": 3.5, "text": "Hello, this is a voice message."}
],
"backend": "local",
"success": true,
"error": null
}Konfiguration
Die gesamte Konfiguration erfolgt über Umgebungsvariablen:
Variable | Standard | Beschreibung |
|
|
|
|
| Whisper-Modellgröße (siehe unten) |
| -- | Erforderlich für |
| -- | Erforderlich für |
| auto-detect | ISO-639-1 Sprachcode |
|
|
|
|
| Standardstimme für |
|
| Kokoro FastAPI Basis-URL |
Funktionsweise
MCP Client (Claude)
|
[MCP stdio]
|
whisper-telegram-mcp
/ | \
/ | \
transcribe_audio transcribe_ speak_text
telegram_voice |
| | auto_tts()
| [Bot API DL] / | \
+--------+------+ Kokoro OpenAI macOS
| (local) (cloud) (say)
auto_transcribe() |
/ \ .ogg file
LocalBackend OpenAIBackend
(faster-whisper) (Whisper API)Claude sendet einen Tool-Aufruf via MCP (stdio-Transport)
Bei Telegram-Sprachnachrichten wird die Datei über die Bot-API heruntergeladen
auto_transcribe()wählt das beste verfügbare Transkriptions-Backendauto_tts()wählt das beste verfügbare TTS-Backend (Kokoro -> OpenAI -> macOS)Ergebnisse werden als strukturiertes JSON zurückgegeben
Lokal vs. OpenAI
Lokal (faster-whisper) | OpenAI API | |
Kosten | Kostenlos | $0.006/Min |
Privatsphäre | Alle Daten bleiben auf dem Gerät | Audio wird an OpenAI gesendet |
Geschwindigkeit | ~1-10s je nach Modell | ~1-3s |
Einrichtung | Automatisch (lädt Modell bei erster Nutzung) | Erfordert |
Genauigkeit | Exzellent mit | Exzellent |
Offline | Ja | Nein |
Modellgrößen
Modell | Parameter | Geschwindigkeit | Genauigkeit | VRAM |
| 39M | Am schnellsten | Niedrigste | ~1GB |
| 74M | Schnell | Gut | ~1GB |
| 244M | Moderat | Besser | ~2GB |
| 769M | Langsam | Hoch | ~5GB |
| 1550M | Am langsamsten | Höchste | ~10GB |
| ~800M | Schnell | Hoch | ~6GB |
Englisch-only Varianten (tiny.en, base.en, small.en, medium.en) sind für Englisch etwas genauer.
Privatsphäre & Daten
Lokales Backend (faster-whisper): Audio bleibt auf Ihrem Gerät. Nichts verlässt Ihren Rechner.
OpenAI-Backend: Audio wird gemäß der Datenaufbewahrungsrichtlinie an die OpenAI-API gesendet
Temporäre Dateien: Von Telegram heruntergeladenes Audio wird nach
/tmpgeschrieben und sofort nach der Transkription gelöschtLogs: Gehen nur an stderr — keine Audioinhalte oder Anmeldedaten werden jemals protokolliert
Entwicklung
git clone https://github.com/abid-mahdi/whisper-telegram-mcp.git
cd whisper-telegram-mcp
python3.12 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
# Run unit tests
pytest tests/ -v -m "not integration"
# Run integration tests (downloads ~150MB model on first run)
pytest tests/ -m integration -v
# Run with coverage
pytest tests/ --cov=src/whisper_telegram_mcp --cov-report=term-missingMCP Inspector
uvx mcp dev src/whisper_telegram_mcp/server.pyMitwirken
Forken Sie das Repository
Erstellen Sie einen Feature-Branch (
git checkout -b feat/amazing-feature)Führen Sie Tests aus (
pytest tests/ -v -m "not integration")Committen Sie mit konventionellen Commits (
feat:,fix:,docs:etc.)Öffnen Sie einen Pull Request
Lizenz
Available Tools
5 toolscheck_backendsA
Check which transcription backends are available and configured.
Call this first to verify your setup before transcribing.
Inputs: no named parameters. Returns: object
list_modelsB
List available Whisper model sizes with performance characteristics.
Configure the active model via the WHISPER_MODEL environment variable. Default is 'base' -- a good balance of speed and accuracy for voice messages.
Inputs: no named parameters. Returns: object
speak_textA
Convert text to speech and return an OGG/Opus audio file path.
Plays as a native voice note in Telegram when sent as an attachment.
TTS backends (in priority order):
Kokoro (local, free, natural-sounding) -- auto-starts via
uvx kokoro-fastapiOpenAI TTS (cloud, requires OPENAI_API_KEY, ~$0.015/1k chars)
macOS say (Mac only fallback, sounds robotic)
Configure via TTS_BACKEND env var: "auto" | "kokoro" | "openai" | "macos"
Args: text: Text to synthesise. voice: Voice name. Kokoro voices: af_sky, af_bella, af_sarah, am_adam, am_michael, bf_emma, bm_george, bm_lewis. OpenAI voices: alloy, echo, fable, onyx, nova, shimmer. Configure default via TTS_VOICE env var. output_path: Optional absolute path for the output .ogg file.
Returns: dict with: file_path (absolute .ogg path), backend, voice, success, error
Inputs: text (required), voice, output_path. Returns: object
transcribe_audioA
Transcribe an audio file to text using Whisper.
Supports OGG (Telegram voice), WAV, MP3, FLAC, and most common audio formats.
Args: file_path: Absolute path to the audio file to transcribe. language: Optional ISO-639-1 language code (e.g. 'en', 'fr'). None = auto-detect. word_timestamps: If True, include word-level timestamps in segments.
Returns: dict with: text, language, language_probability, duration, segments, backend, success, error
Inputs: file_path (required), language, word_timestamps. Returns: object
transcribe_telegram_voiceA
Download and transcribe a Telegram voice message.
Downloads the voice message from Telegram, transcribes it, then deletes the temp file.
Args: file_id: The file_id from a Telegram voice message (from the Message object). bot_token: Telegram bot token. Falls back to TELEGRAM_BOT_TOKEN env var. language: Optional ISO-639-1 language code. None = auto-detect. word_timestamps: Include word-level timestamps in segments.
Returns: Same dict structure as transcribe_audio.
Inputs: file_id (required), bot_token, language, word_timestamps. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose with no overlap: check_backends verifies setup, list_models shows model options, speak_text converts text to speech, transcribe_audio processes local audio files, and transcribe_telegram_voice handles Telegram-specific downloads. The descriptions reinforce these distinct roles, making misselection unlikely.
Tools follow a consistent snake_case pattern throughout (e.g., check_backends, list_models, speak_text). However, there is a minor deviation in verb style: 'check' and 'list' are informational, while 'speak' and 'transcribe' are action-oriented, but this is reasonable given their distinct functions. The naming remains highly readable and predictable.
With 5 tools, the set is well-scoped for a server focused on Whisper transcription and Telegram integration. Each tool earns its place by covering essential aspects: setup verification, model configuration, text-to-speech, audio transcription, and Telegram-specific handling. This count avoids bloat while providing complete functionality.
The tool surface offers complete coverage for the domain of audio transcription and synthesis with Telegram integration. It includes setup checks (check_backends), configuration (list_models), core operations (speak_text, transcribe_audio), and platform-specific handling (transcribe_telegram_voice). There are no obvious gaps; agents can perform end-to-end workflows without dead ends.
Maintenance
Related MCP Connectors
MCP server for RiverScript, an AI transcription platform - fetches transcripts shared via a link.
An MCP server that gives any LLM or agent clean YouTube transcripts on demand: a single video, a whole channel, or a playlist, plus AI cleanup of auto-generated captions. API-key auth, credit-based, same backend as the public v1 API. Get a free API key with 25 free credits at youtubetranscriptdownload.com/account.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
MCP server for Speech-to-Text
Related MCP Servers
- AlicenseBqualityDmaintenanceA MCP server that enables transcription of audio files using OpenAI's Speech-to-Text API, with support for multiple languages and file saving options.110MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that downloads videos/extracts audio from various platforms like YouTube, Bilibili, and TikTok, then transcribes them to text using OpenAI's Whisper model.12MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables searching YouTube and retrieving high-accuracy video transcripts using local Whisper AI transcription without requiring an API key. It supports single or batch processing and provides transcripts in multiple formats including text, JSON, and SRT.3Apache 2.0
- AlicenseAqualityBmaintenanceMCP server for audio transcription using local faster-whisper or OpenAI Whisper API, enabling multilingual transcription with optional GPT post-processing.3363 PyPIMIT