Gradle MCP logo

Gradle MCP

Explore Gradle projects, run and diagnose tasks, audit dependencies, search sources, and inspect JVM behavior through MCP.

Install Gradle MCP

Run the project’s own setup commands, in order.

Setup steps from the project

gradle-mcp installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Start the server
    jbang run --quiet --fresh gradle-mcp@rnett
    
  2. 2. Start the server
    jbang run --quiet --fresh gradle-mcp-snapshot@rnett
    
  3. 3. Start the server
    jbang run --fresh dev.rnett.gradle-mcp:gradle-mcp:+
    

Overview

gradle-mcp connects AI agents to Gradle projects through tools for project mapping, task execution, testing, dependency auditing, and JVM interaction. It can run builds in the background, monitor progress, capture focused output, and expose logs and stack traces for filtered tests. Additional capabilities include indexed Gradle documentation and source search, a persistent Kotlin REPL, Compose UI rendering, and Develocity Build Scan publishing. Reach for it when an agent needs to inspect or operate an existing Gradle build rather than only edit its files.

Use cases

  • Map a multi-project Gradle build and inspect its tasks
  • Run filtered tests and diagnose stack traces
  • Audit dependency variants, capabilities, and repositories
  • Evaluate project code in a persistent Kotlin REPL
  • Render Compose UI components for visual review

Key features

  • Multi-project Gradle mapping
  • Background task execution with focused output
  • Filtered test diagnostics
  • Dependency and source search
  • Persistent Kotlin REPL
  • Compose previews and Develocity Build Scans

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

15/15 checks healthy over the last 36d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars70Stargazers on the source repository.
Last commitTodayMost recent push to the default branch.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Gradle MCP works

What gradle-mcp does

gradle-mcp gives MCP-compatible AI clients access to Gradle project workflows and JVM-based project behavior.

The server also includes workflow guidance called Agent Skills. These cover inspecting and diagnosing builds, authoring Gradle build definitions, resolving advanced dependency problems, interacting with project runtime code through Kotlin, and checking Compose UI output visually.

How it works

The server runs as a JBang-launched JVM process and communicates with an MCP client over its standard input and output. Tool calls can target a project root directly; when a call omits that value, GRADLE_MCP_PROJECT_ROOT can provide the default root.

Task execution supports background builds, progress monitoring, selected output capture, environment control, and shell-environment sourcing. Test operations can filter suites and expose detailed logs and stack traces. A persistent Kotlin REPL uses the project classpath, allowing an agent to evaluate project utilities and inspect APIs across multiple interactions.

Compose UI tools render components from the project runtime into images for visual review. Develocity integration lets an agent publish Build Scans for build troubleshooting. Compact response formats help reduce context usage during these operations.

Setup and configuration

JDK 21 or newer is required. The recommended launch method uses JBang with the release alias:

shell
jbang run --quiet --fresh gradle-mcp@rnett

An MCP client can register the same command with run, --quiet, --fresh, and gradle-mcp@rnett as its arguments. Snapshot builds are available through gradle-mcp-snapshot@rnett. The artifact can also be invoked directly by GAV:

shell
jbang run --fresh dev.rnett.gradle-mcp:gradle-mcp:+

Set GRADLE_MCP_PROJECT_ROOT when the default project directory should be supplied automatically for calls that do not include projectRoot. If class-data-sharing errors occur because of a native JVMTI agent, adding --no-cds to the JBang command can disable CDS.

Tools and capabilities

  • Map multi-project structures, modules, tasks, and properties.
  • Run Gradle tasks with background monitoring and focused output.
  • Execute filtered tests with logs and stack traces.
  • Search dependency, JDK, Gradle, and related source code.
  • Inspect and audit dependencies, including complex variant and capability issues.
  • Evaluate project code in a persistent Kotlin REPL.
  • Render Compose UI components to images.
  • Search Gradle User Guides and DSL references.
  • Publish Develocity Build Scans for troubleshooting.

The included skills provide structured guidance for using these capabilities and for modifying Gradle builds, project wiring, dependencies, and toolchains.

Limitations and notes

JDK 21 or later is needed to run the server. Source downloading and indexing functionality is planned to move to a separate MCP or CLI, so those capabilities should not be treated as the long-term focus of gradle-mcp. The server operates on Gradle and JVM project workflows; its most useful functions require access to the target project's files, runtime, and build environment.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Gradle MCP

gradle-mcp is an MCP server that connects AI agents to Gradle projects and JVM runtimes. Its main tools map projects, run tasks and filtered tests, audit dependencies, search Gradle and source code, use a persistent Kotlin REPL, render Compose UI, and publish Develocity Build Scans for troubleshooting.

Install JBang and run gradle-mcp with JDK 21 or newer. Use `jbang run --quiet --fresh gradle-mcp@rnett` for the release alias, or invoke `dev.rnett.gradle-mcp:gradle-mcp:+` directly. The same command and arguments can be added to an MCP client's server configuration.

Set `GRADLE_MCP_PROJECT_ROOT` to the Gradle project directory. Tool calls that omit `projectRoot` then use that directory as their default project root.

gradle-mcp requires JDK 21 or newer. JBang can also help install or select JDK versions. If CDS-related startup errors occur because of a native JVMTI agent, add `--no-cds` to the JBang command.

Yes. Cursor can run gradle-mcp as a standard stdio MCP server using the JBang command shown in its MCP server configuration.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewGradle MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/gradle-mcp?style=directory)](https://allmcps.com/mcp/gradle-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/gradle-mcp"><img src="https://allmcps.com/api/badge/gradle-mcp?style=directory" alt="Gradle MCP on AllMCPs" /></a>