Get the FREE Ultimate OpenClaw Setup Guide →

local-logs

A **Model Context Protocol (MCP) server** for monitoring local application logs with real-time tailing, error tracking, and log search capabilities.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio mariosss-local-logs-mcp-server npx -y local-logs-mcp-server \
  --env LOGS_DIR="./logs"

How to use

The Local Logs MCP Server provides real-time tailing, search, and monitoring capabilities for log files stored on your machine. It discovers log files in a configurable directory, tail the last N lines, surfaces recent errors, and offers a server status based on log analysis. Tools exposed by the server include get_log_files to list available logs, tail_log to fetch the last N lines of a specific log, get_errors for recent error entries, get_server_status for a quick health summary, watch_log to monitor a file for changes, and search_logs to query text patterns across logs. The MCP interface is designed to work with various MCP clients (Cursor, Claude Desktop, VS Code Copilot, Windsurf, and more), enabling natural-language commands like pulling recent errors, checking server status, or searching for a term across log files. To get started, configure the MCP client with the local-logs server and point the LOGS_DIR to where your logs reside. Once running, you can issue commands such as “Show me the last 50 lines from error.log” or “Search logs for 'database connection'.”

How to install

Prerequisites:

  • Node.js 14 or higher installed on your system
  • npm (comes with Node.js) or yarn

Installation options:

  1. One-Command Setup (Recommended)
  1. Two-Command Setup
npm install -g https://github.com/mariosss/local-logs-mcp-server
local-logs-setup
  1. Manual Setup
npm install -g local-logs-mcp-server
local-logs-setup
  1. NPX Usage (No Installation)
npx local-logs-mcp-server
  1. Manual Installation (from source)
git clone https://github.com/mariosss/local-logs-mcp-server.git
cd local-logs-mcp-server
npm install -g .

Note: After installation, ensure your MCP client config points to the server using the npx approach as demonstrated in the mcp_config example.

Additional notes

Environment variables and configuration tips:

  • LOGS_DIR: Directory containing log files. Defaults to auto-detection if not set, but you can explicitly set it to point to your logs folder (e.g., ./logs or /var/log).
  • LOG_EXTENSIONS: Comma-separated list of log file extensions the server should consider (default: .log,.txt).
  • The server is read-only and operates locally, with no network access beyond client communication via MCP.
  • If you encounter a “logs directory not found” issue, set LOGS_DIR explicitly to the correct path. If you see “no log files found,” verify the directory contains files with the configured extensions.
  • For Cursor/Claude/VS Code configurations, you can embed LOGS_DIR in your MCP config for consistent behavior across editors.
  • The MCP server supports real-time watching and searching across logs, which can be useful for alerting on errors or monitoring for changes.

Related MCP Servers

Sponsor this space

Reach thousands of developers