local-logs
A **Model Context Protocol (MCP) server** for monitoring local application logs with real-time tailing, error tracking, and log search capabilities.
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:
- One-Command Setup (Recommended)
- Linux/macOS: curl -sSL https://raw.githubusercontent.com/mariosss/local-logs-mcp-server/main/install-new.js | node
- Windows (PowerShell): Invoke-WebRequest -Uri "https://raw.githubusercontent.com/mariosss/local-logs-mcp-server/main/install-new.js" | Invoke-Expression
- This downloads the server file and configures Cursor automatically. Restart Cursor afterward.
- Two-Command Setup
npm install -g https://github.com/mariosss/local-logs-mcp-server
local-logs-setup
- Manual Setup
npm install -g local-logs-mcp-server
local-logs-setup
- NPX Usage (No Installation)
npx local-logs-mcp-server
- 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
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.