git-mcp-server copilot-instructions.md

Repository-specific instructions for an MCP server that automates conventional Git commits. MCP is a standard way for AI agents to call tools provided by a server.

In plain words
What is it for?
Working on commit generation, Git operations, changelog updates, OpenAI-compatible API settings, and server entry points.
Why use it?
They help agents find the server’s main components and preserve its rules for change tracking, commit messages, changelogs, and pushing code.

Instructions file for GitHub Copilot

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/surajfale/git-mcp-server/copilot-instructions
Clone the repo
git clone --depth 1 https://github.com/surajfale/git-mcp-server

Made for: GitHub Copilot.

Per session 1,125 This file is loaded in full into every session.
When invoked 1,125 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.01125 $0.01125
Opus 5 $0.00562 $0.00562
Sonnet 5 $0.00225 $0.00225
Haiku 4.5 $0.00112 $0.00112

Measured yesterday against content hash 4cb6bf784997, 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 copilot-instructions.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.

.github/copilot-instructions.md · 64 lines

How it starts

The opening of the file, as written. The whole thing — 64 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Copilot / AI agent instructions — git-commit-mcp-server

Overview

  • This project is an MCP server that automates conventional Git commits. The runtime entry points live in src/git_commit_mcp/server.py and src/git_commit_mcp/__main__.py.
  • High-level components:
    • server.py: MCP tool definitions and orchestration (uses FastMCP). Key functions: git_commit_and_push and generate_commit_message.
    • change_tracker.py: Detects added/modified/deleted/renamed files with GitPython.
    • message_generator.py: Heuristics-based Conventional Commit generator (types, scope, bullets). Look at TYPE_PATTERNS and COMMIT_TYPE_PRIORITY for rules.
    • ai_client.py: Thin OpenAI wrapper; reads OPENAI_API_KEY from the environment and supports ai_base_url for OpenAI-compatible endpoints.
    • git_operations.py: Stages, commits, and pushes using GitPython; follow its error handling for expected failure modes.
    • changelog_manager.py: Writes a CHANGELOG.md entry before the commit (placeholder hash) then replaces it after commit (amend flow).

Important conventions & behaviors (do not change without updating callers)

  • Configuration is read from environment variables via ServerConfig.from_env() (see src/git_commit_mcp/config.py). Examples: ENABLE_AI, OPENAI_API_KEY, AI_PROVIDER, AI_MODEL, WORKSPACE_DIR, FORCE_SSH_ONLY.
  • AI usage:
    • If ENABLE_AI=true the code will instantiate AIClient which requires OPENAI_API_KEY in the process environment. If the key is missing, AI calls raise a clear error and the code falls back to the heuristic generator.
    • To test AI locally, export $env:OPENAI_API_KEY = "sk-..." in PowerShell before launching the server/process.
  • Remote repo handling: remote URLs must use SSH by default when FORCE_SSH_ONLY is true. When working with remote repos, RepositoryManager clones into WORKSPACE_DIR.
  • Changelog update flow: the server writes a placeholder entry, stages CHANGELOG.md, creates the commit, replaces the placeholder with the real hash, then amends the commit to include the updated CHANGELOG. Changelog errors are non-fatal; commits still succeed.

Developer workflows (commands you can run)

  • Run tests: pytest (project uses standard pytest tests under tests/).
  • Run the server locally (stdio MCP transport):
    • Development: uv run python -m git_commit_mcp.server (or python -m git_commit_mcp.__main__)
    • Production (uvx): uvx git-commit-mcp-server
  • Quick environment setup (PowerShell):
    # temporary for current shell
    $env:OPENAI_API_KEY = 'sk-REPLACE'
    # run server in same shell so it inherits env
    uvx git-commit-mcp-server
    

Patterns & heuristics to preserve

  • Commit type detection: see CommitMessageGenerator._detect_commit_type — it uses TYPE_PATTERNS, file extension and path heuristics, and counts to prioritize types. When adding new file categories, update TYPE_PATTERNS and unit tests.
  • Scope extraction: the scope is inferred from first-level directories but skips common prefixes like src/ or lib/. Keep this behaviour if you change message structure.
  • Message generation fallback: AI is preferred but any AI failure must gracefully fall back to CommitMessageGenerator.

Integration points & dependencies

  • FastMCP: MCP server framework; tools are declared with @mcp.tool() in server.py.
  • GitPython: used across change detection and Git operations. Use Repo objects passed around — do not re-instantiate unexpectedly.
  • OpenAI SDK: optional; code expects the openai package and environment key. The config supports ai_base_url for alternate endpoints.

Where to look for examples and tests

  • End-to-end behavior: tests/test_integration.py.
  • Message logic: tests/test_message_generator.py and src/git_commit_mcp/message_generator.py.
  • Change detection: tests/test_change_tracker.py and src/git_commit_mcp/change_tracker.py.

Read the full file on GitHub · 64 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 · 64 lines · 1,125 tokens per session scan A 4cb6bf784997

Subscribe to this mod's changes

git-mcp-server copilot-instructions.md is an instructions file published in the GitHub repository surajfale/git-mcp-server (2 stars, last pushed 9mo ago), licensed MIT. It adds 1,125 tokens to every session, about $0.0056 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

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

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

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

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

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