gradle-mcp-server
A Model Context Protocol (MCP) server to enable AI tools to interact with Gradle projects programmatically.
Documentation
⚠️ Deprecation
This project is no longer maintained. Please use gradle-mcp instead.
Gradle MCP Server
A Model Context Protocol (MCP) server that enables AI tools to interact with Gradle projects programmatically. It uses the Gradle Tooling API to query project information and execute tasks.
Features
Provides tools for:
- Inspecting Projects: Retrieve detailed, structured information about a Gradle project, including:
- Executing Tasks: Run specific Gradle tasks (e.g., `clean`, `build`, `assemble`) with custom arguments, JVM arguments, and environment variables. Returns formatted text output including stdout/stderr and status.
- Running Tests Hierarchically: Execute Gradle test tasks (e.g., `test`) and receive detailed, structured results in a hierarchical JSON format (Suite -> Class -> Method). Includes:
Requirements
- JDK 17 or higher
- For command-line installation:
Installation
Recommended Method: Command-Line Download
This method downloads the server JAR to a standard location in your home directory.
Linux / macOS (requires `curl`):
# Downloads gradle-mcp-server-all.jar to ~/mcp-servers/gradle-mcp-server/
TARGET_DIR="$HOME/mcp-servers/gradle-mcp-server" && mkdir -p "$TARGET_DIR" && curl -fSL -o "$TARGET_DIR/gradle-mcp-server-all.jar" "https://github.com/IlyaGulya/gradle-mcp-server/releases/latest/download/gradle-mcp-server-all.jar" && echo "Downloaded to '$TARGET_DIR'." || echo "Download failed."Windows (PowerShell 5+):
# Downloads gradle-mcp-server-all.jar to %USERPROFILE%\mcp-servers\gradle-mcp-server\
$targetDir = Join-Path $env:USERPROFILE "mcp-servers\gradle-mcp-server"; if (-not (Test-Path $targetDir)) { New-Item -ItemType Directory -Path $targetDir -Force | Out-Null }; $outFile = Join-Path $targetDir "gradle-mcp-server-all.jar"; Write-Host "Downloading..."; Invoke-WebRequest -Uri "https://github.com/IlyaGulya/gradle-mcp-server/releases/latest/download/gradle-mcp-server-all.jar" -OutFile $outFile -ErrorAction Stop; Write-Host "Downloaded to '$targetDir'."Alternative Method: Manual Download
1. Go to the GitHub Releases page.
2. Download the `gradle-mcp-server-all.jar` asset from the latest release.
3. Save the downloaded JAR file to a stable location. We recommend:
(Create the directory if it doesn't exist).
MCP Client Configuration
To use this server with an MCP client (like the VSCode extension or Claude Desktop app), you need to add its configuration to the client's settings file.
1. Locate the settings file:
2. Add the server configuration: Edit the JSON file and add the following entry inside the `mcpServers` object. Replace `` with the actual absolute path to your home directory.
{
"mcpServers": {
"gradle-mcp-server": {
"command": "java",
"args": [
"-jar",
"/mcp-servers/gradle-mcp-server/gradle-mcp-server-all.jar"
],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}Usage
1. After adding the configuration, restart your MCP client (e.g., reload the VSCode window or restart the Claude app).
2. The "Gradle MCP Server" and its tools (listed below) should now be available for use within the client. The server runs automatically via stdio when needed by the client.
Available Tools
The server exposes the following tools via the Model Context Protocol:
1. `get_gradle_project_info`
2. `execute_gradle_task`
3. `run_gradle_tests`
Development
Building from Source
If you want to build the server yourself:
1. Clone the repository.
2. Ensure you have JDK 17 or higher installed.
3. Run the build command:
./gradlew shadowJar4. The self-contained JAR (`gradle-mcp-server--all.jar`) will be created in the `build/libs/` directory. You can then configure your MCP client to use this JAR (remember to use the correct absolute path and version in the configuration).
Running Locally (for Testing)
You can run the built JAR directly from the command line for testing purposes. The server communicates over stdio by default.
# Run the packaged JAR in stdio mode
java -jar build/libs/gradle-mcp-server--all.jar
# Run with specific arguments (see Configuration section)
java -jar build/libs/gradle-mcp-server--all.jar --sse 8080 --debugConfiguration (Command-Line Arguments)
When running the server JAR directly (primarily for testing/development), its behavior can be controlled via command-line arguments:
- `--stdio`: (Default) Use standard input/output for MCP communication.
- `--sse [port]`: Run as an SSE server on the specified `port` (defaults to 3001 if port is omitted). Connect MCP clients (like the Anthropic Console Inspector) to `http://localhost:/sse`.
- `--debug`: Enable verbose logging on the server console.
Dependencies
- Gradle Tooling API (Version specified in `build.gradle.kts`)
- Anthropic MCP Kotlin SDK
- Ktor (for SSE server mode)
- Logback (for logging)
Frequently asked questions
What is gradle-mcp-server?
gradle-mcp-server is A Model Context Protocol (MCP) server to enable AI tools to interact with Gradle projects programmatically.
How do I install gradle-mcp-server?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is gradle-mcp-server open source?
Yes — it is hosted on GitHub at https://github.com/IlyaGulya/gradle-mcp-server and has 36 stars.
Related MCP tools
The official Kotlin SDK for Model Context Protocol servers and clients. Maintained in collaboration with JetBrains Trusted by 1100+ developers.
Kotlin Multiplatform sample with SwiftUI, Jetpack Compose, Compose for Wear, Compose for Desktop, and Compose for Web clients along with Ktor backend.
🙌 OpenHands: Code Less, Make More for the Model Context Protocol. Enhance AI assistants with powerful integrations. Python-based implementation.
The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, No-code agent builder, MCP compatibility, and more.
Universal memory layer for AI Agents; Announcing OpenMemory MCP - local and secure memory management. Python-based implementation.
基于大模型搭建的聊天机器人,同时支持 微信公众号、企业微信应用、飞书、钉钉 等接入,可选择ChatGPT/Claude/DeepSeek/文心一言/讯飞星火/通义千问/ Gemini/GLM-4/Kimi/LinkAI,能处理文本、语音和图片,访问操作系统和互联网,支持基于自有知识库进行定制企业智能客服。
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP