Borrowing it
Nothing to install: this file belongs to damoqiongqiu/mcp-local-translate. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/damoqiongqiu/mcp-local-translate/main/AGENTS.mdgit clone --depth 1 https://github.com/damoqiongqiu/mcp-local-translateWrote 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.
[](https://agentmods.dev/instructions/damoqiongqiu/mcp-local-translate/agents-md)<a href="https://agentmods.dev/instructions/damoqiongqiu/mcp-local-translate/agents-md"><img src="https://agentmods.dev/badge/instructions/damoqiongqiu/mcp-local-translate/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/damoqiongqiu/mcp-local-translate/agents-md"><img src="https://agentmods.dev/badge/instructions/damoqiongqiu/mcp-local-translate/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01710 | $0.01710 |
| Opus 5 | $0.00855 | $0.00855 |
| Sonnet 5 | $0.00342 | $0.00342 |
| Haiku 4.5 | $0.00171 | $0.00171 |
Grade A, and why
mcp-local-translate AGENTS.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 10d 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.
How it starts
The opening of the file, as written. The whole thing — 156 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
为 mcp-local-translate 项目工作的 AI 编码 Agent 使用指南。
项目概述
mcp-local-translate 是一个本地翻译 MCP 服务器和 CLI 工具 — 基于 Meta NLLB-200 蒸馏模型,支持 200+ 语言互译,完全私有,零配置。通过 Transformers.js 在本地 CPU 上推理(第一次调用时懒加载模型),提供 translate 和 list_languages 两个 MCP 工具及对应的 CLI 子命令。
- 包名:npm 上的
@damoqiongqiu/mcp-local-translate - 许可证:MIT
- Node 版本:>= 22
- 包管理器:pnpm(锁文件:
pnpm-lock.yaml) - 语言:TypeScript 6.0,严格模式,ES Modules(
"type": "module") - 模块系统:Node16(
"module": "node16"),相对导入须带.js扩展名
常用命令
pnpm install # 安装依赖
pnpm run build # TypeScript 编译 → dist/
pnpm run dev # 通过 tsx 运行(无需构建)
pnpm run test # 运行全部测试
pnpm run type-check # tsc --noEmit
pnpm run check:fix # 自动修复 lint 和格式化问题
项目结构
src/
index.ts # 入口 — 路由到 CLI 或 MCP 服务器
server-main.ts # MCP 服务器启动
server/
index.ts # MCP 工具处理器(translate、list_languages)
types.ts # MCP 工具定义
translator/
index.ts # 核心翻译引擎(NLLB-200 管道、文本分块、懒加载、代理配置)
connectivity.ts # 镜像检测与代理配置(三级回退:HF → hf-mirror → ModelScope)
language-codes.ts # FLORES-200 语言代码映射 + 多级解析器(精确码 → ISO 639-1 → 中文别名)
utils/ # 共享工具
skills/ # 随包发布的 Agent Skills
代码规范
格式化(Biome)
- 缩进:2 空格
- 引号:单引号(
') - 分号:无(
"semicolons": "asNeeded") - 尾逗号:ES5(
"trailingCommas": "es5") - 行宽:100
- 自动修复:
pnpm run check:fix
Lint 规则
- Biome 推荐规则
TypeScript 严格模式
全部严格检查均已开启:
strict: true、noImplicitAny、strictNullChecks、strictFunctionTypes、noUncheckedIndexedAccess、exactOptionalPropertyTypes、noPropertyAccessFromIndexSignature、noImplicitReturns、noUnusedLocals、noUnusedParameters
导入规范
- 相对导入必须带
.js扩展名("module": "node16"要求) - 从具体模块路径导入,不要使用 barrel re-export
关键设计决策
双接口设计(MCP + CLI)
同一套核心逻辑同时服务于 MCP 工具和 CLI 子命令。入口点(src/index.ts)按第一个参数路由:如果匹配已知子命令 → CLI 路径;如果没有参数 → MCP 服务器。CLI 支持相同的环境变量和等价的命令行标志。
翻译管道(Translation Pipeline)
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.
- 10d ago First seen · 156 lines · 1,710 tokens per session scan A c002ed8603f2
mcp-local-translate AGENTS.md is an instructions file published in the GitHub repository damoqiongqiu/mcp-local-translate (0 stars, last pushed 2mo ago), licensed MIT. It adds 1,710 tokens to every session, about $0.0086 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.
Other instructions, from other repositories
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.
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.
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).
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.
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.
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).