trackmcp
Back to directory
IlyaGulya

gradle-mcp-server

View on GitHub

A Model Context Protocol (MCP) server to enable AI tools to interact with Gradle projects programmatically.

36 stars KotlinAI & Machine Learning Updated Oct 20, 2025

Documentation

⚠️ Deprecation

This project is no longer maintained. Please use gradle-mcp instead.

Gradle MCP Server

A Model Context Protocol (MCP) server that enables AI tools to interact with Gradle projects programmatically. It uses the Gradle Tooling API to query project information and execute tasks.

Features

Provides tools for:

  • Inspecting Projects: Retrieve detailed, structured information about a Gradle project, including:
    • Executing Tasks: Run specific Gradle tasks (e.g., `clean`, `build`, `assemble`) with custom arguments, JVM arguments, and environment variables. Returns formatted text output including stdout/stderr and status.
    • Running Tests Hierarchically: Execute Gradle test tasks (e.g., `test`) and receive detailed, structured results in a hierarchical JSON format (Suite -> Class -> Method). Includes:

      Requirements

      • JDK 17 or higher
      • For command-line installation:

        Installation

        This method downloads the server JAR to a standard location in your home directory.

        Linux / macOS (requires `curl`):

        bash
        # Downloads gradle-mcp-server-all.jar to ~/mcp-servers/gradle-mcp-server/
        TARGET_DIR="$HOME/mcp-servers/gradle-mcp-server" && mkdir -p "$TARGET_DIR" && curl -fSL -o "$TARGET_DIR/gradle-mcp-server-all.jar" "https://github.com/IlyaGulya/gradle-mcp-server/releases/latest/download/gradle-mcp-server-all.jar" && echo "Downloaded to '$TARGET_DIR'." || echo "Download failed."

        Windows (PowerShell 5+):

        powershell
        # Downloads gradle-mcp-server-all.jar to %USERPROFILE%\mcp-servers\gradle-mcp-server\
        $targetDir = Join-Path $env:USERPROFILE "mcp-servers\gradle-mcp-server"; if (-not (Test-Path $targetDir)) { New-Item -ItemType Directory -Path $targetDir -Force | Out-Null }; $outFile = Join-Path $targetDir "gradle-mcp-server-all.jar"; Write-Host "Downloading..."; Invoke-WebRequest -Uri "https://github.com/IlyaGulya/gradle-mcp-server/releases/latest/download/gradle-mcp-server-all.jar" -OutFile $outFile -ErrorAction Stop; Write-Host "Downloaded to '$targetDir'."

        Alternative Method: Manual Download

        1. Go to the GitHub Releases page.

        2. Download the `gradle-mcp-server-all.jar` asset from the latest release.

        3. Save the downloaded JAR file to a stable location. We recommend:

          (Create the directory if it doesn't exist).

          MCP Client Configuration

          To use this server with an MCP client (like the VSCode extension or Claude Desktop app), you need to add its configuration to the client's settings file.

          1. Locate the settings file:

            2. Add the server configuration: Edit the JSON file and add the following entry inside the `mcpServers` object. Replace `` with the actual absolute path to your home directory.

            json
            {
                  "mcpServers": {
                    "gradle-mcp-server": {
                      "command": "java",
                      "args": [
                        "-jar",
                        "/mcp-servers/gradle-mcp-server/gradle-mcp-server-all.jar"
                      ],
                      "env": {},
                      "disabled": false,
                      "autoApprove": []
                    }
                  }
                }

            Usage

            1. After adding the configuration, restart your MCP client (e.g., reload the VSCode window or restart the Claude app).

            2. The "Gradle MCP Server" and its tools (listed below) should now be available for use within the client. The server runs automatically via stdio when needed by the client.

            Available Tools

            The server exposes the following tools via the Model Context Protocol:

            1. `get_gradle_project_info`

              2. `execute_gradle_task`

                3. `run_gradle_tests`

                  Development

                  Building from Source

                  If you want to build the server yourself:

                  1. Clone the repository.

                  2. Ensure you have JDK 17 or higher installed.

                  3. Run the build command:

                  bash
                  ./gradlew shadowJar

                  4. The self-contained JAR (`gradle-mcp-server--all.jar`) will be created in the `build/libs/` directory. You can then configure your MCP client to use this JAR (remember to use the correct absolute path and version in the configuration).

                  Running Locally (for Testing)

                  You can run the built JAR directly from the command line for testing purposes. The server communicates over stdio by default.

                  bash
                  # Run the packaged JAR in stdio mode
                  java -jar build/libs/gradle-mcp-server--all.jar
                  
                  # Run with specific arguments (see Configuration section)
                  java -jar build/libs/gradle-mcp-server--all.jar --sse 8080 --debug

                  Configuration (Command-Line Arguments)

                  When running the server JAR directly (primarily for testing/development), its behavior can be controlled via command-line arguments:

                  • `--stdio`: (Default) Use standard input/output for MCP communication.
                  • `--sse [port]`: Run as an SSE server on the specified `port` (defaults to 3001 if port is omitted). Connect MCP clients (like the Anthropic Console Inspector) to `http://localhost:/sse`.
                  • `--debug`: Enable verbose logging on the server console.

                  Dependencies

                  Frequently asked questions

                  What is gradle-mcp-server?

                  gradle-mcp-server is A Model Context Protocol (MCP) server to enable AI tools to interact with Gradle projects programmatically.

                  How do I install gradle-mcp-server?

                  Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

                  Is gradle-mcp-server open source?

                  Yes — it is hosted on GitHub at https://github.com/IlyaGulya/gradle-mcp-server and has 36 stars.

                  Related MCP tools

                  Run your own MCP server? See who uses it and what to fix.

                  Measure it with TrackMCP