Labsco
arcaputo3 logo

MCP Server Whisper

β˜… 56

from arcaputo3

Advanced audio transcription and processing using OpenAI's Whisper and GPT-4o models.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredAdvanced setup

MCP Server Whisper

<div align="center">

A Model Context Protocol (MCP) server for advanced audio transcription and processing using OpenAI's Whisper and GPT-4o models.

PyPI version License: MIT Python 3.10+ CI Status Built with uv

</div>

[!WARNING] This project has moved. Active development has migrated to TJC-LP/sanzaru. This repository is no longer maintained and will be archived. Please update your dependencies and issues to the new repo.

Overview

MCP Server Whisper provides a standardized way to process audio files through OpenAI's latest transcription and speech services. By implementing the Model Context Protocol, it enables AI assistants like Claude to seamlessly interact with audio processing capabilities.

Key features:

  • πŸ” Advanced file searching with regex patterns, file metadata filtering, and sorting capabilities
  • ⚑ MCP-native parallel processing - call multiple tools simultaneously
  • πŸ”„ Format conversion between supported audio types
  • πŸ“¦ Automatic compression for oversized files
  • 🎯 Multi-model transcription with support for all OpenAI audio models
  • πŸ—£οΈ Interactive audio chat with GPT-4o audio models
  • ✏️ Enhanced transcription with specialized prompts and timestamp support
  • πŸŽ™οΈ Text-to-speech generation with customizable voices, instructions, and speed
  • πŸ“Š Comprehensive metadata including duration, file size, and format support
  • πŸš€ High-performance caching for repeated operations
  • πŸ”’ Type-safe responses with Pydantic models for all tool outputs

Note: This project is unofficial and not affiliated with, endorsed by, or sponsored by OpenAI. It provides a Model Context Protocol interface to OpenAI's publicly available APIs.

Supported Audio Formats

ModelSupported Formats
Transcribeflac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm
Chatmp3, wav

Note: Files larger than 25MB are automatically compressed to meet API limits.

Development

This project uses modern Python development tools including uv, pytest, ruff, and mypy.

Copy & paste β€” that's it
# Run tests
uv run pytest

# Run with coverage
uv run pytest --cov=src

# Format code
uv run ruff format src

# Lint code
uv run ruff check src

# Run type checking (strict mode)
uv run mypy --strict src

# Run the pre-commit hooks
pre-commit run --all-files

CI/CD Workflow

The project uses GitHub Actions for CI/CD:

  1. Lint & Type Check: Ensures code quality with ruff and strict mypy type checking
  2. Tests: Runs tests on multiple Python versions (3.10, 3.11, 3.12, 3.13, 3.14, 3.14t)
  3. Release & Publish: Dual-trigger workflow for flexible release management

Note: Python 3.14t is the free-threaded build (without GIL) for testing true parallelism.

Creating a New Release

The release workflow supports two approaches:

Option 1: Automated Release (Recommended)

Push a tag to automatically create a release and publish to PyPI:

Copy & paste β€” that's it
# 1. Update version in pyproject.toml
# Edit the version field manually, e.g., "1.0.0" -> "1.1.0"

# 2. Update __version__ in src/mcp_server_whisper/__init__.py to match

# 3. Update the lock file
uv lock

# 4. Commit the version bump
git add pyproject.toml src/mcp_server_whisper/__init__.py uv.lock
git commit -m "chore: bump version to 1.1.0"

# 5. Create and push the version tag
git tag v1.1.0
git push origin main
git push origin v1.1.0

This will:

  • Verify the tag version matches pyproject.toml
  • Build the package
  • Create a GitHub release with auto-generated notes
  • Automatically publish to PyPI

Option 2: Manual Release

Create a release manually via GitHub UI, then publish optionally:

  1. Go to Releases on GitHub
  2. Click "Draft a new release"
  3. Create a new tag or select an existing one
  4. Fill in release details
  5. Click "Publish release"

When you publish the release, the workflow will automatically publish to PyPI. You can also create a draft release to delay publishing.

API Design Philosophy

MCP Server Whisper follows a flat, type-safe API design optimized for MCP clients:

  • Flat Arguments: All tools accept flat parameters instead of nested objects for simpler, more intuitive calls
  • Type-Safe Responses: Every tool returns a strongly-typed Pydantic model (TranscriptionResult, ChatResult, AudioProcessingResult, TTSResult)
  • Single-Item Operations: One call processes one file, with MCP protocol handling parallelism natively
  • Per-File Error Handling: Failures are isolated to individual operations, not entire batches
  • Self-Documenting: Type hints provide autocomplete and validation in IDEs and AI models

This design makes it significantly easier for AI assistants to use the tools correctly and handle results reliably.

How It Works

For detailed architecture information, see Architecture Documentation.

MCP Server Whisper is built on the Model Context Protocol, which standardizes how AI models interact with external tools and data sources. The server:

  1. Exposes Audio Processing Capabilities: Through standardized MCP tool interfaces with flat, type-safe APIs
  2. Implements Parallel Processing: Using anyio structured concurrency; MCP clients handle parallelism natively
  3. Manages File Operations: Handles detection, validation, conversion, and compression
  4. Provides Rich Transcription: Via different OpenAI models and enhancement templates
  5. Optimizes Performance: With caching mechanisms for repeated operations
  6. Ensures Type Safety: All responses use Pydantic models for validation and IDE support

Under the hood, it uses:

  • pydub for audio file manipulation (with audioop-lts for Python 3.13+)
  • anyio for structured concurrency and task group management
  • aioresult for collecting results from parallel task groups
  • OpenAI's latest transcription models (including gpt-4o-transcribe)
  • OpenAI's GPT-4o audio models for enhanced understanding
  • OpenAI's gpt-4o-mini-tts for high-quality speech synthesis
  • FastMCP for simplified MCP server implementation
  • Type hints and strict mypy validation throughout the codebase

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a new branch for your feature (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run the tests and linting (uv run pytest && uv run ruff check src && uv run mypy --strict src)
  5. Commit your changes (git commit -m 'Add some amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments


<div align="center"> Made with ❀️ by <a href="https://github.com/arcaputo3">Richie Caputo</a> </div>