Sandbox
@rnett/gradle-mcp

MCP server for Gradle projects and agent workflows

Gradle MCP is a Model Context Protocol server that plugs into builders’ agents and gives them Gradle-aware tools. It supports project mapping, task execution, test inspection, dependency and source search, a persistent Kotlin REPL, Compose UI previews, and Gradle documentation lookup.

60 stars4 forksKotlinUpdated 10d ago
Who it's for

Builders who run Claude Code, Codex, Cursor, or any MCP-capable agent and want it to work with Gradle.

What it delivers

You can let your agent inspect, run, and debug Gradle builds with less manual context switching.

What it does

Project mapping

Explores multi-project builds, modules, tasks, and properties.

Background task execution

Runs Gradle tasks in the background, watches progress, and captures task output without extra noise.

Test diagnostics

Runs filtered test suites and returns logs and stack traces for individual failures.

Dependency and source search

Searches dependency sources, JDK standard library code, and Gradle source code.

Interactive Kotlin REPL

Keeps a persistent REPL connected to the project classpath for testing utilities and APIs.

Compose UI previews

Renders Compose UI components to images from the project runtime for visual checks.

Agent skills

Includes guided workflows like using-gradle, authoring-gradle-builds, and advanced-gradle-dependencies.

How to get it

  1. 1Use jbang
    # For releases
    jbang run --quiet --fresh gradle-mcp@rnett
    
    # For snapshots
    jbang run --quiet --fresh gradle-mcp-snapshot@rnett
  2. 2Alternatively, run the GAV directly
    jbang run --fresh dev.rnett.gradle-mcp:gradle-mcp:+

README

Maven Central Version Maven snapshots Documentation GitHub License Revved up by Develocity

Gradle MCP server

A Model Context Protocol (MCP) server for Gradle. It gives AI agents the tools they need to explore project structures, run tasks, audit dependencies, and interact with the JVM runtime.

Features

Source downloading and indexing tools will be moving to a dedicated MCP/cli soon.

  • Agent Skills: Built-in workflows that guide AI agents through complex Gradle tasks.
  • Project Mapping: Easily explore multi-project structures, modules, tasks, and properties.
  • Smart Task Execution: Run builds in the background, monitor progress, and capture specific task outputs without the noise. Supports advanced environment control and shell environment sourcing.
  • Advanced Testing: Run filtered test suites and get full access to logs and stack traces for every test case.
  • Dependency & Source Search: Search and browse dependency, JDK standard library, and Gradle source code.
  • Interactive Kotlin REPL: Test project utilities and explore APIs in a persistent REPL with access to all your classes.
  • Compose UI Previews: Render UI components directly to images from the project runtime for visual auditing.
  • Gradle Documentation: Instant access to searchable, indexed Gradle User Guides and DSL references.
  • Develocity Build Scans: Ask your agent to publishing of Build Scans for deep troubleshooting.
  • Token Optimized: Compact data formats designed to keep context usage low.

Configuration

The GRADLE_MCP_PROJECT_ROOT environment variable can provide the default Gradle project root when a tool call omits projectRoot.

Getting started

[!IMPORTANT] JDK 21 or higher is required to run gradle-mcp. You can use JBang to install JDKs too: docs.

Use jbang:

# For releases
jbang run --quiet --fresh gradle-mcp@rnett

# For snapshots
jbang run --quiet --fresh gradle-mcp-snapshot@rnett
{
  "mcpServers": {
    "gradle": {
      "command": "jbang",
      "args": [
        "run",
        "--quiet",
        "--fresh",
        "gradle-mcp@rnett"
      ]
    }
  }
}

Alternatively, run the GAV directly:

jbang run --fresh dev.rnett.gradle-mcp:gradle-mcp:+
{
  "mcpServers": {
    "gradle": {
      "command": "jbang",
      "args": [
        "run",
        "--fresh",
        "dev.rnett.gradle-mcp:gradle-mcp:+"
      ]
    }
  }
}

[!TIP] If you experience errors related to CDS (Class Data Sharing), typically caused by native JVMTI agents from security software (e.g., SentinelOne), you can disable it by adding --no-cds to the jbang command. See the documentation for more details.

Agent Skills

Agent Skills are specialized guides that help AI agents navigate common Gradle workflows reliably.

Included skills:

  • using-gradle: Inspect, run, and diagnose existing Gradle builds — project mapping, test diagnostics, dependency auditing, and source research.
  • authoring-gradle-builds: Modify build definitions, wiring, and project structure — dependency declarations, module creation, toolchain configuration, and best practices.
  • advanced-gradle-dependencies: Diagnose and resolve complex dependency issues involving variants, capabilities, verification, and repository governance.
  • interacting-with-project-runtime: Execute and verify project logic in real-time using a persistent Kotlin REPL with full classpath access.
  • verifying-compose-ui: Visually audit Compose UI components by rendering them to images from the project runtime.

For instructions on how to use these skills, see the Agent Skills documentation.

Files in the repo

Repository payload26 top-level entries
  • .air
  • .github
  • .idea
  • .junie
  • best-practices-generator
  • docs
  • gradle
  • openspec
  • repl-shared
  • repl-worker
  • src
  • .gitignore
  • AGENTS.md
  • build.gradle.kts
  • CLAUDE.md
  • context7.json
  • CONTRIBUTING.md
  • gradle.properties
  • gradlew
  • gradlew.bat
  • LICENSE
  • mkdocs.yml
  • README.md
  • roadmap.md
  • settings.gradle.kts
  • version.txt

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k
t8y2/dbxConnectors

20 MB lightweight cross-platform database client for 90+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 90+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP Server。

19k