local-repo-mcp: Instructions file for Codex

AGENTS.md

local-repo-mcp AGENTS.md is an instructions file for Codex, OpenCode from cloud-Xolt/local-repo-mcp. It costs 734 tokens per session, scanned A, original, MIT.

A small MCP server for controlled work in one local Git repository. It supports reading, writing through patches, and approved test or build commands, with optional local commits.

In plain words
What is it for?
Use it to list files, read and search code, inspect Git status and diffs, apply relative-path patches, and run allowlisted tests, builds, lint checks, or other verification commands.
Why use it?
It limits the agent to a fixed, reviewable tool set instead of giving it general remote-shell or agent-orchestration access, while protecting paths, secrets, and Git operations.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

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

Reuse

Borrowing it

Nothing to install: this file belongs to cloud-Xolt/local-repo-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/cloud-Xolt/local-repo-mcp/master/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/cloud-Xolt/local-repo-mcp

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/cloud-xolt/local-repo-mcp/agents-md.svg)](https://agentmods.dev/instructions/cloud-xolt/local-repo-mcp/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/cloud-xolt/local-repo-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/cloud-xolt/local-repo-mcp/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 734 This file is loaded in full into every session.
When invoked 734 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.00734 $0.00734
Opus 5 $0.00367 $0.00367
Sonnet 5 $0.00147 $0.00147
Haiku 4.5 $0.00073 $0.00073

Measured 8d ago against content hash 16fceb930820, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

local-repo-mcp 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 8d 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 · 67 lines

What it actually says

Local Repo MCP — AI 开发约束

本项目是轻量、单一用途的本地 Git 仓库 MCP Server,不是企业 Agent Runtime。

第一约束:工具定位

本项目只提供单仓库的受控远程开发、测试/构建执行和结果回传能力。设计必须保持轻量、固定工具面、受控执行和结果可核验;禁止演进为 Agent、任务编排平台或通用远程 Shell。

产品边界

  • 只服务一个配置的本地 Git 仓库
  • 默认 MCP_MODE=read
  • 仅支持 read / write / test 三档模式
  • 写入主要通过 repo_apply_patch(统一文本 Patch)
  • 可选 repo_git_commit(默认关闭;GUI/ALLOW_GIT_COMMIT 显式开启后,write/test 可创建本地 commit)
  • 可选 repo_run_test(仅 test 模式,白名单 test/build/lint/check;兼容单命令与有界顺序批量)
  • 可选 OpenAI Secure MCP Tunnel(用户自行安装 tunnel-client)

禁止新增

  • Session / RBAC / Risk Scorer / Policy YAML
  • 自动分支 checkout / push / amend / reset / rebase
  • 三阶段 Patch 审批
  • Docker Sandbox / 任意 Shell
  • Tunnel 自动下载
  • API Key 落盘

每次修改必须

  1. 路径使用 relative_to(),拒绝绝对路径、..、symlink
  2. 敏感路径使用 src/security/guard.py denylist
  3. Git status/diff 过滤敏感路径
  4. 搜索使用 rg --fixed-strings -e query --
  5. 同步更新 tests/ 与 README
  6. 保持 MCP Tool 数量为 8 个,不随意新增
  7. 所有 MCP Tool 必须发布稳定的 inputSchemaoutputSchema;可选参数通过 default/required 表达,避免不必要的 nullable union
  8. 协议契约统一定义在 src/tools/contracts.py,并由真实 tools/list 回归测试验证,禁止为单个客户端写 Tool 特判

MCP Tools(仅这 8 个)

repo_list_files
repo_read_file
repo_search_code
repo_git_status
repo_git_diff
repo_apply_patch
repo_git_commit
repo_run_test

核心模块

src/security/guard.py    — 路径 denylist
src/security/scanner.py  — Patch 新增行凭证 regex
src/repo/filesystem.py   — 读取与列表
src/repo/git.py          — 过滤后的 Git 操作
src/tools/contracts.py   — 统一 MCP Tool 协议契约与 tools/list schema 自检
src/tools/patches.py     — 原子统一 Patch 适配层(支持一次修改多个文件)
src/commands/models.py   — CommandSpec / CommandResult / BatchResult
src/commands/registry.py — 固定白名单命令注册
src/commands/runner.py   — 统一受控命令执行核心
src/tools/test_runner.py — 旧 Python 入口兼容层,不承载生产执行逻辑
launch_mcp.py            — Tunnel 固定 launcher
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. 8d ago First seen · 67 lines · 734 tokens per session scan A 16fceb930820

Subscribe to this mod's changes

local-repo-mcp AGENTS.md is an instructions file published in the GitHub repository cloud-Xolt/local-repo-mcp (5 stars, last pushed 14d ago), licensed MIT. It adds 734 tokens to every session, about $0.0037 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

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

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

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