list_serversLABSCO SUMMARY
A connection pool is the reason this beats a shell tool.
Every log question over plain SSH pays reconnection cost; here connections are pooled and reused, with automatic reconnect and a retry budget. The constraint to check before installing is the file layout: the server finds logs through a configured filename pattern built from level, date and sequence, so a service that names its logs differently needs that pattern adjusted first.
What it is
A Java server that keeps a pool of SSH connections to the machines you configure and answers log questions across them. Several servers are managed as one namespace, with a default so most calls do not need to name one.
What you get
list_serversreports the configured servers with their connection statelist_log_fileslists log files on a server, filtered by level and by date rangeread_log_filereads a file, optionally between two line numbers or up to a maximum line countsearch_logssearches by keyword across levels and dates, with regular expressions, context lines around each match, and a result captail_logsreturns the most recent lines at a chosen level, defaulting to fifty- Filtering by level — info, warn, error and debug — is built in rather than left to grep
- Safety on the shell side: parameter validation, path validation and shell escaping
Requirements
JDK 21+ and Maven 3.6+ to build the JAR. Authentication is SSH private key only — password authentication is not supported, so the key must already be authorised on each target and readable at the path named in the config. Servers go in a config.json listing host, port, username, key path and a log root directory. Run it over stdio with the key and config paths as JVM properties, or start it in HTTP mode on a port and register the URL. Log filenames are expected to follow the pattern in the config.
Setup effort
Build from source — git clone https://github.com/caijianying/log-mcp
USE CASES
Finding an error across several machines
Search by keyword with context lines rather than SSHing into each host and running grep.
Seeing what is happening right now
Tail the current log at the level you care about from the chat.
Investigating a specific window
List the log files for the date range, then read the relevant lines out of the one that matters.
5 tools
Listed in project docs. Your client may show a different list.
list_log_filesread_log_filesearch_logstail_logsBEFORE YOU INSTALL
What to know first
Tools you get
5 tools named in the project's documentation.
Requires
- JDK 21+
- Maven 3.6+
- Log-MCP connects to remote servers with SSH private-key file authentication
- password authentication is not supported, only private-key files
INSTALLATION
Connect your client
This one is built from source rather than installed with a single command.
Server setup
git clone https://github.com/caijianying/log-mcp
cd log-mcpEdit src/main/resources/config.json before building: under servers, set host, port, username and logRootPath to your own log server, keep privateKeyPath as ${ssh.cert.path}, and adjust logFilePattern if your log files are named differently
Make sure your SSH public key is authorised on that server, e.g. ssh-copy-id -i ~/.ssh/id_rsa.pub root@<YOUR_SERVER> — password login is not supported
mvn clean packageThe build writes target/log-mcp-1.0.0.jar and copies your config.json to target/classes/config.json, which is the file the commands below point at
MCP Clients
Claude Code — stdio
claude mcp add log-mcp-stdio java -- -Dssh.cert.path=<YOUR_PATH_TO_ID_RSA> -Dlog.config=<YOUR_PATH_TO_LOG_MCP>/target/classes/config.json -jar <YOUR_PATH_TO_LOG_MCP>/target/log-mcp-1.0.0.jarClaude Code — HTTP
Start the server in HTTP mode from the log-mcp folder and keep it running:
java -Dtransport.mode=http -Dserver.port=8892 -Dssh.cert.path=<YOUR_PATH_TO_ID_RSA> -Dlog.config=<YOUR_PATH_TO_LOG_MCP>/target/classes/config.json -jar target/log-mcp-1.0.0.jarRegister it with Claude Code:
claude mcp add --transport http log-mcp http://127.0.0.1:8892/mcp