Skip to main content
Glama
lkb2k

Gradle Tomcat MCP Server

by lkb2k

restart_tomcat

Stop and start Tomcat to restart Gradle-based applications, with options for forced termination and custom Gradle commands.

Instructions

Stop and start Tomcat

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoForce termination during stop
gradle_commandNoGradle command for restart (default: appRun)

Implementation Reference

  • Core implementation of restart_tomcat tool: stops Tomcat (optionally forcefully), waits 2 seconds, then starts it with optional Gradle command.
    async restartTomcat(force = false, gradleCommand = null) { const stopResult = await this.stopTomcat(force); await new Promise(resolve => setTimeout(resolve, 2000)); const startResult = await this.startTomcat(gradleCommand); return { stop: stopResult, start: startResult, success: true }; }
  • Tool dispatcher in handleToolCall: maps tool call to processManager.restartTomcat using input args.
    case "restart_tomcat": return await processManager.restartTomcat( args.force, args.gradle_command );
  • Input schema for restart_tomcat tool defining parameters force and gradle_command.
    inputSchema: { type: "object", properties: { force: { type: "boolean", description: "Force termination during stop", default: false }, gradle_command: { type: "string", description: "Gradle command for restart (default: appRun)" } } }
  • Registration of restart_tomcat tool in the TOOLS export array, including name, description, and schema.
    { name: "restart_tomcat", description: "Stop and start Tomcat", inputSchema: { type: "object", properties: { force: { type: "boolean", description: "Force termination during stop", default: false }, gradle_command: { type: "string", description: "Gradle command for restart (default: appRun)" } } } },

Latest Blog Posts

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/lkb2k/mcp-gradle'

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