asr-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@asr-mcptranscribe this audio file"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
asr-mcp
基于本地 Whisper Large V3 (MLX) 模型的语音转文本 MCP 服务(stdio 传输)。转写全程本地运行,不联网、不上传音频。
功能
对外暴露两个 MCP 工具:
工具 | 说明 |
| 将音频转写为文本,支持三种输出: |
| 调用当前会话的 LLM 对转写结果纠错,支持 |
设计要点:
工具调用与重任务解耦:转写在独立子进程(
worker.py)中执行,server 以事件驱动方式等待并每 15 秒上报心跳进度,不轮询进程状态。超时语义诚实:默认超时 10 分钟;超时后不杀子进程,任务继续在后台跑完并自行落盘,工具如实返回「未完成」而非「出错」,并提示稍后检查输出文件。
中文标点修复:该模型转写中文时默认不输出任何标点,本服务按语言注入
initial_prompt引导生成规范标点。Sampling 优雅回退:纠错优先走 MCP Sampling;客户端不支持时(多数客户端的现状),工具返回一份现成的纠错提示词,由当前会话的 LLM 直接完成纠错。
Related MCP server: whisper-transcribe-mcp
环境要求
macOS + Apple Silicon(MLX 仅支持 Apple 芯片)
Python ≥ 3.12
uv 包管理器
本地模型目录(见下节)
安装
git clone https://github.com/fengredrum/asr-mcp.git
cd asr-mcp
uv sync本项目默认 PyPI 索引为阿里云镜像(见
pyproject.toml),海外网络可在[tool.uv]中删除或替换该配置。
准备模型
下载模型到本地任意目录,例如:
huggingface-cli download mlx-community/whisper-large-v3-mlx --local-dir ~/models/whisper-large-v3-mlx通过环境变量 ASR_MCP_MODEL_PATH 指定模型目录(也支持直接填 Hugging Face 仓库 ID,mlx_whisper 会自动下载):
export ASR_MCP_MODEL_PATH=~/models/whisper-large-v3-mlx接入 MCP 客户端
以 Claude Code 为例:
claude mcp add asr-mcp \
--env ASR_MCP_MODEL_PATH=$HOME/models/whisper-large-v3-mlx \
-- uv --directory /绝对路径/asr-mcp run server.py或在客户端的 MCP 配置中手动添加:
{
"mcpServers": {
"asr-mcp": {
"command": "uv",
"args": ["--directory", "/绝对路径/asr-mcp", "run", "server.py"],
"env": {
"ASR_MCP_MODEL_PATH": "/你的模型目录/whisper-large-v3-mlx"
}
}
}
}接入后直接让 LLM「转写这个音频文件」即可,它会调用 transcribe_audio 并在完成后询问是否需要纠错。
调试转写链路
可绕过 MCP 直接运行 worker:
.venv/bin/python worker.py <音频路径> <text|timestamps|srt> <输出文件> [语言]输出文件命名约定
类型 | 文件名 |
纯文本 |
|
时间轴 |
|
字幕 |
|
纠错结果(约定) |
|
输出默认与音频文件同目录,也可由调用方指定输出目录。
项目结构
server.py # MCP server:工具定义、子进程调度、心跳进度、Sampling 回退
worker.py # 一次性转写工作进程,stdout 最后一行 JSON 为状态协议
transcriber.py # mlx_whisper.transcribe 薄封装(含中文标点 workaround)
formatter.py # text / timestamps / srt 三种格式化输出许可证
Available Tools
2 toolscorrect_transcriptionA
调用当前会话的 LLM 对转写文本进行纠错。调用前应先询问用户是否需要纠错及使用哪种模式。
若当前 MCP 客户端支持 Sampling,则由服务端请求客户端 LLM 完成纠错; 若不支持(多数客户端的现状),则返回现成的纠错提示词, 当前会话的 LLM 应直接按提示词完成纠错并把结果返回给用户。
Args: transcription_text: 需要纠错的转写文本 correction_mode: 纠错模式。semantic=结合语义/专业术语/互联网资料纠错(默认),reference=对照标准文本纠错 reference_text: 标准参考文本(reference 模式必填,一般用于字幕制作场景)
| Name | Required | Description | Default |
|---|---|---|---|
| reference_text | No | ||
| correction_mode | No | semantic | |
| transcription_text | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden of disclosing behavior. It explains that the tool may either request the client LLM via Sampling or return a correction prompt for the session LLM to execute. This goes beyond the schema and reveals a non-obvious workflow, though it does not mention potential errors or side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is organized with a purpose statement, behavioral notes, and an Args section. It is slightly repetitive with phrases like '当前会话的 LLM' and '纠错', but no sentence is wasted. The structure makes it easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that no annotations are present and an output schema exists, the description covers the full decision flow: pre-call user confirmation, mode selection, Sampling support behavior, and reference_text requirements. This is sufficient for an agent to select and invoke the tool correctly, with no major gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must fully compensate. The Args section defines all three parameters: transcription_text, correction_mode with the exact mode strings and defaults, and reference_text with its requirement and use case. This is strong added value beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific action: invoking the current session's LLM to correct transcription text. It differentiates from the sibling tool transcribe_audio by focusing on correction rather than transcription. It also outlines the two correction modes, further clarifying the tool's purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly instructs to ask the user before calling and to determine which mode to use. It also explains the workflow for MCP clients that support Sampling versus those that do not. It does not explicitly state when not to use the tool, but the guidance is clear enough for most invocation decisions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
transcribe_audioA
将音频文件转写为文本。调用前若用户未明确指定,应先询问用户选择哪种转写类型。
转写在后台子进程中运行,完成后自动上报结果,不需要轮询进度。 默认超时 10 分钟;超时后会如实检查并告知是「尚未完成」(任务继续后台运行, 完成后结果自动写入输出文件)还是「转写出错」(附带错误信息)。
Args: audio_path: 音频文件的绝对路径(支持 m4a/mp3/wav/flac 等常见格式) task_type: 转写类型。text=纯文本含标点(默认),timestamps=带时间轴,srt=SRT 字幕 output_dir: 输出目录,默认与音频文件同目录 language: 语言提示,如 zh、en。不指定则自动检测 timeout: 超时时间(秒),默认 600(10 分钟)
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No | ||
| language | No | ||
| task_type | No | text | |
| audio_path | Yes | ||
| output_dir | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description fully carries the transparency burden. It clearly discloses background subprocess execution, automatic result reporting, absence of polling, default timeout of 10 minutes, and the specific timeout handling (checking whether the task is still running or errored). This is rich behavioral context beyond the schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured: a clear purpose line, a usage note, a behavioral note, and a neatly formatted Args list. Every sentence adds value, and the length is appropriate for the tool's complexity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 5 parameters, no annotations, and an output schema, the description covers all necessary aspects: purpose, preconditions (ask user), execution model, timeout behavior, and parameter semantics. The existence of an output schema means return values need not be detailed here.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the Args section thoroughly explains every parameter: audio_path (absolute path, supported formats), task_type (possible values and meanings), output_dir (default behavior), language (hint, auto-detect), and timeout (default in seconds). This fully compensates for the lack of schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with '将音频文件转写为文本' (transcribe audio files to text), clearly specifying the verb and resource. It also outlines the different output types (text, timestamps, srt), making the tool's purpose unambiguous and distinct from the sibling correct_transcription.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear guidance: ask the user for the transcription type if not specified, and notes that transcription runs in the background without polling. However, it does not explicitly mention alternatives or when not to use this tool, e.g., versus correct_transcription, so it falls short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.1.0- First observed
correct_transcription - First observed
transcribe_audio
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one transcribes audio to text, the other corrects existing transcription text. There is no overlap or ambiguity between them.
Both tool names follow a consistent verb_noun snake_case pattern: transcribe_audio and correct_transcription. This makes the naming predictable and easy to infer.
With only 2 tools, the server feels thin for a typical MCP surface, but the scope is narrow and focused on transcription plus correction. It sits at the borderline of being too minimal.
The core ASR workflow is covered: transcription with multiple output formats and language support, plus a correction step. Minor gaps exist like no explicit job status query, but the background processing design mitigates this.
Maintenance
Related MCP Connectors
MCP server for Speech-to-Text
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 structured access to Lenny Rachitsky podcast transcripts. For content creators.
MCP server for RiverScript, an AI transcription platform - fetches transcripts shared via a link.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMinimal MCP server for local speech recognition using faster-whisper. Runs on CPU, no cloud required.MIT
- AlicenseAqualityAmaintenanceMCP server for audio transcription using local faster-whisper or OpenAI Whisper API, enabling multilingual transcription with optional GPT post-processing.3MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for audio/video transcription using MLX-optimized Whisper models, offering fast performance on Apple Silicon with support for multiple output formats and batch processing.1MIT
- AlicenseAqualityCmaintenanceLocal, private audio transcription MCP server enabling AI agents to transcribe audio files entirely on-device without uploading data.3MIT