Skip to main content
Glama
lkb2k

Gradle Tomcat MCP Server

by lkb2k

restart_tomcat

Restarts Tomcat server processes for Gradle-based applications, allowing controlled stop and start operations with optional force termination. Simplifies server management in development environments.

Instructions

Stop and start Tomcat

Input Schema

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

Implementation Reference

  • The main handler function that implements restarting Tomcat by stopping the current process and starting a new one.
    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 }; }
  • Input schema defining parameters for the restart_tomcat tool: force (boolean) and gradle_command (string).
    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)" } }
  • Tool definition in the TOOLS array, registering 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)" } } } },
  • Switch case in handleToolCall that routes restart_tomcat calls to the handler.
    case "restart_tomcat": return await processManager.restartTomcat( args.force, args.gradle_command );

Other Tools

Related Tools

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