MCP ExplorerExplorer

Git Auto Coach Mcp

@guptasoumya26on 9 months ago
1 MIT
FreeCommunity
AI Systems
A lightweight Python MCP server for on-demand Java code quality feedback from Git repos.

Overview

What is Git Auto Coach Mcp

Git Auto Coach MCP is a lightweight Python MCP server that integrates with Claude Desktop to provide on-demand Java code quality feedback directly from your local Git repository with a single prompt.

Use cases

Use cases include analyzing Java code for spelling mistakes, Checkstyle violations, missing Javadoc, and naming convention issues, as well as providing real-time feedback to developers.

How to use

To use Git Auto Coach MCP, clone the repository, create a virtual environment, install the required Python packages and Checkstyle, and then run the server while using Claude Desktop to analyze Java files for various quality checks.

Key features

Key features include MCP protocol integration, spell checking with codespell, Java linting with Checkstyle, lightweight Javadoc and naming checks via Python, and logging of debug messages to Claude’s debug window.

Where to use

Git Auto Coach MCP is primarily used in software development environments where Java code quality needs to be assessed, particularly in local Git repositories.

Content

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.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers