MLX Whisper
STDIOApple芯片Mac上的MLX语音转写服务
Apple芯片Mac上的MLX语音转写服务
A simple Model Context Protocol (MCP) server that provides audio transcription capabilities using MLX Whisper on Apple Silicon Macs.
mlx-community/whisper-large-v3-turbo modeluv runuv installed (pip install uv or curl -sS https://astral.sh/uv/install.sh | bash)Run directly with uv run:
uv run mlx_whisper_mcp.py
That's it! The script will automatically install its own dependencies and start the MCP server. Note: The first time you run the script, it may take longer to start as it will download the Whisper model (approx. 1.6GB). Subsequent runs will be faster.
There are two main ways to integrate this server with Claude Desktop:
uv (Recommended)mlx_whisper_mcp.py.uv tool run fastmcp install mlx_whisper_mcp.py
fastmcp will have set up the necessary configuration to launch the server, including handling its dependencies via uv run.If you prefer to configure Claude Desktop manually:
Edit your Claude Desktop configuration file:
# On macOS: code ~/Library/Application\ Support/Claude/claude_desktop_config.json # On Windows: code %APPDATA%\Claude\claude_desktop_config.json
Add the MLX Whisper MCP server configuration.
Important: Replace /absolute/path/to/mlx_whisper_mcp/ in the cwd field below with the actual absolute path to the directory containing mlx_whisper_mcp.py on your system.
{ "mcpServers": { "mlx-whisper": { "command": "uv", "args": [ "run", "mlx_whisper_mcp.py" ], "cwd": "/absolute/path/to/mlx_whisper_mcp/" } } }
This configuration tells Claude Desktop to execute mlx_whisper_mcp.py using uv run, with the current working directory (cwd) set to the script's location. uv run will handle installing the dependencies defined for the script.
Restart Claude Desktop.
The server provides the following tools:
transcribe_fileTranscribes an audio file from a path on disk.
Parameters:
file_path: Path to the audio filelanguage: (Optional) Language code to force a specific languagetask: "transcribe" or "translate" (translates to English)transcribe_audioTranscribes audio from base64-encoded data.
Parameters:
audio_data: Base64-encoded audio datalanguage: (Optional) Language code to force a specific languagefile_format: Audio file format (wav, mp3, etc.)task: "transcribe" or "translate" (translates to English)download_youtubeDownloads a YouTube video.
Parameters:
url: YouTube video URLkeep_file: If True, keeps the downloaded file (default: True)transcribe_youtubeDownloads and transcribes a YouTube video.
Parameters:
url: YouTube video URLlanguage: (Optional) Language code to force a specific languagetask: "transcribe" or "translate" (translates to English)keep_file: If True, keeps the downloaded file (default: True)This server uses the MCP Python SDK to expose MLX Whisper's transcription capabilities to clients like Claude. When a transcription is requested:
~/.mlx-whisper-mcp/downloadsApache License 2.0 See LICENSE for details.