Get the FREE Ultimate OpenClaw Setup Guide →

gradle

A MCP server for Gradle.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio rnett-gradle-mcp jbang run --fresh dev.rnett.gradle-mcp:gradle-mcp:+ stdio

How to use

This MCP server exposes a Gradle-focused set of AI-assisted tools designed to help you introspect projects, run builds, and execute tests in a controlled, context-aware environment. The server runs via JBang and delegates tasks to the Gradle MCP agent, enabling capabilities such as examining dependencies, listing and inspecting project structure, launching Gradle tasks in the background, and running tests with access to full test outputs. You can use the included Agent Skills to guide automated workflows, inspect documentation, and manage JVM arguments, environment variables, and system properties for your Gradle builds. The tools are designed to be token-efficient and provide context-aware results suitable for conversational usage and autonomous agents.

To begin, start the MCP server using the provided command (via the Gradle MCP entry point). Once running, you can invoke Gradle-related commands and the integrated skills to run builds, troubleshoot failures, read documentation, and explore dependency sources. The environment is configurable, and you can source environment variables from your shell if needed, which is particularly useful on macOS where GUI launches may not inherit the right vars.

How to install

Prerequisites:

  • Java Development Kit 21 or higher
  • Internet access to fetch dependencies via JBang
  • A compatible shell to run the commands

Installation steps:

  1. Install JBang (if not already installed):
curl -s https://get.jbang.dev | bash
  1. Ensure JBang is in your PATH. You may need to restart your terminal or source your profile:
export PATH="$HOME/.local/bin:$PATH"
  1. Run the MCP Gradle server using the instruction from the README:
jbang run --fresh dev.rnett.gradle-mcp:gradle-mcp:+ stdio
  1. Confirm the server is up by invoking a Gradle-related command through the MCP interface or by checking for logs in the console output.

If you already have a Gradle project, you can optionally set GRADLE_MCP_PROJECT_ROOT to point to that project root to streamline default behavior.

Additional notes

Tips and caveats:

  • JDK 21+ is required to run gradle-mcp. If you encounter issues with Java versions, verify your JAVA_HOME and your PATH are pointing to a JDK 21+ distribution.
  • The server supports sourcing environment variables from your shell; leverage this to ensure Gradle builds receive the appropriate settings, especially on macOS where GUI apps may not inherit environment settings.
  • If you previously indexed Gradle documentation and need to refresh or adjust the best-practices tag, you may need to clear the documentation cache as described in the Troubleshooting section of the project documentation.
  • The MCP tools provide access to full test output and dependencies. Use these capabilities to diagnose build failures, inspect dependency trees, and explore Gradle’s behavior in your project context.

Related MCP Servers

Sponsor this space

Reach thousands of developers