git_mcp_server AGENTS.md

Repository instructions for an AI coding assistant working on a Git management server. The project includes a Python web backend, a Svelte administration interface, and a PostgreSQL database.

In plain words
What is it for?
Use it when developing the Git repository management service, its login and administration features, frontend pages, database code, Docker setup, or Git operations.
Why use it?
It records the project's technologies, directory structure, setup commands, and development rules so changes are made in the right part of the system.

Instructions file for CodexOpenCode

Install

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.

agentmods
npx agentmods add instructions/redgreat/git_mcp_server/agents-md
Clone the repo
git clone --depth 1 https://github.com/redgreat/git_mcp_server

Made for: Codex, OpenCode.

Per session 1,253 This file is loaded in full into every session.
When invoked 1,253 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.01253 $0.01253
Opus 5 $0.00626 $0.00626
Sonnet 5 $0.00251 $0.00251
Haiku 4.5 $0.00125 $0.00125

Measured yesterday against content hash 1bfcc8d9fd25, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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.

AGENTS.md · 76 lines

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 汇总)

关键架构约定

  1. 路由挂载/api/* 为后端 API(src/admin/web.pybuild_admin_router);/admin/* 为前端 SPA(server.py 中 StaticFiles + 回退 index.html)。前端构建产物输出到 src/static/
  2. 认证Authorization header 直接传 JWT 裸 token(无 Bearer 前缀),后端 verify_token 解析。token 存 localStorage。
  3. 鉴权布局frontend/src/routes/+layout.svelte 检查 token。登录页 /admin/login 必须跳过布局拦截(通过 $page.url.pathname 判断 isLoginPage),否则登录表单永远无法显示。
  4. 凭据加密:Git 密码/Token、LLM API Key 用 src/security/secret.pyencrypt_text/decrypt_text(master_key 派生加密)存储,禁止明文入库。
  5. 权限模型:Access Key → 仓库 → 分支正则 + 路径正则三级权限,见 src/mcp/permissions.py
  6. 数据库src/admin/models.pyensure_schema() 启动时建表;操作使用 SQLAlchemy Table + insert/select/update/delete 表达式,不用 ORM Model 类。

Read the full file on GitHub · 76 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. yesterday First seen · 76 lines · 1,253 tokens per session scan A 1bfcc8d9fd25

Subscribe to this mod's changes

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.

Related

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.

openai/codex · 5,182 tokens

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).

microsoft/vscode · 6,785 tokens

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.

vercel/next.js · 7,296 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

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.

github/spec-kit · 7,040 tokens

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.

langchain-ai/langchain · 4,345 tokens