# gradle-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/rnett/gradle-mcp  
**GitHub Stars:** 70  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/gradle-mcp

## Description
A comprehensive MCP server for Gradle.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/rnett/gradle-mcp), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Start the server:

```sh
jbang run --quiet --fresh gradle-mcp@rnett
```

2. Start the server:

```sh
jbang run --quiet --fresh gradle-mcp-snapshot@rnett
```

3. Start the server:

```sh
jbang run --fresh dev.rnett.gradle-mcp:gradle-mcp:+
```

## Documentation

## What gradle-mcp does

gradle-mcp exposes Gradle project operations through the Model Context Protocol. It is designed for agents working with JVM and Gradle codebases, including multi-project builds with multiple modules, tasks, and project properties.

The server covers both inspection and execution. An agent can map a project, examine its tasks and properties, run builds in the background, follow progress, and retrieve selected task output without retaining every build message in context. It also supports filtered test runs with access to per-test logs and stack traces.

Dependency work is another central use case. Agents can audit dependencies and search dependency sources, JDK standard-library code, Gradle source code, and indexed Gradle User Guides and DSL references. Runtime-oriented capabilities include a persistent Kotlin REPL with access to project classes and Compose UI rendering to images for visual checks.

Built-in Agent Skills provide workflow guidance for common activities such as inspecting and diagnosing builds, authoring build definitions, resolving advanced dependency issues, interacting with project runtime code, and verifying Compose UI.

## How it works

The server runs as a JBang-launched JVM application and communicates with an MCP client over its configured standard-input and standard-output process. A client starts the application using either the `gradle-mcp@rnett` JBang alias or the Maven coordinate `dev.rnett.gradle-mcp:gradle-mcp:+`.

Most project-related operations accept a project root. When a call leaves that value out, `GRADLE_MCP_PROJECT_ROOT` can provide the default root. Task execution includes background operation and progress monitoring, while test operations support filtering and detailed diagnostic output.

The Kotlin REPL remains available across interactions, allowing an agent to evaluate project utilities and APIs with the project classpath. Compose preview rendering runs UI components from the project runtime and produces images for review. Develocity Build Scan support lets an agent request publication of scans for build troubleshooting.

## Setup and configuration

JDK 21 or newer is required. Install JBang, then configure an MCP client to launch one of these commands:

```json
{
  "mcpServers": {
    "gradle": {
      "command": "jbang",
      "args": [
        "run",
        "--quiet",
        "--fresh",
        "gradle-mcp@rnett"
      ]
    }
  }
}
```

The snapshot alias is `gradle-mcp-snapshot@rnett`. The application can also be started directly from its Maven coordinate with JBang. Set `GRADLE_MCP_PROJECT_ROOT` when a default project directory is useful. On systems where security software installs native JVMTI agents, adding `--no-cds` to the JBang command can address Class Data Sharing startup errors.

## Tools and capabilities

- Map projects, modules, tasks, and properties in multi-project Gradle builds.
- Run tasks in the background, monitor progress, and collect targeted output.
- Execute filtered tests with logs and stack traces for individual test cases.
- Audit dependencies and search dependency, JDK, Gradle, and documentation sources.
- Use a persistent Kotlin REPL with access to project classes and APIs.
- Render Compose UI components to images from the project runtime.
- Publish Develocity Build Scans for troubleshooting.
- Apply built-in skills for build inspection, build authoring, dependency diagnosis, runtime interaction, and Compose verification.

## Limitations and notes

Source downloading and indexing capabilities are planned to move to a separate MCP or CLI project. The server requires JDK 21 or later, and its project operations depend on access to the relevant Gradle project and runtime. Compose preview workflows apply to Compose UI components, while Develocity Build Scan workflows depend on the project’s use of that service.

_Full upstream README: https://allmcps.com/mcp/gradle-mcp/readme_

