An MCP (Model Context Protocol) server that enables AI agents to safely rename Git commit messages.
No local installation needed:
npx @seolcu/commit-renamer-mcpEdit your config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"commit-renamer": {
"command": "npx",
"args": ["-y", "@seolcu/commit-renamer-mcp"]
}
}
}Edit ~/.cursor/mcp_settings.json:
{
"mcpServers": {
"commit-renamer": {
"command": "npx",
"args": ["-y", "@seolcu/commit-renamer-mcp"]
}
}
}Edit your settings:
- VSCode:
~/.vscode/mcp_settings.json - VSCode Insiders:
~/.vscode-insiders/mcp_settings.json
{
"mcpServers": {
"commit-renamer": {
"command": "npx",
"args": ["-y", "@seolcu/commit-renamer-mcp"],
"type": "stdio"
}
}
}Edit ~/.windsurf/mcp_settings.json:
{
"mcpServers": {
"commit-renamer": {
"command": "npx",
"args": ["-y", "@seolcu/commit-renamer-mcp"]
}
}
}Edit VSCode settings (settings.json):
{
"cline.mcpServers": {
"commit-renamer": {
"command": "npx",
"args": ["-y", "@seolcu/commit-renamer-mcp"]
}
}
}Add to your Gemini CLI config:
gemini mcp add commit-renamer npx -y @seolcu/commit-renamer-mcpEdit ~/.opencode/mcp_settings.json:
{
"mcpServers": {
"commit-renamer": {
"command": "npx",
"args": ["-y", "@seolcu/commit-renamer-mcp"]
}
}
}npm install -g @seolcu/commit-renamer-mcpgit clone https://github.com/seolcu/commit-renamer-mcp.git
cd commit-renamer-mcp
npm install
npm run buildThis MCP server provides the following tools:
List recent commits in the repository.
Parameters:
count(number, optional): Number of commits to list (1-100, default: 10)cwd(string, optional): Working directory (default: current directory)
Returns:
{
"commits": [
{
"hash": "full commit hash",
"shortHash": "short hash",
"message": "commit message",
"author": "author name",
"date": "commit date"
}
]
}Check the current repository status.
Parameters:
cwd(string, optional): Working directory
Returns:
{
"branch": "current branch name",
"isClean": true,
"hasUncommittedChanges": false,
"isRebaseInProgress": false
}Preview commit message changes without actually applying them.
Parameters:
commit_hash(string, required): Commit hash to rename (full or short)new_message(string, required): New commit messagecwd(string, optional): Working directory
Returns:
{
"commit": {
"hash": "commit hash",
"shortHash": "short hash",
"currentMessage": "current message",
"newMessage": "new message",
"author": "author",
"date": "date"
},
"canProceed": true,
"warnings": ["warning messages"]
}Actually rename a commit message. Warning: This rewrites Git history!
Parameters:
commit_hash(string, required): Commit hash to renamenew_message(string, required): New commit messageforce(boolean, optional): Bypass safety checks (default: false)cwd(string, optional): Working directory
Returns:
{
"success": true,
"oldHash": "old hash",
"newHash": "new hash",
"newMessage": "new message",
"warnings": ["warning messages"]
}Undo the last commit message change using git reflog.
Parameters:
cwd(string, optional): Working directory
Returns:
{
"success": true,
"message": "Successfully reverted to previous state using reflog"
}This tool provides several safety mechanisms:
- Working Directory Check: Refuses to operate if there are uncommitted changes
- Rebase Status Check: Refuses to operate if a rebase is in progress
- Remote Push Check: By default, prevents changing commits that have been pushed to remote (can be bypassed with
force=true) - Preview Feature: See what will happen before making actual changes
- Undo Feature: Revert changes using reflog if you make a mistake
Renaming commits rewrites Git history!
- Only use on branches you work on alone
- Rewriting history on shared branches can cause serious problems
- After changing pushed commits, you'll need
git push --force - Always use
preview_renamefirst to verify changes
# Run in development mode
npm run dev
# Build
npm run build
# Start production
npm start# Run all quality checks (typecheck + lint + format + test)
npm run quality
# Individual checks
npm run typecheck # TypeScript type checking
npm run lint # ESLint checking
npm run format # Prettier formatting
npm test # Run testsSee CONTRIBUTING.md for more details.
- TypeScript Strict Mode: Type safety guaranteed
- ESLint: Automated code quality checks
- Prettier: Consistent code style
- Vitest: 13 unit tests (100% passing)
- Production Ready: All quality checks passing
MIT
Issues and PRs are always welcome! See Contributing Guide for details.