mcp-local-translate: Instructions file for Codex

AGENTS.md

mcp-local-translate AGENTS.md is an instructions file for Codex, OpenCode from damoqiongqiu/mcp-local-translate. It costs 1,710 tokens per session, scanned A, original, MIT.

Project instructions for coding agents working on the local translation server and command-line tool. They describe the project structure, development commands, supported tools, and coding rules.

In plain words
What is it for?
Using the translation server's two MCP tools, running its build and test commands, checking types, and following its TypeScript and module conventions.
Why use it?
They give an agent the project context needed to make consistent changes without guessing how the code is organised or tested.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

This is damoqiongqiu/mcp-local-translate's own configuration. It tells Codex and OpenCode how to work on mcp-local-translate 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 mcp-local-translate configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/damoqiongqiu/mcp-local-translate/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/damoqiongqiu/mcp-local-translate

Made for: Codex, OpenCode.

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 mcp-local-translate AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/damoqiongqiu/mcp-local-translate/agents-md/github.svg)](https://agentmods.dev/instructions/damoqiongqiu/mcp-local-translate/agents-md)
Your own site
<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.

agentmods 80×15 button for mcp-local-translate AGENTS.md

Your own site · 80×15
<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>
Per session 1,710 This file is loaded in full into every session.
When invoked 1,710 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.01710 $0.01710
Opus 5 $0.00855 $0.00855
Sonnet 5 $0.00342 $0.00342
Haiku 4.5 $0.00171 $0.00171

Measured 10d ago against content hash c002ed8603f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

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.

AGENTS.md · 156 lines

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 上推理(第一次调用时懒加载模型),提供 translatelist_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: truenoImplicitAnystrictNullChecksstrictFunctionTypesnoUncheckedIndexedAccessexactOptionalPropertyTypesnoPropertyAccessFromIndexSignaturenoImplicitReturnsnoUnusedLocalsnoUnusedParameters

导入规范

  • 相对导入必须带 .js 扩展名("module": "node16" 要求)
  • 从具体模块路径导入,不要使用 barrel re-export

关键设计决策

双接口设计(MCP + CLI)

同一套核心逻辑同时服务于 MCP 工具和 CLI 子命令。入口点(src/index.ts)按第一个参数路由:如果匹配已知子命令 → CLI 路径;如果没有参数 → MCP 服务器。CLI 支持相同的环境变量和等价的命令行标志。

翻译管道(Translation Pipeline)

Read the full file on GitHub · 156 lines

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. 10d ago First seen · 156 lines · 1,710 tokens per session scan A c002ed8603f2

Subscribe to this mod's changes

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.

Related

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.

vercel/next.js · 7,296 tokens

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,153 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

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

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