Borrowing it
Nothing to install: this file belongs to redgreat/git_mcp_server. 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/redgreat/git_mcp_server/main/AGENTS.mdgit clone --depth 1 https://github.com/redgreat/git_mcp_serverWrote 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/redgreat/git_mcp_server/agents-md)<a href="https://agentmods.dev/instructions/redgreat/git_mcp_server/agents-md"><img src="https://agentmods.dev/badge/instructions/redgreat/git_mcp_server/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/redgreat/git_mcp_server/agents-md"><img src="https://agentmods.dev/badge/instructions/redgreat/git_mcp_server/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.01253 | $0.01253 |
| Opus 5.5 | $0.00501 | $0.00501 |
| Sonnet 5.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 2mo 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 — 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.
- 2mo ago 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 yesterday), licensed MIT. It adds 1,253 tokens to every session, about $0.0050 per session on Opus 5.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.
git_mcp_server AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| git_mcp_server AGENTS.mdredgreat/git_mcp_server | Instructions file | 0 | yesterday | MIT | A | 1,253 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |