Skip to content

Commit fc7bced

Browse files
committed
docs: clarify README usage for PyPI and MCP clients
1 parent 6c4d918 commit fc7bced

1 file changed

Lines changed: 120 additions & 3 deletions

File tree

README.md

Lines changed: 120 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Model Context Protocol (MCP) server for [commit-check](https://github.com/commit-check/commit-check).
44

5+
`commit-check-mcp` exposes `commit-check` as local MCP tools so an MCP client can validate commit messages, branch names, author info, and repository state.
6+
57
## Features
68

79
This MCP server exposes commit-check validations as MCP tools:
@@ -31,19 +33,127 @@ All validation tools return the same structured commit-check result shape:
3133
}
3234
```
3335

34-
## Install
36+
## Installation
37+
38+
```bash
39+
pip install commit-check-mcp
40+
```
41+
42+
This installs the `commit-check-mcp` CLI entrypoint.
43+
44+
For local development from this repository:
3545

3646
```bash
3747
pip install -e .
3848
```
3949

40-
## Run
50+
## Use With An MCP Client
51+
52+
This server runs over stdio, so it is meant to be launched by an MCP client rather than used as a long-running HTTP service.
53+
54+
Generic MCP client config:
55+
56+
```json
57+
{
58+
"mcpServers": {
59+
"commit-check": {
60+
"command": "commit-check-mcp"
61+
}
62+
}
63+
}
64+
```
65+
66+
If the client needs the full path to the executable, first locate it:
67+
68+
```bash
69+
which commit-check-mcp
70+
```
71+
72+
Then use that absolute path in the client config.
73+
74+
Example using an absolute path:
75+
76+
```json
77+
{
78+
"mcpServers": {
79+
"commit-check": {
80+
"command": "/absolute/path/to/commit-check-mcp"
81+
}
82+
}
83+
}
84+
```
85+
86+
For local development from this repository, that absolute path may point to something like `.venv/bin/commit-check-mcp`.
87+
88+
## Run Manually
4189

4290
```bash
4391
commit-check-mcp
4492
```
4593

46-
The server runs over stdio transport (recommended MCP default for local tool integrations).
94+
The server uses stdio transport, which is the recommended MCP default for local tool integrations.
95+
96+
## Tool Usage
97+
98+
After the client starts the server, it will expose these tools:
99+
100+
- `server_health`: returns server, SDK, and dependency versions
101+
- `validate_commit_message(message, config?, repo_path?, config_path?)`
102+
- `validate_branch_name(branch?, config?, repo_path?, config_path?)`
103+
- `validate_author_info(author_name?, author_email?, config?, repo_path?, config_path?)`
104+
- `validate_commit_context(message?, branch?, author_name?, author_email?, config?, repo_path?, config_path?)`
105+
- `validate_repository_state(repo_path?, config?, config_path?, include_message?, include_branch?, include_author?)`
106+
- `describe_validation_rules(config?, repo_path?, config_path?)`
107+
108+
The common optional arguments are:
109+
110+
- `repo_path`: repository directory to validate against
111+
- `config_path`: explicit TOML config file; relative paths resolve from `repo_path`
112+
- `config`: ad-hoc config overrides merged on top of defaults and repo config
113+
114+
## Common Examples
115+
116+
Validate a commit message using repo-local rules:
117+
118+
```json
119+
{
120+
"message": "feat(api): add MCP validation tool",
121+
"repo_path": "/path/to/repo"
122+
}
123+
```
124+
125+
Validate the current repository branch using an explicit config file:
126+
127+
```json
128+
{
129+
"repo_path": "/path/to/repo",
130+
"config_path": ".github/commit-check.toml"
131+
}
132+
```
133+
134+
Validate the full repository state:
135+
136+
```json
137+
{
138+
"repo_path": "/path/to/repo",
139+
"include_message": true,
140+
"include_branch": true,
141+
"include_author": true
142+
}
143+
```
144+
145+
Inspect the final merged rules that will be applied:
146+
147+
```json
148+
{
149+
"repo_path": "/path/to/repo",
150+
"config": {
151+
"commit": {
152+
"require_body": true
153+
}
154+
}
155+
}
156+
```
47157

48158
## Repository-Aware Validation
49159

@@ -69,3 +179,10 @@ Example payload for a repository-wide validation:
69179
"include_author": true
70180
}
71181
```
182+
183+
Config precedence is:
184+
185+
1. `commit-check` built-in defaults
186+
2. repository config loaded from `repo_path`
187+
3. `config_path` when explicitly provided
188+
4. inline `config` overrides passed to the tool

0 commit comments

Comments
 (0)