Gradle MCP
Gradle MCP server for agents: project map, task runs, tests, dependency audit, source search and a Kotlin REPL
- 68 ★ on the repository
- Last commit
- Apache-2.0
Extended access
Why this level
- Runs Gradle tasks and tests on your machine with your user's rights
- The Kotlin REPL executes code with the project's classes
Install
- Works in
Manual install
{
"mcpServers": {
"gradle": {
"command": "jbang",
"args": ["run", "--quiet", "--fresh", "gradle-mcp@rnett"]
}
}
}Needs jbang and JDK 21 or newer. For snapshots use gradle-mcp-snapshot@rnett.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Runs Gradle tasks and tests on your machine with your user's rights
- The Kotlin REPL executes code with the project's classes
This is third-party code. Review the repository files before installing.
What it does
gradle-mcp lets an agent work with a Gradle build without parsing terminal output. The tools show the structure of a multi-project build, tasks and properties, run builds in the background and return output only for the tasks you need. Tests run with a filter, and every test has logs and a stack trace. Other capabilities: search across dependency sources, the JDK standard library and Gradle itself, a persistent Kotlin REPL with the project's classes, rendering Compose UI to images for visual checks, Gradle documentation search and Develocity Build Scan publishing. Data formats are compact to save context. Five skills are built in: using-gradle, authoring-gradle-builds, advanced-gradle-dependencies, interacting-with-project-runtime and verifying-compose-ui. The server runs through jbang and needs JDK 21 or newer. The GRADLE_MCP_PROJECT_ROOT variable sets the default project root.
Who it is for. Kotlin and Java developers who build with Gradle and want Claude Code or Cursor to run tests and untangle dependencies themselves.
Good fit when
- Tests fail in a multi-module project and you need logs and stack traces for exactly the failing cases
- A dependency version conflict needs sorting out through variants and capabilities
- You need to see in a library's sources how a specific method works
- You want to try a piece of logic in a Kotlin REPL with the project's classpath without building the app
- A Compose component has to be rendered and viewed as an image
Not a fit when
- The machine has no JDK 21 or newer: the server will not start without it
- The project builds with Maven or Bazel: the server is built for Gradle
- You want source downloading and indexing as a separate service: the author is moving that part into a dedicated MCP or CLI
- Builds must not run on the agent's machine: the tools execute Gradle tasks
Example request
Run the :app module tests filtered to CheckoutTest and show the stack traces for the failuresMCP
- Transport
- stdio
- Authentication
- not required
Environment variables
GRADLE_MCP_PROJECT_ROOT- Default Gradle project root when a tool call omits projectRoot
Limitations
- A JDK 21 or newer is required, and jbang can install one.
- The author plans to move source downloading and indexing into a separate MCP or CLI.
- If errors come from Class Data Sharing because of native agents from security software, add --no-cds to the jbang command.
- Gradle tasks run on your machine with your user's rights.
- The server works with Gradle builds and does not replace Maven or Bazel. Snapshots run through a separate `gradle-mcp-snapshot@rnett` command.
How to disable. Remove the gradle block from mcpServers in the client config. The skills are bundled into the server and need no separate removal.
FAQ
How do I connect gradle-mcp to Claude Code or Cursor?
Add a gradle block to mcpServers with command jbang and args run, --quiet, --fresh, gradle-mcp@rnett. You need jbang and JDK 21 or newer. Snapshots run as gradle-mcp-snapshot@rnett.
What are the built-in skills?
Five guides inside the server: using-gradle for running and diagnosing, authoring-gradle-builds for editing builds, advanced-gradle-dependencies for complex dependencies, interacting-with-project-runtime for the Kotlin REPL and verifying-compose-ui for Compose checks.
What should I do about CDS errors?
Add --no-cds to the jbang command. Such errors come from native JVMTI agents of security software, for example SentinelOne.
What does the Kotlin REPL tool do?
It starts a persistent Kotlin session with the project's classes on the classpath. The agent tries utilities and APIs in it without building the whole app.
Can it preview Compose components?
Yes, the verifying-compose-ui skill renders Compose components to images from the project runtime for the agent's visual check.
Discussion
No questions or reviews yet.
Related
MCP serversA plugin with skills for building TypeScript MCP servers and MCP apps: the agent scaffolds, edits, debugs and verifies them
An MCP server that turns GitHub Projects v2 into a work queue for agents: they claim tasks, report progress and spend a budget.
A git MCP server with 28 tools: an agent clones, commits, branches, merges, rebases and manages worktrees in local repositories.
A Java build tool with an MCP mode: an agent compiles, tests and runs the project through its own build commands
add-mcp writes an MCP server into the configs of 25 agents with one command: Claude Code, Codex, Cursor, VS Code, Zed and more
MCP DevTools replaces a dozen MCP servers with one Go binary: search, page fetch, package documentation and GitHub.
README in short
The README lists the capabilities, the JDK 21 requirement, two ways to launch through jbang with ready client JSON and five built-in skills. Full documentation is on the project's site.