commit-discipline-mcp
Enforces disciplined Git workflows by planning coding tasks into 2-4 ordered, test-gated stages and creating focused commits only when tests pass and the worktree is clean.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@commit-discipline-mcpPlan this feature into test-gated commits and commit each stage"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Why commit discipline?
Coding agents can solve large tasks quickly, but their Git history often arrives as one oversized commit—or a trail of commits made before tests ran. commit-discipline-mcp puts a small, deterministic control loop around that work.
Common failure mode | Built-in guardrail |
One giant, hard-to-review commit | Every task is planned into 2–4 ordered stages |
Tests are run after the commit | The detected test suite must pass before staging |
Unrelated files sneak into a commit | Files outside the active stage block the operation |
An agent skips ahead | Only the next pending stage can be committed |
Manual commits invalidate the plan | Unexpected |
A tool silently pushes code | This package never pushes or rewrites Git history |
It works with Codex, Claude Code, Cursor, and any MCP client that supports stdio tools. The same workflow is also available as a regular CLI.
Related MCP server: Development Workflow MCP Server
Quick start
Requirements: Node.js 18+, Git, and a clean Git repository.
npx -y commit-discipline-mcp@latest init --client all --yesThat command adds project-scoped MCP configuration and a reusable commit-discipline skill. Commit the generated files, reload your coding client, and ask:
Use commit-discipline to split this task into small test-gated stages. Commit each completed stage and finish the task when the worktree is clean.
Choose clients explicitly when needed:
npx -y commit-discipline-mcp@latest init --client codex --yes
npx -y commit-discipline-mcp@latest init --client claude --yes
npx -y commit-discipline-mcp@latest init --client cursor --yesClient | MCP configuration | Installed skill |
Codex |
|
|
Claude Code |
|
|
Cursor |
|
|
Use --dry-run to preview changes. Existing configuration is merged and backed up; --force is required to replace a conflicting entry.
How it works
flowchart LR
A[Clean repository] --> B[Plan 2–4 stages]
B --> C[Work on current stage]
C --> D{Tests pass?}
D -- No --> C
D -- Yes --> E[Validate scope and limits]
E --> F[Create focused commit]
F --> G{Stages left?}
G -- Yes --> C
G -- No --> H[Finish with clean worktree]The MCP server exposes four focused tools:
Tool | Purpose |
| Record 2–4 stages with exact repository-relative files |
| Test, validate, stage, and commit only the active stage |
| Report progress and the next permitted stage |
| Verify all stages are complete and the worktree is clean |
Plan state is stored locally in .commit-discipline/plan.json and ignored by default.
CLI workflow
Prefer a terminal? Install the binary globally:
npm install --global commit-discipline-mcpCreate a stage file:
[
{
"id": "core",
"title": "Build the core",
"description": "Implement the service layer",
"files": ["src/core.ts"]
},
{
"id": "tests",
"title": "Add coverage",
"description": "Cover the service behavior",
"files": ["tests/core.test.ts"]
}
]Then run the lifecycle:
commit-discipline plan-task --description "Build the feature" --stages-file stages.json
commit-discipline task-status
commit-discipline commit-stage core --message "feat: add core service"
commit-discipline commit-stage tests --message "test: cover core service"
commit-discipline finish-taskSee the guided throwaway-repository demo for copy-pasteable PowerShell and Bash examples.
Configuration
Add commit-discipline.config.json to the repository root when the defaults need adjustment:
{
"schemaVersion": 1,
"enforcement": "strict",
"maxFiles": 15,
"maxLines": 400,
"testTimeoutMs": 900000,
"planVisibility": "local",
"testCommand": {
"command": "npm",
"args": ["test"]
}
}Option | Default | Behavior |
|
| Use |
|
| Maximum changed files per stage |
|
| Maximum added and deleted lines per stage |
|
| Test-process timeout in milliseconds |
|
| Store plan state locally or as tracked project state |
| auto-detected | Override the test command and arguments |
Without an override, the tool detects one JavaScript, Python, Go, Rust, or Make test ecosystem. If several ecosystems are present, set testCommand explicitly. Failed tests always block a commit.
--file <path>commits a subset of the active stage's declared files.--max-files Nand--max-lines Napply one-off limits.--dry-runvalidates a stage without tests, staging, commits, or state changes.--jsonreturns machine-readable output for scripts and agents.
Safety by design
Plans start only from a clean worktree.
Absolute paths and path traversal are rejected.
Pre-existing staged files and out-of-scope changes are blocked.
Tests run before staging; scope is checked again afterward.
Dry runs do not mutate Git or plan state.
No runtime network calls and no telemetry.
No
git push, force operations, resets, or history rewriting.
Platform support
Every release is exercised across Windows, Ubuntu, and macOS on Node.js 18, 20, and 22. Packed-package smoke tests cover the full CLI lifecycle and the MCP stdio handshake.
Platform | Native launch path | Status |
Windows |
| Tested in PowerShell and Command Prompt |
Linux |
| Tested in Bash |
macOS |
| Tested in Zsh |
For implementation details and trust boundaries, read the architecture overview. Reusable starting points are available in examples/.
Development
git clone https://github.com/ayush-singh-0601/commit-discipline-mcp.git
cd commit-discipline-mcp
npm ci
npm run verify
npm run smoke:package
npm run benchmark:gitThe release gate includes type checking, 46+ unit and integration tests, package installation, a complete CLI/MCP lifecycle, and a Git-overhead benchmark against the PRD's 300 ms target.
Community
Read CONTRIBUTING.md before opening a pull request.
Report vulnerabilities privately using SECURITY.md.
Get usage help through SUPPORT.md.
See CHANGELOG.md for release history.
Track upcoming directions in ROADMAP.md.
If this project makes your agent-generated Git history easier to review, consider starring it—it helps other developers discover the tool.
License
MIT © Ayush Singh
Available Tools
4 toolscommit_stageCommit the next stageADestructive
Test, size-check, stage, and commit only the next declared plan stage.
| Name | Required | Description | Default |
|---|---|---|---|
| files | No | ||
| stage | Yes | ||
| dryRun | No | ||
| message | Yes | ||
| maxFiles | No | ||
| maxLines | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare destructiveHint=true, and the description adds the workflow pattern of testing, size-checking, staging, and committing, as well as the scoping to a single declared stage. It does not contradict annotations, and it enriches the behavioral context beyond just 'destructive'. However, it does not disclose failure modes or side effects such as what happens if tests fail.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The entire description is a single, front-loaded sentence that clearly communicates the action and scope. No filler or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With six parameters, a destructive annotation, and no output schema, the description is quite minimal. It does not mention prerequisites (e.g., a declared plan), what happens if size checks fail, or the effect of dryRun. This leaves important gaps for an agent aiming to invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description makes no reference to the six input parameters. Schema coverage is 0%, and the description does not compensate by explaining what 'files', 'dryRun', 'maxFiles', or 'maxLines' mean. The only implicit mention is 'stage', but it is not tied to the parameter definition.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific compound verb ('Test, size-check, stage, and commit') and identifies the resource as 'the next declared plan stage' with a scoping constraint ('only'). This distinguishes it from sibling tools like plan_task, task_status, and finish_task, making its purpose clear.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use the tool (when a plan stage is ready to commit) but does not explicitly state exclusions or mention alternative tools. The phrase 'only the next declared plan stage' provides some contextual constraint but lacks explicit 'use when' or 'instead of' guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
finish_taskFinish a taskAIdempotent
Mark a complete, clean task plan as finished.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The annotations already declare idempotentHint=true and destructiveHint=false, so the safety profile is covered. The description adds the behavioral precondition that the plan must be complete and clean, which is valuable context beyond annotations. It does not describe side effects of finishing, but given annotations, this is sufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no wasted words. It front-loads the action 'Mark' and immediately specifies the target and qualifiers. It is appropriately concise for a simple tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no parameters, no output schema, and annotations cover idempotency and safety. The description provides the purpose and a precondition, which is sufficient for an agent to decide when to use it. It could mention the absence of return values, but that is not required without an output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool takes zero parameters, and the schema is trivially complete with 100% coverage. The baseline for zero-parameter tools is 4, and the description contains no parameter information because none is needed. This is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'Mark' and identifies the resource 'task plan' and the resulting state 'finished'. It clearly distinguishes from siblings like plan_task and task_status by indicating the finalization action. However, it does not explicitly contrast with sibling tools, so it stops short of a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description states the precondition 'complete, clean task plan,' which implies when the tool should be used and implicitly warns against using it on incomplete or unclean plans. It does not mention alternative tools, but the condition provides clear usage context. There are no explicit exclusions beyond the condition.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
plan_taskPlan a taskA
Create an ordered 2-4 stage commit plan from a clean Git worktree.
| Name | Required | Description | Default |
|---|---|---|---|
| stages | Yes | ||
| description | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations are all false, so the description must disclose behavioral traits. It adds the clean-worktree precondition but does not explain side effects (e.g., where the plan is stored), validation behavior, or return output. This is partial transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that front-loads the action and object, includes key constraints (ordered, 2-4 stages, clean worktree), and contains no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, no parameter documentation, and only a terse description, the agent lacks essential context about how to construct stages, what the plan is used for, or how it relates to sibling tools. The workflow context is not explained, leaving significant gaps for a tool with nested parameters.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description does not explain what the top-level 'description' parameter means or what the stage object fields (e.g., 'files') represent. The term 'commit plan' hints at context, but the description leaves too much to inference for a nested structure.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific action ('Create'), a concrete resource ('ordered 2-4 stage commit plan'), and a condition ('from a clean Git worktree'). This clearly differentiates plan_task from siblings like commit_stage and task_status by focusing on the planning phase.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It provides a clear prerequisite ('clean Git worktree') and scope ('2-4 stage'), which imply usage during initial planning. However, it does not explicitly mention when not to use or name alternatives, stopping short of full usage guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
task_statusRead task statusARead-onlyIdempotent
Read the active plan, completed commits, and next stage.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false. The description adds useful context by specifying exactly what is read (active plan, completed commits, next stage), which enriches the behavioral picture without contradicting annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single, concise sentence conveys the tool's purpose and contents without any filler or repetition. It front-loads the key information effectively.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter, read-only tool with supportive annotations, the description adequately explains the tool. It could mention the return format, but given the simplicity and absence of parameters, the current description is sufficient for an agent to select and invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has zero parameters, so the baseline of 4 applies. The description does not need to explain parameters, and there is no ambiguity to resolve.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses the specific verb 'Read' and names the resource 'task status', then details the content ('active plan, completed commits, and next stage'). This clearly distinguishes it from sibling tools like plan_task and commit_stage, which imply mutation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies this tool is for checking status without modifying anything, and sibling names suggest it as an alternative to planning/committing. However, it provides no explicit when-to-use or when-not-to-use guidance, leaving the context to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
4 tool updates
v0.1.0- First observed
commit_stage - First observed
finish_task - First observed
plan_task - First observed
task_status
TDQS
Each tool has a unique, non-overlapping role: plan creation, stage execution, status inspection, and task completion. No ambiguity in purpose.
All tool names follow the consistent verb_noun pattern (plan_task, commit_stage, task_status, finish_task), making the API predictable.
4 tools provide a focused, well-scoped workflow for commit discipline without unnecessary bloat or missing essentials.
The toolset covers the full lifecycle: create plan, execute stages, check status, and finish. No obvious gaps in the workflow.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
MCP server for generating rough-draft project plans from natural-language prompts.
Create, deploy, and operate MCP servers directly from your GitHub repositories.
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server that integrates DevFlow with AI code assistants to enforce structured development workflows including planning, task tracking, and code review gates.652471MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server that enforces development discipline and workflow best practices, guiding users through a structured process of coding, testing, documenting, committing, and releasing.1231MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that adds engineering discipline to AI-assisted development, enforcing evidence-gated TDD, security review, backup strategy, and deployment generation to turn AI-generated code into production-ready software.2110MIT
- AlicenseAqualityDmaintenanceAn MCP server that enforces safe git commits by allowing only specified files and providing fixup capabilities for earlier commits.21MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ayush-singh-0601/commit-discipline-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server