asr-mcp: Instructions file for Claude Code

CLAUDE.md

asr-mcp CLAUDE.md is an instructions file for Claude Code from fengredrum/asr-mcp. It costs 936 tokens per session, scanned A, original, MIT.

A set of Claude Code instructions for a local speech-to-text server. The server uses Whisper to transcribe audio and can correct the resulting text with a language model.

In plain words
What is it for?
Use it when developing or debugging the asr-mcp project, running its server or transcription worker, and checking audio transcription with sample files.
Why use it?
It gives the coding agent the project overview, commands, architecture, and testing method needed to work on the repository correctly.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is fengredrum/asr-mcp's own configuration. It tells Claude Code how to work on asr-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything asr-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to fengredrum/asr-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/fengredrum/asr-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/fengredrum/asr-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for asr-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/fengredrum/asr-mcp/claude-md.svg)](https://agentmods.dev/instructions/fengredrum/asr-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/fengredrum/asr-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/fengredrum/asr-mcp/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 936 This file is loaded in full into every session.
When invoked 936 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00936 $0.00936
Opus 5 $0.00468 $0.00468
Sonnet 5 $0.00187 $0.00187
Haiku 4.5 $0.00094 $0.00094

Measured 7d ago against content hash 1c1146051df3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

asr-mcp CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 37 lines

What it actually says

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

项目简介

ASR MCP 服务(asr-mcp):基于本地 Whisper Large V3 MLX 模型的语音转文本 MCP server(stdio 传输),对外暴露两个工具:transcribe_audio(转写)与 correct_transcription(LLM 纠错)。

常用命令

包管理使用 uv(默认索引为阿里云镜像,见 pyproject.toml),虚拟环境 .venv(Python 3.12)。

  • 安装依赖:uv sync
  • 运行 MCP server:uv run server.py
  • 直接运行转写 worker(绕过 MCP 调试转写链路):.venv/bin/python worker.py <音频路径> <text|timestamps|srt> <输出文件> [语言]
  • 无自动化测试框架:用 test_samples/ 做端到端验证——Docker_Sandboxes_Claude_Code.m4a 是测试音频,同名 .md 是参考文稿(可用于 reference 模式纠错的对照文本)。

架构

四个文件构成一条流水线,核心设计是把「MCP 工具调用」与「重转写任务」解耦到不同进程:

  • server.py:MCP server 本体。transcribe_audioasyncio.create_subprocess_exec 把转写交给 worker.py 子进程,再以 asyncio.wait_for(proc.wait(), HEARTBEAT_SECONDS)事件驱动等待(不轮询进程状态),期间经 ctx.report_progress 心跳上报进度。默认超时 600 秒;超时后不杀子进程——worker 继续在后台跑完并自行落盘,工具如实返回「未完成」而非「出错」,提示调用方稍后检查输出文件。
  • worker.py:一次性工作进程。转写、写文件完成后,向 stdout 打印一行 JSON 作为状态协议:成功 {"status": "ok", "output", "chars", "preview"};失败 {"status": "error", "error"} 且退出码 1。server.py 只解析 stdout 的最后一行——改动此协议时两端必须同步。
  • transcriber.pymlx_whisper.transcribe 的薄封装。模型路径取环境变量 ASR_MCP_MODEL_PATH,未设置时回退到 DEFAULT_MODEL_PATH(作者本地路径,仅为兼容旧用法)。关键 workaround:该模型转写中文时默认不输出任何标点,必须按语言注入 initial_prompt 引导加标点(zh / other 各一条,见 _INITIAL_PROMPTS)。
  • formatter.py:三种输出格式(text / timestamps / srt)。_normalize_punct 只在标点紧邻 CJK 字符时把半角转全角,避免影响纯英文内容——修改标点逻辑时保留这个约束。

输出文件命名约定:{音频名}.txt{音频名}_timestamps.txt{音频名}.srt;纠错结果约定保存为 {音频名}_corrected.txt

correct_transcription 的 Sampling 回退

纠错优先走 MCP Sampling——仅当客户端 capabilities 声明了 sampling 时才调用 ctx.session.create_message;多数客户端不支持,此时工具返回一份现成的纠错提示词(semantic / reference 两种模式各一套),由当前会话的 LLM 自己按提示词完成纠错。修改该工具时两条路径都要兼顾。

开发要求(来自 开发需求.md)

  • 转写必须后台运行、完成后自动上报,不得轮询进度;默认超时 10 分钟,超时后需区分「未完成」与「转写出错」两种结论。
  • 所有 Python 包用 uv 管理、在 .venv 中运行、走阿里云镜像源。
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 37 lines · 936 tokens per session scan A 1c1146051df3

Subscribe to this mod's changes

asr-mcp CLAUDE.md is an instructions file published in the GitHub repository fengredrum/asr-mcp (0 stars, last pushed 1mo ago), licensed MIT. It adds 936 tokens to every session, about $0.0047 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens