Skip to content

Commit 60c7c7c

Browse files
authored
docs: an MCP server guide, and a page comparing the other tools (#29)
1 parent 2363a0d commit 60c7c7c

5 files changed

Lines changed: 189 additions & 1 deletion

File tree

‎docs/compare/tools.md‎

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Compared with other tools
2+
3+
What else checks commit messages, branch names and pull request titles on
4+
GitHub, what each one does, and when it is the better choice. Prices and
5+
features are as the projects list them in September 2026; follow the links
6+
for the current state. GitHub's own rulesets are on
7+
[their own page](github-rules.md).
8+
9+
## The field
10+
11+
| Tool | What it is | What it checks | Where it runs | Price |
12+
|---|---|---|---|---|
13+
| [commitlint](https://commitlint.js.org/) with [commitlint-github-action](https://github.com/wagoid/commitlint-github-action) | The reference Conventional Commits linter in the JavaScript world: shared configs, plugins, a [commitizen](https://commitizen.github.io/cz-cli/) prompt | Commit messages | Node hook (husky), CI Action | Free, open source |
14+
| [action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) | The most-used pull request title check; Electron, Vite and Vercel run it | The pull request title (optionally the single commit, for squash merges) | GitHub Action | Free, open source |
15+
| [Semantic PRs](https://github.com/Ezard/semantic-prs) | A GitHub App with the same idea: type and scope on the title or the commits | Pull request title or commits | GitHub App | Free, open source |
16+
| [commitcheck](https://github.com/marketplace/commitcheck) | A hosted App that applies one regular expression, set in its web admin | Commit message, pull request title or description, by regex | GitHub App | Free for public repositories; $25 a month for private ones |
17+
| [DCO app](https://github.com/apps/dco) and [DCO-2](https://github.com/cncf/dco2) | The sign-off check the Linux kernel and the CNCF use, with a remediation flow for missing sign-offs | `Signed-off-by` trailers | GitHub App | Free, open source |
18+
| [PRLint](https://github.com/ewolfe/prlint), [PR Title Checker](https://github.com/marketplace/actions/pr-title-checker) | Regular expressions over pull request fields | Title, body, labels, branch | App / Action | Free, open source |
19+
| **Commit Check** | One rule engine with [24 documented rules](../rules.md), run as a hook, a CLI, an Action, a hosted App or an MCP tool | Commit message, branch name, author name and email, sign-off, AI attribution, force pushes, file size and paths, tag names; the squash message of a pull request | All of the above | Free, open source; the App's private organization repositories move to a paid plan later |
20+
21+
## What is different about Commit Check
22+
23+
- **One config, every place it runs.** The same `cchk.toml` drives the
24+
[pre-commit hook](../guides/pre-commit.md), the [Action](../guides/github-actions.md),
25+
the [App](../guides/github-app.md) and the [MCP server](../guides/mcp.md).
26+
The others cover one place each: commitlint is a Node hook and an Action;
27+
the title checkers are Actions or Apps; commitcheck is an App.
28+
- **More than the message.** Branch names, author identity, sign-off, AI
29+
attribution trailers, force pushes and file rules are rules, not separate
30+
tools to find and wire up.
31+
- **A failure explains itself.** Every rule has a stable ID, a one-line error,
32+
a suggestion and a documentation page, and the Action and App show all of
33+
it where the failure is. A regex tool reports a mismatch.
34+
- **Squash-aware.** The App can check the message a squash merge would land,
35+
built from the repository's merge settings, rather than every commit on the
36+
branch or only the title.
37+
- **No JavaScript toolchain.** It is a Python package with no runtime
38+
dependencies; a Go, Rust or Java repository does not need Node to lint its
39+
commits.
40+
41+
## Where the others are stronger
42+
43+
- **commitlint's ecosystem.** Years of shared configs (`@commitlint/config-*`),
44+
plugins and editor integrations, plus an interactive prompt for writing the
45+
message. Commit Check has no prompt, and its rules are the ones it ships.
46+
- **A Node monorepo already on husky.** If commitlint is installed and the
47+
policy is "message only", there is little to gain from switching.
48+
- **Sign-off remediation.** The DCO app can accept a later commit that
49+
certifies earlier ones, and lets a maintainer override. Commit Check checks
50+
the trailer and stops there.
51+
- **Rejecting the push itself.** Only GitHub's rulesets (and a server-side
52+
hook on GitHub Enterprise Server) refuse a ref update; see the
53+
[rulesets page](github-rules.md). Every tool above, Commit Check included,
54+
marks the commit or blocks the merge.
55+
56+
## Which to choose
57+
58+
- You want the pull request title checked and nothing else: `action-semantic-pull-request`.
59+
- You are in a JavaScript repository with husky and want plugins: commitlint.
60+
- You need sign-off with a remediation flow: the DCO app, or DCO-2.
61+
- You want one policy for messages, branches and authors, the same everywhere
62+
a commit is made and checked, with a hosted option that needs no workflow
63+
file: Commit Check.

‎docs/guides/integrations.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ between what a developer sees locally and what is enforced on the pull request.
1010
| [GitHub Action](github-actions.md) | On every push and pull request, in CI | No | A workflow file in each repository |
1111
| [GitHub App](github-app.md) | On every push and pull request, hosted | No | Install once for the organization |
1212
| [Command line](../example.md) | Wherever you call it: a range of commits, a CI you write yourself | — | `pip install commit-check` |
13-
| [MCP server](https://github.com/commit-check/commit-check-mcp) | Before the commit exists, inside an AI coding agent | — | One entry in the agent's MCP config |
13+
| [MCP server](mcp.md) | Before the commit exists, inside an AI coding agent | — | One entry in the agent's MCP config |
1414
| [Organization config](organization.md) | Everywhere at once | — | One shared `cchk.toml`, whichever of the above runs it |
1515

1616
## Which one
@@ -63,6 +63,11 @@ ones created later, gets a **Commit Check** result on each commit of every
6363
push and pull request, with no workflow file and no CI minutes.
6464
[Set it up →](github-app.md)
6565

66+
## MCP server
67+
68+
The same rules as tools for an AI coding agent, so the message is right before
69+
the commit exists. One entry in the agent's MCP settings. [Set it up →](mcp.md)
70+
6671
## Across an organization { #across-an-organization }
6772

6873
One `cchk.toml` in the organization's `.github` repository; each repository

‎docs/guides/mcp.md‎

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# MCP server
2+
3+
[commit-check-mcp](https://github.com/commit-check/commit-check-mcp) exposes
4+
the same rules to an AI coding agent as
5+
[Model Context Protocol](https://modelcontextprotocol.io/) tools. An agent that
6+
writes commits can check the message, the branch name and the author before
7+
the commit exists, against the repository's own `cchk.toml`, and fix what
8+
fails instead of finding out from the hook or the pull request.
9+
10+
## Add it to the agent
11+
12+
The server runs over stdio and is started by the client. With
13+
[uv](https://docs.astral.sh/uv/) installed nothing else needs installing:
14+
15+
=== "Claude Code"
16+
17+
```json title=".claude/settings.local.json or ~/.claude/settings.json"
18+
{
19+
"mcpServers": {
20+
"commit-check": {
21+
"command": "uvx",
22+
"args": ["commit-check-mcp"]
23+
}
24+
}
25+
}
26+
```
27+
28+
=== "Cursor"
29+
30+
```json title=".cursor/mcp.json"
31+
{
32+
"mcpServers": {
33+
"commit-check": {
34+
"command": "uvx",
35+
"args": ["commit-check-mcp"]
36+
}
37+
}
38+
}
39+
```
40+
41+
=== "Claude Desktop, Windsurf, Cline, Roo Code"
42+
43+
The same block, in each client's MCP settings file. The
44+
[README](https://github.com/commit-check/commit-check-mcp#use-with-an-mcp-client)
45+
lists the file for each.
46+
47+
=== "Zed"
48+
49+
```json title="~/.config/zed/settings.json"
50+
{
51+
"mcp_servers": {
52+
"commit-check": {
53+
"command": "uvx",
54+
"args": ["commit-check-mcp"]
55+
}
56+
}
57+
}
58+
```
59+
60+
=== "Without uv"
61+
62+
```console
63+
$ pip install commit-check-mcp
64+
$ which commit-check-mcp
65+
```
66+
67+
Then use that absolute path as the `command`, with no `args`.
68+
69+
## Make the agent use it
70+
71+
Tools an agent *can* call are not tools it *will* call. One line in the
72+
project's agent instructions — `CLAUDE.md`, `AGENTS.md`, a Cursor rule — makes
73+
the check part of every commit:
74+
75+
```markdown title="CLAUDE.md"
76+
Before every commit, validate the message with the commit-check MCP tool
77+
(`validate_commit_message`) and rewrite it until it passes.
78+
```
79+
80+
The result the agent gets back is the same structured verdict the CLI prints
81+
with `--format json`: a status, and for each check its value, the error and a
82+
suggestion. That is enough for the agent to correct the message on its own.
83+
84+
## The tools
85+
86+
| Tool | Checks |
87+
|---|---|
88+
| `validate_commit_message(message, …)` | A message against the [commit message rules](../rules.md#commit-message-rules) |
89+
| `validate_branch_name(branch?, …)` | A branch name, or the repository's current branch, against the [branch rules](../rules.md#branch-rules) |
90+
| `validate_author_info(author_name?, author_email?, …)` | A name and email, or the repository's git author config, against the [author rules](../rules.md#author-rules) |
91+
| `validate_push_safety(push_refs?, …)` | That a push is not a force push ([CC301](../rules.md#cc301)) |
92+
| `validate_commit_context(message?, branch?, author_name?, author_email?, …)` | Any combination of the above in one call |
93+
| `validate_repository_state(repo_path?, …)` | The latest commit, current branch and author config of a repository, with push safety on request |
94+
| `describe_validation_rules(…)` | The effective configuration after defaults, the repository's file and any overrides |
95+
| `server_health()` | Server, rule engine and SDK versions |
96+
97+
Every validation tool takes the same optional arguments:
98+
99+
- `repo_path` — the repository to validate against; the config file is looked
100+
up there, in the [usual places](../configuration.md#where-the-config-file-lives).
101+
- `config_path` — a specific TOML file instead; a relative path resolves from
102+
`repo_path`.
103+
- `config` — inline overrides, merged on top of the defaults and the file, for
104+
a one-off stricter or looser check.
105+
106+
All tools are read-only. Nothing is committed, pushed or written.
107+
108+
## The same rules, one step earlier
109+
110+
The MCP server reads the same `cchk.toml` as the [pre-commit hook](pre-commit.md),
111+
the [Action](github-actions.md) and the [App](github-app.md), through the same
112+
rule engine, so an agent that passes here passes there. It changes *when* the
113+
verdict arrives: before the commit exists, inside the tool that is writing it,
114+
instead of after, from a hook the agent may not be running or from a check on
115+
the pull request. For a repository that forbids AI attribution trailers
116+
([CC013](../rules.md#cc013)) or requires a sign-off ([CC012](../rules.md#cc012)),
117+
this is where the agent learns it.

‎docs/index.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ graph LR
255255
**MCP server** — exposes the validations as structured tools for AI coding
256256
agents such as Claude Code, Cursor and Copilot.
257257

258+
[:octicons-arrow-right-24: Guide](guides/mcp.md)
258259
[:octicons-arrow-right-24: Repo](https://github.com/commit-check/commit-check-mcp)
259260

260261
</div>

‎mkdocs.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ nav:
165165
- GitHub Action: guides/github-actions.md
166166
- GitHub App: guides/github-app.md
167167
- Across an organization: guides/organization.md
168+
- MCP server: guides/mcp.md
168169
- Policy guides: guides/policies.md
169170
- Command-line recipes: example.md
170171
- Troubleshooting: troubleshoot.md
@@ -176,5 +177,6 @@ nav:
176177
- Privacy: privacy.md
177178
- Compare:
178179
- GitHub's built-in rules: compare/github-rules.md
180+
- Other tools: compare/tools.md
179181
- Blog:
180182
- blog/index.md

0 commit comments

Comments
 (0)