- Home
- MCP servers
- Gradle Tomcat
Gradle Tomcat
- javascript
0
GitHub Stars
javascript
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"lkb2k-mcp-gradle": {
"command": "mcp-gradle-tomcat",
"args": [],
"env": {
"LOG_DIR": "./logs",
"TOMCAT_PORT": "8080",
"GRADLE_COMMAND": "appRun",
"GRADLE_WORKING_DIR": "/path/to/your/gradle/project",
"MAX_LOG_BUFFER_SIZE": "1000"
}
}
}
}You can manage Gradle-based Tomcat applications with real-time log querying and full process lifecycle control using this MCP server. It integrates Gradle, Tomcat, and log data into a single, controllable interface you can drive from MCP clients to start, stop, monitor, and inspect your Tomcat deployments.
How to use
Connect your MCP client to the Gradle Tomcat MCP server. You will typically run the server locally and provide the working directory for your Gradle project via environment variables. Use the client commands to start, stop, monitor, and fetch logs from Tomcat in real time. The server supports: Start Tomcat to launch your Gradle-based application, Stop Tomcat to gracefully halt it, Get Tomcat status to view process state and uptime, Get recent logs to retrieve and filter log output, and Restart Tomcat to perform a clean restart.
How to install
# Global installation (recommended)
npm install -g mcp-gradle-tomcat
# Local installation
npm install mcp-gradle-tomcat
# From source
git clone https://github.com/your-username/mcp-gradle-tomcat.git
cd mcp-gradle-tomcat
npm install
Additional usage notes
Quick start requires configuring a client (such as Claude) to know how to reach this MCP server. You provide an MCP server entry that points to the local CLI tool and set the working directory for your Gradle project using an environment variable.
Configuration details
You configure runtime behavior with environment variables and command options. The key variables are:
-
GRADLE_WORKING_DIR: Working directory where Gradle commands run. Default is the current directory.
-
GRADLE_COMMAND: Gradle command to run (default: appRun).
-
TOMCAT_PORT: Expected Tomcat port (default: 8080).
-
MAX_LOG_BUFFER_SIZE: Maximum number of log entries kept in memory (default: 1000).
-
LOG_DIR: Directory for log files (default: ./logs).
Troubleshooting tips
If you encounter issues starting Tomcat, verify the Gradle working directory is correct and that the Gradle application can build and run outside the MCP server. Check the log directory for recent messages and confirm the Tomcat port does not conflict with another service.
Architecture overview
The MCP server is structured to separate responsibilities: a process manager handles Tomcat lifecycle, a log manager captures and queries logs, and a core server ties commands to tools. This modular design makes it easy to extend with additional capabilities or integrate with other MCP clients.
Examples of available commands
This section describes the high-level actions you can perform through MCP clients. You can start, stop, restart, query status, and fetch logs for your Gradle-based Tomcat application. Each action is exposed through its own tool with clear parameters and behavior.
Tools and endpoints referenced
Tools include start_tomcat to launch, stop_tomcat to terminate, restart_tomcat to perform a stop-and-start cycle, get_tomcat_status to check status, get_logs to retrieve logs with filters, and clear_logs to reset the log buffers and files.
Architecture notes
The server exposes a concise set of tools that map directly to common lifecycle and observability tasks for a Tomcat application managed via Gradle. Each tool has parameters you can tune to fit your environment and logging requirements.
License
MIT
Metadata and configuration reference
{
"mcpServers": [
{
"type": "stdio",
"name": "gradle_tomcat",
"command": "mcp-gradle-tomcat",
"args": [],
"env": [
{"name": "GRADLE_WORKING_DIR", "value": "/path/to/your/gradle/project"}
]
}
],
"envVars": [
{"name": "GRADLE_WORKING_DIR", "description": "Working directory for Gradle commands", "example": "/path/to/gradle/project"},
{"name": "GRADLE_COMMAND", "description": "Gradle command to run", "example": "appRun"},
{"name": "TOMCAT_PORT", "description": "Tomcat port to monitor", "example": "8080"},
{"name": "MAX_LOG_BUFFER_SIZE", "description": "Max log entries kept in memory", "example": "1000"},
{"name": "LOG_DIR", "description": "Directory for log files", "example": "./logs"}
],
"language": "javascript",
"packageManagers": ["npm"],
"tools": [
{"name": "start_tomcat", "description": "Launch Tomcat via Gradle"},
{"name": "stop_tomcat", "description": "Terminate Tomcat process"},
{"name": "restart_tomcat", "description": "Stop and start Tomcat"},
{"name": "get_tomcat_status", "description": "Check Tomcat process status"},
{"name": "get_logs", "description": "Retrieve log entries with optional filters"},
{"name": "clear_logs", "description": "Clear log buffer and files"}
],
"relatedReadme": null
}
Available tools
start_tomcat
Launch Tomcat via Gradle
stop_tomcat
Terminate Tomcat process
restart_tomcat
Stop and start Tomcat
get_tomcat_status
Check Tomcat process status
get_logs
Retrieve log entries with filters
clear_logs
Clear log buffer and files