commit-check MCP
v0.1.13Commit policy as code for AI agents: check commit messages, branch names and authors before a push
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
server_health Server health
Return server and dependency versions. Read-only, no side effects. Returns {server, server_version, commit_check_version, mcp_sdk_version}. Useful as a first call to verify the server is running and to check version compatibility.
validate_commit_message Validate commit message
Validate a commit message against commit-check rules (Conventional Commits type and format, subject length and case, body, sign-off, WIP/fixup markers, AI attribution: whatever the effective config enables). Read-only; touches no git state. Returns {status, warnings, checks[]}. status is 'pass', 'fail' or 'skip': only 'fail' is a rejection; 'skip' means every check skipped, so nothing was validated and the result is not approval. warnings is the number of checks with status 'warn'. Each check has: rule_id (stable rule id, e.g. 'CC001'); check (rule name, e.g. 'message'); status 'pass' | 'fail…
| Parameter | Type | Description |
|---|---|---|
message * | string | Full commit message text to validate: subject line, optional blank line, body (and trailers such as Signed-off-by). Must be non-empty. |
config | Inline commit-check config overrides as a JSON object, merged on top of the built-in defaults and any config file, e.g. {"warn": ["message"]} or {"commit": {"require_body": true}}. | |
config_path | Path to a commit-check TOML config file, used instead of the repository's own cchk.toml/commit-check.toml; a relative path is resolved from repo_path. | |
repo_path | Path to the git repository to validate against. Its cchk.toml or commit-check.toml (also looked up under .github/) is loaded, and a relative config_path is resolved from it. Omit to use the server's w… |
validate_branch_name Validate branch name
Validate a branch name against the configured naming convention (e.g. feature/*, bugfix/*) and, when configured, that the branch is based on the required merge base. Read-only. Returns {status, warnings, checks[]}. status is 'pass', 'fail' or 'skip': only 'fail' is a rejection; 'skip' means every check skipped, so nothing was validated and the result is not approval. warnings is the number of checks with status 'warn'. Each check has: rule_id (stable rule id, e.g. 'CC001'); check (rule name, e.g. 'message'); status 'pass' | 'fail' | 'warn' | 'skip' ('warn' = the config lists the check under w…
| Parameter | Type | Description |
|---|---|---|
branch | Branch name to validate, e.g. 'feature/login'. Omit to validate the branch currently checked out in repo_path, which must then be a git repository. Must be non-empty when provided. | |
config | Inline commit-check config overrides as a JSON object, merged on top of the built-in defaults and any config file, e.g. {"warn": ["message"]} or {"commit": {"require_body": true}}. | |
config_path | Path to a commit-check TOML config file, used instead of the repository's own cchk.toml/commit-check.toml; a relative path is resolved from repo_path. | |
repo_path | Path to the git repository to validate against. Its cchk.toml or commit-check.toml (also looked up under .github/) is loaded, and a relative config_path is resolved from it. Omit to use the server's w… |
validate_author_info Validate author info
Validate a commit author's name and/or email against the configured rules (e.g. allowed email domains, name patterns, and under ai_attribution forbid/disclose that the author is not an AI tool). Read-only. Returns {status, warnings, checks[]}. status is 'pass', 'fail' or 'skip': only 'fail' is a rejection; 'skip' means every check skipped, so nothing was validated and the result is not approval. warnings is the number of checks with status 'warn'. Each check has: rule_id (stable rule id, e.g. 'CC001'); check (rule name, e.g. 'message'); status 'pass' | 'fail' | 'warn' | 'skip' ('warn' = the c…
| Parameter | Type | Description |
|---|---|---|
author_email | Author email to validate, e.g. 'alice@example.com'. Omit to read it from repo_path (git config user.email, falling back to the latest commit's author). Must be non-empty when provided. | |
author_name | Author name to validate, e.g. 'Alice Example'. Omit to read it from repo_path (git config user.name, falling back to the latest commit's author). Must be non-empty when provided. | |
config | Inline commit-check config overrides as a JSON object, merged on top of the built-in defaults and any config file, e.g. {"warn": ["message"]} or {"commit": {"require_body": true}}. | |
config_path | Path to a commit-check TOML config file, used instead of the repository's own cchk.toml/commit-check.toml; a relative path is resolved from repo_path. | |
repo_path | Path to the git repository to validate against. Its cchk.toml or commit-check.toml (also looked up under .github/) is loaded, and a relative config_path is resolved from it. Omit to use the server's w… |
validate_push_safety Validate push safety
Check that a pending push is not a force push (rule CC301, no_force_push): fails when a remote_sha is not an ancestor of its local_sha, i.e. the push would rewrite remote history. Leaves your working tree and commits untouched, but may run `git fetch <remote> <ref>` to resolve SHAs, which updates FETCH_HEAD and remote-tracking refs. A SHA that cannot be resolved even then is a tool error, never a pass. Force pushes are always rejected by this tool; push.allow_force_push in config cannot re-enable them here. Returns {status, warnings, checks[]}. status is 'pass', 'fail' or 'skip': only 'fail'…
| Parameter | Type | Description |
|---|---|---|
config | Inline commit-check config overrides as a JSON object, merged on top of the built-in defaults and any config file, e.g. {"warn": ["message"]} or {"commit": {"require_body": true}}. | |
config_path | Path to a commit-check TOML config file, used instead of the repository's own cchk.toml/commit-check.toml; a relative path is resolved from repo_path. | |
push_refs | Refs about to be pushed, in git pre-push hook stdin format, one ref per line: '<local_ref> <local_sha> <remote_ref> <remote_sha>', e.g. 'refs/heads/main 1a2b3c... refs/heads/main 9f8e7d...'. A remote_… | |
repo_path | Path to the git repository to validate against. Its cchk.toml or commit-check.toml (also looked up under .github/) is loaded, and a relative config_path is resolved from it. Omit to use the server's w… |
validate_commit_context Validate commit context
Run the commit message, branch name and author checks together in one call, for whichever of message, branch, author_name and author_email you pass. Read-only. Returns {status, warnings, checks[]}. status is 'pass', 'fail' or 'skip': only 'fail' is a rejection; 'skip' means every check skipped, so nothing was validated and the result is not approval. warnings is the number of checks with status 'warn'. Each check has: rule_id (stable rule id, e.g. 'CC001'); check (rule name, e.g. 'message'); status 'pass' | 'fail' | 'warn' | 'skip' ('warn' = the config lists the check under warn, so the findi…
| Parameter | Type | Description |
|---|---|---|
author_email | Author email to validate, e.g. 'alice@example.com'. Omit to read it from repo_path (git config user.email, falling back to the latest commit's author). Must be non-empty when provided. | |
author_name | Author name to validate, e.g. 'Alice Example'. Omit to read it from repo_path (git config user.name, falling back to the latest commit's author). Must be non-empty when provided. | |
branch | Branch name to validate, e.g. 'feature/login'. Omit to validate the branch currently checked out in repo_path, which must then be a git repository. Must be non-empty when provided. | |
config | Inline commit-check config overrides as a JSON object, merged on top of the built-in defaults and any config file, e.g. {"warn": ["message"]} or {"commit": {"require_body": true}}. | |
config_path | Path to a commit-check TOML config file, used instead of the repository's own cchk.toml/commit-check.toml; a relative path is resolved from repo_path. | |
message | Commit message text to validate: subject line, optional blank line, body. Omit to skip the message checks. Must be non-empty when provided. | |
repo_path | Path to the git repository to validate against. Its cchk.toml or commit-check.toml (also looked up under .github/) is loaded, and a relative config_path is resolved from it. Omit to use the server's w… |
validate_repository_state Validate repository state
Validate what is already in a local git repository: the latest commit's message and author, the checked-out branch name and, optionally, whether pushing that branch to its upstream would be a force push. Leaves the working tree and commits untouched; the push check may run `git fetch`, which updates FETCH_HEAD and remote-tracking refs. Returns {status, warnings, checks[]}. status is 'pass', 'fail' or 'skip': only 'fail' is a rejection; 'skip' means every check skipped, so nothing was validated and the result is not approval. warnings is the number of checks with status 'warn'. Each check has:…
| Parameter | Type | Description |
|---|---|---|
config | Inline commit-check config overrides as a JSON object, merged on top of the built-in defaults and any config file, e.g. {"warn": ["message"]} or {"commit": {"require_body": true}}. | |
config_path | Path to a commit-check TOML config file, used instead of the repository's own cchk.toml/commit-check.toml; a relative path is resolved from repo_path. | |
include_author | boolean | Validate the author name and email of the latest commit (falling back to git config user.name/user.email). Default true. |
include_branch | boolean | Validate the name of the currently checked-out branch. Default true. |
include_message | boolean | Validate the message of the latest commit (HEAD). Default true. |
include_push | boolean | Also check that pushing the current branch to its upstream would not be a force push; may run git fetch (updating FETCH_HEAD), and passes when the branch has no upstream. Default false. |
repo_path | Path to the git repository to inspect; its cchk.toml or commit-check.toml is loaded and a relative config_path is resolved from it. Omit to use the server's working directory, which must then be a git… |
describe_validation_rules Describe validation rules
Return the commit-check rules that are in effect after merging the built-in defaults, the repository's config file (or config_path) and the inline config overrides. Read-only, no side effects. Returns {commit_check_version, config (the merged config), supported_checks (every check name commit-check knows), enabled_rules[]} where each enabled rule carries its check name, config and pattern details. Use this before writing a commit message or branch name to learn the expected format instead of guessing, and to debug why a validation failed or was skipped.
| Parameter | Type | Description |
|---|---|---|
config | Inline commit-check config overrides as a JSON object, merged on top of the built-in defaults and any config file, e.g. {"warn": ["message"]} or {"commit": {"require_body": true}}. | |
config_path | Path to a commit-check TOML config file, used instead of the repository's own cchk.toml/commit-check.toml; a relative path is resolved from repo_path. | |
repo_path | Path to the git repository to validate against. Its cchk.toml or commit-check.toml (also looked up under .github/) is loaded, and a relative config_path is resolved from it. Omit to use the server's w… |