Skip to main content
Glama

Gradle MCP Server

by jermeyyy

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
GRADLE_WRAPPERNoPath to gradlew scriptauto-detected
GRADLE_PROJECT_ROOTNoPath to Gradle projectcurrent directory

Schema

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
list_projects

List all Gradle projects in the workspace.

Returns: List of Gradle projects.

list_project_tasks

List all tasks available in a Gradle project.

Args: project: Project path (e.g., ':app' or 'lib:module'). Use None, empty string, or ':' for root project. ctx: MCP Context.

Returns: List of available tasks in the project.

run_task

Run a Gradle task.

This tool cannot run cleaning tasks (clean, cleanBuild, etc.). Use the clean tool for cleaning tasks instead.

Args: task: Task name to run. Can be simple (e.g., 'build', 'test') for root project or qualified with project path (e.g., ':app:build', ':core:test'). args: Additional arguments to pass to Gradle (e.g., ['-x', 'test']).

Returns: TaskResult with success status and error message if failed.

Raises: ValueError: If the task is a cleaning task.

clean

Clean build artifacts for a Gradle project.

This is the only tool that should be used for cleaning tasks.

Args: project: Project path (e.g., ':app'). Use None, empty string, or ':' for root project.

Returns: TaskResult with success status and error message if failed.

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jermeyyy/gradle-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server