MCPInstall
git-auto-coach-mcp logo

git-auto-coach-mcp

by guptasoumya26 1 stars guptasoumya26/git-auto-coach-mcp

A lightweight Python MCP server for on-demand Java code quality feedback from Git repos.

READMEmaster

Git Auto Coach MCP Server

A lightweight Python MCP (Model Context Protocol) server that integrates with Claude Desktop to give on-demand Java code quality feedback—right from your local Git repository, with a single prompt.


🚀 Overview

With Git Auto Coach, you can:

  • Analyze Java files in any local Git repo for:
    • Spelling mistakes
    • Checkstyle violations (Google style)
    • Missing Javadoc on public types/methods
    • Java naming convention issues
  • Launch automatically when you start Claude Desktop
  • Get results in under a second with one simple prompt
  • Learn by doing—see best practices applied to your own code

🔧 Features

  • MCP protocol integration using mcp[cli]
  • Spell checking using codespell
  • Java linting using checkstyle
  • Lightweight Javadoc and naming checks via Python
  • Logs all debug messages to Claude's debug window

🛠️ Prerequisites

You must have the following installed:

  • Python 3.8+
  • Git
  • Java Runtime (for running Checkstyle)
  • Claude Desktop
  • Checkstyle:
    • Option 1: via your OS package manager (recommended)
    • Option 2: manual JAR download
  • Optional: codespell for spell checking

📦 Installation Steps

1. Clone the Repository

git clone https://github.com/yourusername/git-auto-coach.git
cd git-auto-coach

2. Create a Virtual Environment

python -m venv .venv
# On macOS/Linux:
source .venv/bin/activate
# On Windows (PowerShell):
.\.venv\Scripts\Activate.ps1

3. Install Required Python Packages

pip install "mcp[cli]" codespell

4. Install Checkstyle

  • Via Package Manager:
# macOS/Linux:
brew install checkstyle

# Windows:
winget install checkstyle
  • Manual JAR Download:
  1. Go to:
    https://repo1.maven.org/maven2/com/puppycrawl/tools/checkstyle/

  2. Download the latest checkstyle-xx-all.jar

  3. Save it to: tools/checkstyle.jar

5. Download Google Checkstyle Config

wget -O google_checks.xml https://raw.githubusercontent.com/checkstyle/checkstyle/master/src/main/resources/google_checks.xml

⚙️ Configuration in Claude Desktop

1. Open Claude Desktop Config

Locate your claude_desktop_config.json file. On Windows, it's typically:

%APPDATA%\Claude\claude_desktop_config.json

2. Add the MCP Server Configuration

Add the following block under "mcpServers":

{
  "mcpServers": {
    "gitAutoCoach": {
      "command": "C:\\full\\path\\to\\.venv\\Scripts\\python.exe",
      "args": ["-u", "C:\\full\\path\\to\\git_auto_coach.py"]
    }
  }
}

Make sure:

  • The Python path is from the virtual environment you used earlier
  • You use double backslashes (\\) in JSON strings on Windows

▶️ Usage

✅ To Run Inside Claude Desktop

  1. Start Claude Desktop
  2. Click the 🛠️ (MCP) icon
  3. Select gitAutoCoach
  4. Prompt:
analyze_repo D:/path/to/your/repository

✅ To Run Locally for Testing

python git_auto_coach.py D:/path/to/your/repository

🧪 Output Example

✔️ No spelling mistakes.
🔧 Checkstyle issues:
– [ERROR] Sample.java:10: 'if' construct must use '{}' [NeedBraces]
📄 Javadoc issues:
– Sample.java:4 missing Javadoc for public type
🏷️ Naming issues:
– sample.java class name should be TitleCase

🐞 Troubleshooting

  • If you get timeout errors in Claude, make sure:
    • No analysis phase takes longer than 4 minutes
    • You’ve removed or optimized slow subprocesses (like git grep)
  • If checkstyle or codespell aren't found:
    • Ensure they're installed and available in the environment Claude uses
  • Use debug logs to trace performance:
    Claude → Settings → Show Developer Tools → Console

🤝 Contributing

Pull requests are welcome!

  1. Fork this repository
  2. Create your feature branch (git checkout -b feature/my-feature)
  3. Commit your changes
  4. Push to your fork
  5. Open a PR

📄 License

This project is licensed under the MIT License.

More Developer Tools MCP servers

Similar servers from the same category.

Sourcebot

sourcebot-dev

Enables code search across multiple repository hosts including GitHub, GitLab, Gitea, Gerrit, and Bitbucket with advanced filtering options for exploring large codebases through natural language queries.

searchgit

CodeAlive

codealive-ai

Provides a bridge to CodeAlive's platform for semantic code search, repository exploration, and context-aware chat completions that leverage deep understanding of entire codebases including documentation and dependencies.

search

Provides a secure, sandboxed environment for executing Python, Node.js, and shell commands in ephemeral containers with file management capabilities for code testing, visualization, and data analysis.

filesystemdatabase

NovaCV

lightbaby

Integrates with NovaCV API to generate, analyze, and convert resumes in various formats without dealing with complex document formatting

PDFSupport+5