Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/redgreat/git_mcp_server/agents-mdgit clone --depth 1 https://github.com/redgreat/git_mcp_serverWhat 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 | $0.01253 | $0.01253 |
| Opus 5 | $0.00626 | $0.00626 |
| Sonnet 5 | $0.00251 | $0.00251 |
| Haiku 4.5 | $0.00125 | $0.00125 |
Grade A, and why
git_mcp_server 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 yesterday.
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 — 76 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — AI 辅助开发规则
本文件为 AI 编码助手(Claude Code / Codex / Cursor / Copilot 等)提供在本仓库中工作的行为准则。详细版见 docs/ai-coding-rules.md。
项目概览
Git MCP Server:基于 MCP (Model Context Protocol) 的 Git 仓库管理服务。
- 后端:Python 3.11 + FastAPI + SQLAlchemy(原生 Table/MetaData 风格,无 ORM Model 类)+ JWT + bcrypt
- 前端:Svelte 5(runes 语法)+ Tailwind CSS v4 + daisyUI 5 + Vite(adapter-static,SPA)
- 数据库:PostgreSQL 16
- 部署:Docker Compose
常用命令
make test # 运行全部后端测试(test/run_all.py)
make build # 构建前端(cd frontend && npm install && npm run build)
make dev # 构建前端并启动后端服务
make setup # 初始化(复制 config.yml + 安装依赖)
make docker-up # Docker 生产环境启动
后端启动:python -m src.server;前端开发服务器:cd frontend && npm run dev(端口 5174)。
目录结构
config/ # 配置文件(config.yml / config.yml.example)
docker/ # Docker 相关(含 docker-compose-local.yml)
frontend/src/ # Svelte 5 管理后台
routes/ # 页面路由(+layout.svelte 为鉴权布局,login/ 为独立登录页)
script/ # 工具脚本(dockerrebuid.ps1、start.sh)
src/
admin/ # 管理后台 API(web.py 路由、auth.py 认证、models.py 建表)
ai/ # 大模型集成(LLM 分析/审查)
gitops/ # Git 操作封装(repo_manager、git_operations)
mcp/ # MCP 协议处理(tools.py、permissions.py、server.py)
security/ # 安全(secret.py 加密、ip_whitelist.py、client_ip.py)
services/ # 外部服务
server.py # FastAPI 入口(挂载 /admin 静态资源与 API 路由)
config.py # 配置加载(pydantic + yaml)
test/ # 后端测试(run_all.py 汇总)
关键架构约定
- 路由挂载:
/api/*为后端 API(src/admin/web.py的build_admin_router);/admin/*为前端 SPA(server.py 中 StaticFiles + 回退 index.html)。前端构建产物输出到src/static/。 - 认证:
Authorizationheader 直接传 JWT 裸 token(无Bearer前缀),后端verify_token解析。token 存 localStorage。 - 鉴权布局:
frontend/src/routes/+layout.svelte检查 token。登录页/admin/login必须跳过布局拦截(通过$page.url.pathname判断isLoginPage),否则登录表单永远无法显示。 - 凭据加密:Git 密码/Token、LLM API Key 用
src/security/secret.py的encrypt_text/decrypt_text(master_key 派生加密)存储,禁止明文入库。 - 权限模型:Access Key → 仓库 → 分支正则 + 路径正则三级权限,见
src/mcp/permissions.py。 - 数据库:
src/admin/models.py的ensure_schema()启动时建表;操作使用 SQLAlchemyTable+insert/select/update/delete表达式,不用 ORM Model 类。
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.
- yesterday First seen · 76 lines · 1,253 tokens per session scan A 1bfcc8d9fd25
git_mcp_server AGENTS.md is an instructions file published in the GitHub repository redgreat/git_mcp_server (0 stars, last pushed 4d ago), licensed MIT. It adds 1,253 tokens to every session, about $0.0063 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
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.
buildNext
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).
next.js AGENTS.md
Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
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).
spec-kit 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
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.