Gradle Tomcat MCP Server
Manages Gradle-based Tomcat applications, allowing process control (start, stop, restart) and execution of Gradle commands in specified project directories
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Gradle Tomcat MCP Server get recent logs with level ERROR from the last hour"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Gradle Tomcat MCP Server
A Model Context Protocol (MCP) server for managing Gradle-based Tomcat applications with log querying capabilities.
Features
Process Management: Start, stop, restart, and monitor Tomcat processes via Gradle
Log Management: Capture, store, and query application logs with filtering
Real-time Monitoring: Stream logs and process status updates
MCP Integration: Full integration with Claude and other MCP clients
Related MCP server: Hostinger API MCP Server
Installation
Global Installation (Recommended)
npm install -g mcp-gradle-tomcatLocal Installation
npm install mcp-gradle-tomcatFrom Source
git clone https://github.com/your-username/mcp-gradle-tomcat.git
cd mcp-gradle-tomcat
npm installQuick Start
1. Add to Claude Configuration
Add this to your Claude configuration file (~/.claude/config.json):
{
"mcpServers": {
"gradle-tomcat": {
"command": "mcp-gradle-tomcat",
"env": {
"GRADLE_WORKING_DIR": "/path/to/your/gradle/project"
}
}
}
}2. Use with Claude
Once configured, you can use these commands in Claude:
"Start Tomcat" - Launches your Gradle application
"Stop Tomcat" - Gracefully stops the running application
"Get Tomcat status" - Shows process status and uptime
"Get recent logs" - Retrieves application logs with filtering
"Restart Tomcat" - Stops and starts the application
Manual Usage
Direct Execution
# Set your project directory
export GRADLE_WORKING_DIR="/path/to/your/gradle/project"
# Run the MCP server
mcp-gradle-tomcatTesting Tools
# Test individual tools
npm testConfiguration
Configuration can be set via environment variables:
GRADLE_WORKING_DIR: Working directory for Gradle commands (default: current directory)GRADLE_COMMAND: Gradle command to run (default: appRun)TOMCAT_PORT: Expected Tomcat port (default: 8080)MAX_LOG_BUFFER_SIZE: Maximum log entries in memory (default: 1000)LOG_DIR: Directory for log files (default: ./logs)
Available Tools
start_tomcat
Launch Tomcat via Gradle
gradle_command(optional): Gradle command to runworking_directory(optional): Working directory
stop_tomcat
Terminate Tomcat process
force(optional): Force termination with SIGKILL
restart_tomcat
Stop and start Tomcat
force(optional): Force termination during stopgradle_command(optional): Gradle command for restart
get_tomcat_status
Check Tomcat process status
No parameters
get_logs
Retrieve log entries
lines(optional): Number of recent log lines (default: 100)level(optional): Minimum log level (DEBUG, INFO, WARN, ERROR)since(optional): ISO 8601 timestamp to filter fromsource(optional): Filter by source (stdout, stderr)
clear_logs
Clear log buffer and files
confirm(required): Must be true to confirm
Architecture
src/
├── server.js # Main MCP server
├── process-manager.js # Tomcat lifecycle management
├── log-manager.js # Log capture and querying
├── tools/ # MCP tool implementations
└── config.js # Configuration managementLicense
MIT
Available Tools
6 toolsclear_logsC
Clear log buffer and files
Inputs: confirm (required).
get_logsC
Retrieve log entries
Inputs: lines, level, since, source.
get_tomcat_statusB
Check Tomcat process status
Inputs: no named parameters.
restart_tomcatC
Stop and start Tomcat
Inputs: force, gradle_command.
start_tomcatC
Launch Tomcat via Gradle
Inputs: gradle_command, working_directory.
stop_tomcatC
Terminate Tomcat process
Inputs: force.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose targeting specific Tomcat management tasks: clearing logs, retrieving logs, checking status, restarting, starting, and stopping. No overlap exists between these functions, making tool selection straightforward for an agent.
All tool names follow a consistent verb_noun pattern using snake_case (e.g., clear_logs, get_logs, restart_tomcat). The verbs are action-oriented and predictable, with no deviations in naming style across the set.
With 6 tools, the server is well-scoped for managing Tomcat via Gradle, covering essential lifecycle operations (start, stop, restart, status) and log handling. Each tool earns its place without being excessive or insufficient for the domain.
The tool set provides complete coverage for Tomcat management: it includes lifecycle control (start, stop, restart), status monitoring, and log operations (retrieve and clear). No obvious gaps exist for the stated purpose, enabling agents to handle typical workflows without dead ends.
Maintenance
Related MCP Connectors
Deploy services, add databases, run agents, read logs, check vulnerabilities and publish pages.
Manage servers through SSH.
Deploy and manage applications, databases, domains, and git repos
Read RunCloud servers, web apps, databases and logs; deploy, restart services, renew SSL.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables interaction with Gradle projects through the Gradle Wrapper, allowing users to list projects and tasks, execute builds, run tests, and clean artifacts with real-time progress reporting and comprehensive error details.72MIT
- AlicenseNot gradedqualityDmaintenanceEnables management of Hostinger services, allowing users to deploy WordPress sites, themes, and plugins, as well as manage JavaScript and static website deployments. It also provides tools for retrieving billing catalog items and monitoring application deployment logs.MIT
- AlicenseNot gradedqualityCmaintenanceEnables management of long-running development processes (such as dev servers, compilers, and watchers) from MCP hosts. Provides tools to start, stop, restart, check status, view logs, and send input to managed processes.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI-assisted management of Apache Tomcat, including start/stop, WAR deployment, log analysis, thread and heap dumps, and diagnostics.47 npmMIT