### Create and Configure File Tree (Groovy) Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/dsl/org.gradle.api.Project.md.txt Creates a lazy and live `ConfigurableFileTree` starting from a base directory. The file tree can be configured using include/exclude patterns and task dependencies. The example demonstrates setting up a file tree for Java files and using it in a Copy task. ```groovy def myTree = fileTree('src') myTree.include '**/*.java' myTree.builtBy 'someTask' task copy(type: Copy) { from myTree } ``` -------------------------------- ### Example MCP Configuration (Bash -c) Source: https://github.com/rnett/gradle-mcp/blob/main/docs/index.md A JSON configuration example for running 'gradle-mcp' using 'bash -c', which is useful for more complex command execution scenarios. ```json { "mcpServers": { "gradle": { "command": "bash -c", "args": [ "jbang run --quiet --fresh gradle-mcp@rnett" ] } } } ``` -------------------------------- ### Start and Run REPL Session Source: https://github.com/rnett/gradle-mcp/blob/main/src/main/skills/interacting_with_project_runtime/SKILL.md Use the 'start' command to initialize a REPL session for a specific project path and source set. Then, use the 'run' command to execute arbitrary code within that session. ```json { "command": "start", "projectPath": ":my-project", "sourceSet": "main" } ``` ```kotlin import com.example.utils.MyHelper MyHelper.calculateSum(1, 2) ``` -------------------------------- ### Install Gradle MCP Skills using Context7 CLI Source: https://github.com/rnett/gradle-mcp/blob/main/docs/skills.md Use this command to install all Gradle MCP skills via the Context7 CLI. Ensure you have Node.js and npm installed. ```shell npx ctx7 skills install /rnett/gradle-mcp --all ``` -------------------------------- ### Search Gradle User Guide Source: https://github.com/rnett/gradle-mcp/blob/main/src/main/skills/gradle/references/gradle_docs_research.md Use this snippet to search the Gradle User Guide for specific topics. Ensure the `projectRoot` is correctly set. ```json { "query": "tag:userguide working with files", "projectRoot": "/absolute/path/to/project" } ``` -------------------------------- ### Start a dev server and wait for readiness Source: https://github.com/rnett/gradle-mcp/blob/main/src/main/skills/gradle/SKILL.md Start a Gradle task, such as 'bootRun', in the background and then wait for a specific readiness signal. This is useful for managing development servers. ```json // Step 1: Start the server in the background { "commandLine": [":app:bootRun"], "background": true } ``` ```json // Step 2: Wait for readiness signal { "buildId": "build_123", "timeout": 60, "waitFor": "Started Application" } ``` -------------------------------- ### Install Gradle Skills Input Schema Source: https://github.com/rnett/gradle-mcp/blob/main/docs/tools/SKILL_TOOLS.md Defines the required directory path and optional replacement flag for installing Gradle skills. ```json { "properties": { "directory": { "type": "string", "description": "Providing the absolute path to the authoritative skill installation directory." }, "replaceOld": { "type": "boolean", "description": "Replaces existing skills from this MCP server in the target directory." } }, "required": [ "directory" ], "type": "object" } ``` -------------------------------- ### Start Kotlin REPL Session Source: https://github.com/rnett/gradle-mcp/blob/main/docs/tools/REPL_TOOLS.md Initializes a Kotlin REPL session. Requires `projectPath` and `sourceSet`. After modifying project source code, `stop` then `start` to pick up classpath changes. ```json { "command": "start", "projectPath": ":app", "sourceSet": "main" } ``` -------------------------------- ### Install Gradle MCP with JBang (Snapshots) Source: https://github.com/rnett/gradle-mcp/blob/main/README.md Use this command to install and run the latest snapshot version of the Gradle MCP server using JBang. ```shell jbang run --quiet --fresh gradle-mcp-snapshot@rnett ``` -------------------------------- ### Example: Synchronize directories using Gradle sync method Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/dsl/org.gradle.api.Project.md.txt Provides an example of using the project.sync method to copy files from a source directory to a destination directory. It illustrates the basic usage of specifying 'from' and 'into' clauses. Dependencies: Gradle project object, sync method. Input: Source directory path, destination directory path. Output: Files copied to the destination directory. ```groovy project.sync { from 'my/shared/dependencyDir' into 'build/deps/compile' } ``` -------------------------------- ### Install Gradle MCP with JBang (Releases) Source: https://github.com/rnett/gradle-mcp/blob/main/README.md Use this command to install and run the latest stable release of the Gradle MCP server using JBang. ```shell jbang run --quiet --fresh gradle-mcp@rnett ``` -------------------------------- ### GET /project Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/javadoc/org/gradle/api/Project.md.txt Locates a project by its path and allows for configuration via actions or closures. ```APIDOC ## GET /project ### Description Locates a project by path and optionally configures it using a closure or action. ### Method GET ### Endpoint /project ### Parameters #### Query Parameters - **path** (String) - Required - The path of the project to locate. ### Response #### Success Response (200) - **project** (Project) - The located project object. ``` -------------------------------- ### Install Gradle MCP Directly (Releases) Source: https://github.com/rnett/gradle-mcp/blob/main/README.md Run the Gradle MCP server by specifying its GAV coordinates directly with JBang, using '+' for the latest version. ```shell jbang run --fresh dev.rnett.gradle-mcp:gradle-mcp:+ ``` -------------------------------- ### Search Gradle Documentation for Specific Guidance Source: https://github.com/rnett/gradle-mcp/blob/main/src/main/skills/gradle/references/best_practices.md Use `gradle_docs` with a query to search for specific guidance, like performance best practices, within the user guide. ```json { "query": "tag:userguide performance best practices", "projectRoot": "/absolute/path/to/project" } ``` -------------------------------- ### GET /build/environment Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/javadoc/allclasses-index.md.txt Retrieves information about the current Gradle build environment, including version and Java home. ```APIDOC ## GET /build/environment ### Description Provides details about the build environment, such as the Gradle version and the Java home directory currently in use. ### Method GET ### Endpoint /build/environment ### Response #### Success Response (200) - **gradleVersion** (string) - The version of Gradle being used - **javaHome** (string) - The path to the Java home directory #### Response Example { "gradleVersion": "8.5", "javaHome": "/usr/lib/jvm/java-17-openjdk" } ``` -------------------------------- ### Create a new sub-project module Source: https://github.com/rnett/gradle-mcp/blob/main/src/main/skills/gradle/SKILL.md Create the standard directory structure for a new Kotlin JVM project within a subproject using a shell command. This example uses PowerShell syntax. ```json { "command": "New-Item -ItemType Directory -Force -Path subproject/src/main/kotlin" } ``` -------------------------------- ### POST install_gradle_skills Source: https://github.com/rnett/gradle-mcp/blob/main/docs/tools/SKILL_TOOLS.md Installs or updates official Gradle MCP skills into the agent's skill directory. ```APIDOC ## POST install_gradle_skills ### Description Installs or updates the official Gradle MCP skills into the agent's skill directory. Skills are extracted as SKILL.md files into named subdirectories. ### Method POST ### Endpoint install_gradle_skills ### Parameters #### Request Body - **directory** (string) - Required - The absolute path to the authoritative skill installation directory. - **replaceOld** (boolean) - Optional - Replaces existing skills from this MCP server in the target directory (default: true). ### Request Example { "directory": "~/.agents/skills", "replaceOld": true } ``` -------------------------------- ### Start and Monitor Continuous Gradle Build Source: https://github.com/rnett/gradle-mcp/blob/main/src/main/skills/gradle/references/background_monitoring.md Initiate a continuous Gradle build in the background and then wait for the initial build to complete. The `waitFor` pattern is set to 'Waiting for changes' for continuous builds. ```json // Start the build { "commandLine": ["build", "--continuous"], "background": true } ``` ```json // Wait for the first build to finish { "buildId": "BUILD_ID", "timeout": 120, "waitFor": "Waiting for changes" } ``` -------------------------------- ### Research Gradle Documentation Source: https://github.com/rnett/gradle-mcp/blob/main/src/main/skills/gradle/SKILL.md Search the Gradle user guide, DSL reference, release notes, best practices, samples, and Javadocs using the `gradle_docs` helper function. ```kotlin gradle_docs(query="tag:userguide ", projectRoot="/path/to/project") ``` ```kotlin gradle_docs(path="dsl/org.gradle.api.Project.html", projectRoot="/path/to/project") ``` ```kotlin gradle_docs(query="tag:release-notes", version="8.6") ``` ```kotlin gradle_docs(query="tag:best-practices dependency management", projectRoot="/path/to/project") ``` ```kotlin gradle_docs(query="tag:samples toolchains", projectRoot="/path/to/project") ``` ```kotlin gradle_docs(query="tag:javadoc Project", projectRoot="/path/to/project") ``` -------------------------------- ### Display Task-Specific Help Source: https://github.com/rnett/gradle-mcp/blob/main/src/main/skills/gradle/references/diagnostic_tasks.md The `help` task provides global or task-specific assistance. Use it with the `--task` option to get detailed information about a particular task. ```gradle gradle(commandLine=[":help", "--task", "test"], captureTaskOutput=":help") ``` -------------------------------- ### Filter Update Versions Source: https://github.com/rnett/gradle-mcp/blob/main/docs/tools/PROJECT_DEPENDENCY_TOOLS.md Use a regex filter for considered update versions, for example, to match versions starting with '1.'. ```bash ./gradlew inspect_dependencies --versionFilter="^1\." ``` -------------------------------- ### Install Gradle MCP as a Command Source: https://github.com/rnett/gradle-mcp/blob/main/docs/index.md Installs gradle-mcp as a system command using jbang's app installation feature. This allows running 'gradle-mcp' directly from the terminal. ```shell jbang app setup jbang app install --name gradle-mcp dev.rnett.gradle-mcp:gradle-mcp:+ ``` -------------------------------- ### Create FileTree with Map Arguments (Groovy) Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/javadoc/org/gradle/api/Project.md.txt Demonstrates creating a file tree using a map of arguments, specifying the directory and exclusion patterns directly. This is a concise way to configure basic file tree properties. The resulting file tree is lazy and live. ```groovy def myTree = fileTree(dir:'src', excludes:['**/ignore/**', '**/.data/**']) task copy(type: Copy) { from myTree } ``` -------------------------------- ### Create and Configure FileTree with Include Pattern (Groovy) Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/javadoc/org/gradle/api/Project.md.txt Demonstrates creating a lazy and live file tree from the 'src' directory and including only Java files. The file tree is configured to be built by 'someTask'. This is useful for tasks that need to process specific file types within a directory structure. ```groovy def myTree = fileTree("src") myTree.include "**/*.java" myTree.builtBy "someTask" task copy(type: Copy) { from myTree } ``` -------------------------------- ### Configure All Projects in Gradle Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/javadoc/org/gradle/api/Project.md.txt Illustrates how to configure the current project and all its subprojects in Gradle. This is achieved using either an Action or a Closure, enabling consistent configuration across the entire project hierarchy. ```gradle void allprojects ([Action] action) //Configures this project and each of its sub-projects. void allprojects ([@DelegatesTo](https://docs.groovy-lang.org/docs/groovy-4.0.29/html/gapi/groovy/lang/DelegatesTo.html)([Project.class]) [Closure] configureClosure) //Configures this project and each of its sub-projects. ``` -------------------------------- ### Gradle Build Script Examples (Kotlin, Groovy) Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-html-samples/samples/sample_building_java_applications.html Demonstrates common Gradle build script configurations using both Kotlin DSL and Groovy DSL. This allows users to view and compare implementations across the two languages. The selection is persisted using local storage. ```javascript function postProcessCodeBlocks() { // Assumptions: // 1) All siblings that are marked with class="multi-language-sample" should be grouped // 2) Only one language can be selected per domain (to allow selection to persist across all docs pages) // 3) There is exactly 1 small set of languages to choose from. This does not allow for multiple language preferences. For example, users cannot prefer both Kotlin and ZSH. // 4) Only 1 sample of each language can exist in the same collection. var GRADLE_DSLs = ["kotlin", "groovy"]; var preferredBuildScriptLanguage = initPreferredBuildScriptLanguage(); // Ensure preferred DSL is valid, defaulting to Kotlin DSL function initPreferredBuildScriptLanguage() { var lang = window.localStorage.getItem("preferred-gradle-dsl"); if (GRADLE_DSLs.indexOf(lang) === -1) { window.localStorage.setItem("preferred-gradle-dsl", "kotlin"); lang = "kotlin"; } return lang; } function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } function processSampleEl(sampleEl, prefLangId) { var codeEl = sampleEl.querySelector("code[data-lang]"); if (codeEl != null) { sampleEl.setAttribute("data-lang", codeEl.getAttribute("data-lang")); if (codeEl.getAttribute("data-lang") !== prefLangId) { sampleEl.classList.add("hidden"); } else { sampleEl.classList.remove("hidden"); } } } function switchSampleLanguage(languageId) { var multiLanguageSampleElements = [].slice.call( document.querySelectorAll(".multi-language-sample") ); // Array of Arrays, each top-level array representing a single collection of samples var multiLanguageSets = []; for (var i = 0; i < multiLanguageSampleElements.length; i++) { var currentCollection = [multiLanguageSampleElements[i]]; var currentSampleElement = multiLanguageSampleElements[i]; processSampleEl(currentSampleElement, languageId); while ( currentSampleElement.nextElementSibling != null && currentSampleElement.nextElementSibling.classList.contains( "multi-language-sample" ) ) { currentCollection.push(currentSampleElement.nextElementSibling); currentSampleElement = currentSampleElement.nextElementSibling; processSampleEl(currentSampleElement, languageId); i++; } multiLanguageSets.push(currentCollection); } multiLanguageSets.forEach(function (sampleCollection) { // Create selector element if not existing if ( sampleCollection.length > 1 && ( sampleCollection[0].previousElementSibling == null || !sampleCollection[0].previousElementSibling.classList.contains( "multi-language-selector" ) ) ) { var languageSelectorFragment = document.createDocumentFragment(); var multiLanguageSelectorElement = document.createElement("div"); multiLanguageSelectorElement.classList.add("multi-language-selector"); languageSelectorFragment.appendChild(multiLanguageSelectorElement); sampleCollection.forEach(function (sampleEl) { var optionEl = document.createElement("code"); var sampleLanguage = sampleEl.getAttribute("data-lang"); optionEl.setAttribute("data-lang", sampleLanguage); optionEl.setAttribute("role", "button"); optionEl.classList.add("language-option"); optionEl.innerText = capitalizeFirstLetter(sampleLanguage); optionEl.addEventListener( "click", function updatePreferredLanguage(evt) { var preferredLanguageId = optionEl.getAttribute("data-lang"); window.localStorage.setItem( "preferred-gradle-dsl", preferredLanguageId ); // Record how far } ); multiLanguageSelectorElement.appendChild(optionEl); }); sampleCollection[0].parentNode.insertBefore( languageSelectorFragment, sampleCollection[0] ); } // Update selected state var selector = sampleCollection[0].previousElementSibling; if (selector && selector.classList.contains("multi-language-selector")) { [].slice.call(selector.children).forEach(function (option) { if (option.getAttribute("data-lang") === languageId) { option.classList.add("selected"); } else { option.classList.remove("selected"); } }); } }); } var preferredLang = initPreferredBuildScriptLanguage(); switchSampleLanguage(preferredLang); // Add event listeners to language selectors document.addEventListener("click", function (evt) { if (evt.target.classList.contains("language-option")) { var newLang = evt.target.getAttribute("data-lang"); switchSampleLanguage(newLang); } }); } postProcessCodeBlocks(); ``` -------------------------------- ### POST /build/execute Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/javadoc/allclasses-index.md.txt Configures and executes a Gradle build using the BuildLauncher interface. ```APIDOC ## POST /build/execute ### Description Allows for the configuration and execution of a Gradle build process. This endpoint utilizes the BuildLauncher to trigger build operations. ### Method POST ### Endpoint /build/execute ### Parameters #### Request Body - **tasks** (array) - Required - List of task names to execute - **arguments** (array) - Optional - Command line arguments for the build - **jvmArguments** (array) - Optional - JVM arguments for the build process ### Request Example { "tasks": ["clean", "build"], "arguments": ["--info"] } ### Response #### Success Response (200) - **status** (string) - The result of the build execution - **buildId** (string) - Unique identifier for the build invocation #### Response Example { "status": "success", "buildId": "gradle-build-12345" } ``` -------------------------------- ### Example and Sidebar Block Styling (CSS) Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-html-samples/userguide/command_line_interface.html CSS rules for styling example blocks, sidebar blocks, and open blocks. These styles control the appearance of code listings, side notes, and expandable content sections. ```css .exampleblock > .content { background-color: inherit; border: 0 none; box-shadow: none; padding: 0; padding-bottom: 0.7rem; margin-bottom: 0; } .exampleblock > .content .title { background-color: var(--code-color); border-top: 1px solid #ccc; font-family: 'Inconsolata', monospace; margin: 0; padding: 1em 1em 0; } .exampleblock > .title > a { text-decoration: none; color: var(--text-color); } .exampleblock .listingblock { margin: 0; } .exampleblock > .content > :first-child { margin-top: 0; } .exampleblock > .content > :last-child { margin-bottom: 0; } .exampleblock > .content > :last-child > :last-child, .exampleblock > .content .olist > ol > li:last-child > :last-child, .exampleblock > .content .ulist > ul > li:last-child > :last-child, .exampleblock > .content .qlist > ol > li:last-child > :last-child { margin-bottom: 0; } .sidebarblock { border-style: solid; border-width: 1px; border-color: #e0e0dc; margin-bottom: 1.25em; padding: 1.25em; background: var(--nav-color); border-radius: 4px; } .sidebarblock > :first-child { margin-top: 0; } .sidebarblock > :last-child { margin-bottom: 0; } .sidebarblock > .content > .title { color: var(--anchor-color); margin-top: 0; text-align: center; } .sidebarblock > .content > :last-child > :last-child, .sidebarblock > .content .olist > ol > li:last-child > :last-child, .sidebarblock > .content .ulist > ul > li:last-child > :last-child, .sidebarblock > .content .qlist > ol > li:last-child > :last-child { margin-bottom: 0; } .sidebarblock .literalblock pre, .sidebarblock .listingblock pre:not(.highlight), .sidebarblock .listingblock pre[class="highlight"], .sidebarblock .listingblock pre[class^="highlight "], .sidebarblock .listingblock pre.prettyprint { background: var(--sidebar-code-bg); } .openblock .content { background: var(--admonition-background); margin-bottom: 1.25em; padding: 1em 1em 0em 1em; border-radius: 4px; overflow: auto !important; } ``` -------------------------------- ### JavaInstallationMetadata Interface Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-html-samples/javadoc/allclasses-index.html Metadata about a Java toolchain installation. ```APIDOC ## JavaInstallationMetadata ### Description Metadata about a Java tool obtained from a toolchain. ### Method N/A (Interface) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response #### Success Response (N/A) N/A #### Response Example N/A ``` -------------------------------- ### Create and Configure File Tree with Closure (Groovy) Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/dsl/org.gradle.api.Project.md.txt Creates a `ConfigurableFileTree` with a base directory and configures it using a Groovy closure. The closure allows for detailed configuration of include/exclude rules and task dependencies. The example shows excluding a specific directory and setting a build dependency. ```groovy def myTree = fileTree('src') { exclude '**/.data/**' builtBy 'someTask' } task copy(type: Copy) { from myTree } ``` -------------------------------- ### AJAX Method Shorthands (JavaScript) Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-html-samples/release-notes.html Creates shorthand methods for common AJAX request types like 'get' and 'post'. These simplify making HTTP GET and POST requests with optional data and callbacks. ```javascript S.each(["get", "post"], function(e, i) { S[i] = function(e, t, n, r) { return m(t) && (r = r || n, n = t, t = void 0), S.ajax(S.extend({url: e, type: i, dataType: r, data: t, success: n}, S.isPlainObject(e) && e)) } }); ``` -------------------------------- ### Create ConfigurableFileTree in Gradle Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/dsl/org.gradle.api.Project.md.txt Demonstrates how to create a ConfigurableFileTree using a base directory with an action or a map of arguments. These trees are lazy and live, meaning they scan for files only when queried. ```groovy def myTree = fileTree('src') { exclude '**/.data/**' builtBy 'someTask' } task copy(type: Copy) { from myTree } ``` ```groovy def myTree = fileTree(dir:'src', excludes:['**/ignore/**', '**/.data/**']) task copy(type: Copy) { from myTree } ``` -------------------------------- ### GET /property Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/javadoc/org/gradle/api/Project.md.txt Retrieves the value of a specific project property. ```APIDOC ## GET /property ### Description Returns the value of the given property for the current project. ### Method GET ### Endpoint /property ### Parameters #### Query Parameters - **propertyName** (String) - Required - The name of the property to retrieve. ### Response #### Success Response (200) - **value** (Object) - The value of the property, or null if not found. ``` -------------------------------- ### AntBuilder Access Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/javadoc/org/gradle/api/Project.md.txt Get the AntBuilder for this project to execute Ant tasks. ```APIDOC ## GET /antbuilder ### Description Returns the `AntBuilder` for this project. You can use this in your build file to execute ant tasks. ### Method GET ### Endpoint /antbuilder ### Response #### Success Response (200) - **antBuilder** (AntBuilder) - The AntBuilder instance. #### Response Example ```json { "antBuilder": {} } ``` ``` -------------------------------- ### GET /artifacts/dependencies Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-html-samples/javadoc/allclasses-index.html Retrieves information about module dependencies and component selectors. ```APIDOC ## GET /artifacts/dependencies ### Description Retrieves the current module dependencies and their associated identifiers for the project. ### Method GET ### Endpoint /artifacts/dependencies ### Parameters #### Query Parameters - **includeTransitive** (boolean) - Optional - Whether to include transitive dependencies. ### Response #### Success Response (200) - **dependencies** (array) - List of ModuleDependency objects. #### Response Example { "dependencies": [ { "group": "org.gradle", "name": "gradle-core", "version": "8.0" } ] } ``` -------------------------------- ### Run Foreground Build with Gradle Source: https://github.com/rnett/gradle-mcp/blob/main/src/main/skills/gradle/SKILL.md Execute a Gradle build with specified commands. If the build fails, use `query_build` with the returned `buildId` for detailed diagnostics. ```kotlin gradle(commandLine=["clean", "build"]) ``` -------------------------------- ### Settings Interface Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-html-samples/javadoc/allclasses-index.html Declares configuration for instantiating and configuring project instances in a build. ```APIDOC ## Settings ### Description Declares the configuration required to instantiate and configure the hierarchy of [`Project`](org/gradle/api/Project.html "interface in org.gradle.api") instances which are to participate in a build. ### Method N/A (Interface) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A #### Success Response (N/A) N/A #### Response Example N/A ``` -------------------------------- ### Project Layout Access Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/javadoc/org/gradle/api/Project.md.txt Get access to various important directories for this project. ```APIDOC ## GET /layout ### Description Provides access to various important directories for this project. ### Method GET ### Endpoint /layout ### Response #### Success Response (200) - **layout** (ProjectLayout) - The ProjectLayout instance. #### Response Example ```json { "layout": {} } ``` ``` -------------------------------- ### GET /problems Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/javadoc/allclasses-index.md.txt Retrieves a list of aggregated problems reported during the build process. ```APIDOC ## GET /problems ### Description Retrieves the current list of aggregated problems captured during the build execution. ### Method GET ### Endpoint /problems ### Parameters #### Query Parameters - **limit** (integer) - Optional - Maximum number of problems to return. ### Request Example GET /problems?limit=10 ### Response #### Success Response (200) - **problems** (array) - A list of ProblemAggregation objects. #### Response Example { "problems": [ { "id": "problem-001", "message": "Configuration error", "severity": "ERROR" } ] } ``` -------------------------------- ### Directory Creation Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/javadoc/org/gradle/api/Project.md.txt Creates a directory and returns a file pointing to it. ```APIDOC ## POST /mkdir ### Description Creates a directory and returns a file pointing to it. ### Method POST ### Endpoint /mkdir ### Parameters #### Request Body - **path** (Object) - Required - The path for the directory to be created. Evaluated as per [`file(Object)`](#file(java.lang.Object)). ### Response #### Success Response (200) - **file** (File) - The created directory. #### Response Example ```json { "file": "path/to/created/directory" } ``` #### Error Response (400) - **error** (string) - Description of the error if the path points to an existing file. #### Error Example ```json { "error": "InvalidUserDataException: Path points to an existing file." } ``` ``` -------------------------------- ### Explore Gradle Core Concepts Documentation Source: https://github.com/rnett/gradle-mcp/blob/main/src/main/skills/gradle/references/best_practices.md Use `gradle_docs` with `path='.'` to explore the root documentation tree and understand core architectural principles. ```json { "path": ".", "projectRoot": "/absolute/path/to/project" } ``` -------------------------------- ### Configure Gradle Options Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/userguide/command_line_interface.md.txt Shows how to pass options with values using the equals sign, toggle boolean flags with --no- prefixes, and use short-form command aliases. ```text gradle [...] --console=plain gradle [...] --build-cache gradle [...] --no-build-cache gradle --help gradle -h ``` -------------------------------- ### GET /tasks Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/javadoc/org/gradle/api/Project.md.txt Retrieves tasks within the current project, with optional recursion into subprojects. ```APIDOC ## GET /tasks ### Description Returns the set of tasks with the given name contained in this project, and optionally its subprojects. ### Method GET ### Endpoint /tasks ### Parameters #### Query Parameters - **name** (String) - Required - The name of the task to search for. - **recursive** (boolean) - Required - Whether to include subprojects in the search. ### Response #### Success Response (200) - **tasks** (Object) - A set of tasks matching the provided name. ``` -------------------------------- ### GET /tooling/model Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-html-samples/javadoc/allclasses-index.html Fetches a snapshot of a buildable model for a project using the ModelBuilder interface. ```APIDOC ## GET /tooling/model ### Description Allows the client to fetch a snapshot of a specific model for a project or build via the Tooling API. ### Method GET ### Endpoint /tooling/model ### Parameters #### Query Parameters - **modelType** (string) - Required - The class type of the model to fetch. ### Request Example { "modelType": "org.gradle.tooling.model.GradleProject" } ### Response #### Success Response (200) - **model** (object) - The requested model snapshot. #### Response Example { "model": { "name": "root-project", "path": ":" } } ``` -------------------------------- ### Perform File System and Normalization Operations in Gradle Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/dsl/org.gradle.api.Project.md.txt Utility methods for creating directories and configuring input normalization for build caching. ```Groovy File dir = project.mkdir("build/custom-dir") project.normalization { runtimeClasspath { ignore("META-INF/MANIFEST.MF") } } ``` -------------------------------- ### GET /cache/configuration Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/javadoc/allclasses-index.md.txt Retrieves the current build cache configuration for the Gradle build environment. ```APIDOC ## GET /cache/configuration ### Description Fetches the configuration settings for the build cache, including service details and cache status. ### Method GET ### Endpoint /cache/configuration ### Response #### Success Response (200) - **enabled** (boolean) - Whether the build cache is enabled. - **localCache** (object) - Configuration details for the local cache. #### Response Example { "enabled": true, "localCache": { "directory": "/tmp/gradle-cache" } } ``` -------------------------------- ### Accessing Project Properties and Methods Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/javadoc/org/gradle/api/Project.md.txt Demonstrates how Gradle scripts delegate calls directly to the Project instance, allowing for concise access to methods and properties. ```Groovy defaultTasks('some-task') // Delegates to Project.defaultTasks() reportsDir = file('reports') // Delegates to Project.file() and the Java Plugin // Accessing via project property for clarity println project.name ``` -------------------------------- ### GET /project/extensions Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/dsl/org.gradle.api.Project.md.txt Access plugin-specific extensions added to the project, such as application and checkstyle configurations. ```APIDOC ## GET /project/extensions ### Description Retrieves configuration extensions added by plugins like 'application' and 'checkstyle'. ### Method GET ### Endpoint /project/extensions ### Response #### Success Response (200) - **application** (JavaApplication) - Configuration for the application plugin. - **checkstyle** (CheckstyleExtension) - Configuration for the checkstyle plugin. ### Response Example { "application": { "mainClass": "com.example.Main" }, "checkstyle": { "ignoreFailures": false } } ``` -------------------------------- ### Configure settings.gradle.kts for Multi-Project Builds Source: https://github.com/rnett/gradle-mcp/blob/main/src/main/skills/gradle/references/common_build_patterns.md Sets up the root project name, includes subprojects, and configures version catalogs and repositories for dependency management. ```kotlin pluginManagement { includeBuild("build-logic") } rootProject.name = "my-project" include(":app", ":core") dependencyResolutionManagement { versionCatalogs { create("libs") { from(files("gradle/libs.versions.toml")) } } repositories { mavenCentral() } } ``` -------------------------------- ### GET /gradle/project Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-html-samples/javadoc/allclasses-index.html Retrieves the model representation of a Gradle project, including its tasks and configuration. ```APIDOC ## GET /gradle/project ### Description Represents a Gradle project and provides access to its structure and metadata. ### Method GET ### Endpoint /gradle/project ### Parameters #### Query Parameters - **projectName** (string) - Required - The name of the project to retrieve. ### Request Example { "projectName": "my-app" } ### Response #### Success Response (200) - **name** (string) - The name of the project. - **tasks** (array) - List of executable tasks. #### Response Example { "name": "my-app", "tasks": ["build", "test", "clean"] } ``` -------------------------------- ### GET /gradle/tasks/testing Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-html-samples/javadoc/allclasses-index.html Details regarding abstract test tasks and aggregated test reports. ```APIDOC ## GET /gradle/tasks/testing ### Description Provides details on the base classes for test execution and report aggregation. ### Method GET ### Endpoint /gradle/tasks/testing ### Parameters None ### Request Example {} ### Response #### Success Response (200) - **baseTask** (string) - The abstract class for all test tasks. - **reportContainer** (string) - The container class for aggregated test reports. #### Response Example { "baseTask": "org.gradle.api.tasks.testing.AbstractTestTask", "reportContainer": "org.gradle.api.tasks.testing.AggregateTestReport" } ``` -------------------------------- ### Accessing Project Properties and Methods Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/dsl/org.gradle.api.Project.md.txt Demonstrates how Gradle scripts delegate calls directly to the Project instance, allowing for concise syntax when configuring tasks or files. ```groovy defaultTasks('some-task') // Delegates to Project.defaultTasks() reportsDir = file('reports') // Delegates to Project.file() and the Java Plugin ``` -------------------------------- ### GET /gradle/tasks/antlr Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-html-samples/javadoc/allclasses-index.html Information regarding the Antlr plugin and task generation for Gradle projects. ```APIDOC ## GET /gradle/tasks/antlr ### Description Retrieves information about the AntlrPlugin and AntlrTask used for generating parsers from grammars. ### Method GET ### Endpoint /gradle/tasks/antlr ### Parameters #### Query Parameters - **includeSourceSets** (boolean) - Optional - Whether to include source set mappings in the response. ### Request Example {} ### Response #### Success Response (200) - **pluginName** (string) - The name of the Antlr plugin. - **taskClass** (string) - The class responsible for generating parsers. #### Response Example { "pluginName": "org.gradle.api.plugins.antlr.AntlrPlugin", "taskClass": "org.gradle.api.plugins.antlr.AntlrTask" } ``` -------------------------------- ### Execute Gradle Tasks via Command Line Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/userguide/command_line_interface.md.txt Demonstrates the basic syntax for executing one or more Gradle tasks and applying command-line options. It is recommended to use the Gradle Wrapper (gradlew) for consistent builds. ```text gradle [taskName...] [--option-name...] gradle [--option-name...] [taskName...] gradle [taskName1 taskName2...] [--option-name...] ``` -------------------------------- ### GET /toolchain/resolver/registry Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-html-samples/javadoc/allclasses-index.html Retrieves the registry service used by plugins to register Java toolchain resolvers. ```APIDOC ## GET /toolchain/resolver/registry ### Description Provides access to the JavaToolchainResolverRegistry, allowing plugins to register custom JavaToolchainResolver implementations for auto-provisioning. ### Method GET ### Endpoint /toolchain/resolver/registry ### Response #### Success Response (200) - **registry** (JavaToolchainResolverRegistry) - The build-level service for toolchain resolver registration. #### Response Example { "status": "active", "registered_resolvers": [] } ``` -------------------------------- ### POST /fileTree (Object, Action) Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-html-samples/dsl/org.gradle.api.Project.html Creates a new ConfigurableFileTree using a base directory and a configuration action. ```APIDOC ## POST /fileTree ### Description Creates a new ConfigurableFileTree using the given base directory. The action is used to configure the tree, such as setting excludes or task dependencies. ### Method POST ### Endpoint /fileTree ### Parameters #### Request Body - **baseDir** (Object) - Required - The base directory path. - **configureAction** (Action) - Required - The action to configure the file tree. ### Request Example { "baseDir": "src", "configureAction": "{ exclude '**/.data/**'; builtBy 'someTask' }" } ### Response #### Success Response (200) - **ConfigurableFileTree** (Object) - The created file tree instance. ``` -------------------------------- ### Get Build Summary Source: https://github.com/rnett/gradle-mcp/blob/main/src/main/skills/gradle/references/query_build_diagnostics.md Provides a high-level overview of the build, including failures, problems, and failed tests. ```json { "buildId": "BUILD_ID" } ``` -------------------------------- ### Read Plugin Source Code Source: https://github.com/rnett/gradle-mcp/blob/main/src/main/skills/exploring_dependency_sources/SKILL.md After finding a plugin, use this to read its source code. Provide the path and `sourceSetPath=":buildscript"`. ```bash read_dependency_sources(path="//...", sourceSetPath=":buildscript") ``` -------------------------------- ### GET /gradle/logging Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/javadoc/allclasses-index.md.txt Access and control the Gradle logging system, including log levels and output management. ```APIDOC ## GET /gradle/logging ### Description Provides interfaces for interacting with the Gradle logging system, including custom log levels like 'quiet' and 'lifecycle'. ### Components - **Logger**: Extension of SLF4J Logger. - **LoggingManager**: Control over the logging system. - **LogLevel**: Enum of supported log levels. ### Response #### Success Response (200) - **status** (string) - Current logging configuration status. ``` -------------------------------- ### Search Gradle Documentation for Best Practices Source: https://github.com/rnett/gradle-mcp/blob/main/src/main/skills/gradle/references/best_practices.md Use `gradle_docs` with a query to search for specific best practices, such as dependency management, using tags for filtered results. ```json { "query": "tag:best-practices dependency management", "projectRoot": "/absolute/path/to/project" } ``` -------------------------------- ### Add Compose UI Test Dependency to REPL Source: https://github.com/rnett/gradle-mcp/blob/main/src/main/skills/verifying_compose_ui/references/troubleshooting.md Use this JSON configuration to start the REPL with a specific source set and include additional dependencies, such as the Compose UI Test library for desktop, when they are not automatically resolved. ```json { "command": "start", "projectPath": ":my-app", "sourceSet": "main", "additionalDependencies": ["org.jetbrains.compose.ui:ui-test-junit4-desktop:1.7.0"] } ``` -------------------------------- ### GET /models/cpp/library Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-html-samples/javadoc/allclasses-index.html Retrieves metadata regarding C++ shared or static library binaries defined in the project. ```APIDOC ## GET /models/cpp/library ### Description Fetches information about C++ shared or static library binaries, including their source sets and build configurations. ### Method GET ### Endpoint /models/cpp/library ### Parameters #### Query Parameters - **type** (string) - Required - The type of library ('shared' or 'static'). ### Request Example GET /models/cpp/library?type=shared ### Response #### Success Response (200) - **name** (string) - Name of the library. - **type** (string) - Type of the library binary. - **sourceSets** (array) - List of associated C++ source files. #### Response Example { "name": "my-native-lib", "type": "shared", "sourceSets": ["src/main/cpp/lib.cpp"] } ``` -------------------------------- ### GET /project/properties Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/dsl/org.gradle.api.Project.md.txt Access core project properties including root directory, project hierarchy, and evaluation state. ```APIDOC ## GET /project/properties ### Description Retrieves core metadata and configuration properties for the current Gradle project. ### Method GET ### Endpoint /project/properties ### Response #### Success Response (200) - **rootDir** (File) - The root directory of the project. - **rootProject** (Project) - The root project for the hierarchy. - **state** (ProjectState) - The evaluation state of the project. - **status** (String) - The project status (default: release). - **subprojects** (Set) - The set of subprojects. - **tasks** (TaskContainer) - The tasks of the project. - **version** (Object) - The project version (default: unspecified). ### Response Example { "rootDir": "/home/user/project", "status": "release", "version": "1.0.0" } ``` -------------------------------- ### Example: Synchronize directories with preserve option Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-md-expected/dsl/org.gradle.api.Project.md.txt Shows an advanced usage of the project.sync method, including the 'preserve' option to selectively keep existing files in the destination directory. It demonstrates using include and exclude patterns within 'preserve'. Dependencies: Gradle project object, sync method, preserve block. Input: Source directory, destination directory, preserve configuration. Output: Synchronized directory with preserved files. ```groovy project.sync { from 'source' into 'dest' preserve { include 'extraDir/**' include 'dir1/**' exclude 'dir1/extra.txt' } } ``` -------------------------------- ### GET /gradle/eclipse/model Source: https://github.com/rnett/gradle-mcp/blob/main/src/test/resources/docs-html-samples/javadoc/allclasses-index.html Retrieves the Eclipse project model, including classpath, source directories, and project nature configurations. ```APIDOC ## GET /gradle/eclipse/model ### Description Fetches the current Eclipse project model, providing details on build paths, source directories, and project dependencies. ### Method GET ### Endpoint /gradle/eclipse/model ### Query Parameters - **projectId** (string) - Required - The identifier of the project to retrieve. ### Response #### Success Response (200) - **classpath** (object) - The build path settings for the Eclipse project. - **sourceDirectories** (Array) - List of source directories configured in the project. - **natures** (Array) - List of Eclipse project natures. #### Response Example { "classpath": {"entries": []}, "sourceDirectories": ["src/main/java"], "natures": ["org.eclipse.jdt.core.javanature"] } ```