Local Logs MCP Server
Provides tools for monitoring and analyzing local application log files with real-time tailing, error tracking, log search capabilities, and server status monitoring
Enables monitoring of Node.js application logs including Winston, Pino, and Bunyan log formats with real-time tailing and error detection
Supports parsing and monitoring of Pino log files with search and real-time monitoring capabilities
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., "@Local Logs MCP Server show me the last 10 errors from my Node.js app"
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.
Local Logs MCP Server
A Model Context Protocol (MCP) server for monitoring local application logs with real-time tailing, error tracking, and log search capabilities.
Perfect for monitoring Node.js applications, web servers, or any application that writes to log files.
β¨ Features
π Log File Discovery - Automatically finds and lists available log files
π Real-time Log Tailing - Get the last N lines from any log file
β οΈ Error Monitoring - Quickly check error logs for issues
π Server Status - Get server status summary from log analysis
π Log Watching - Monitor log files for changes
π Log Search - Search for specific text patterns in logs
π§ Configurable - Supports custom log directories and file extensions
π Easy Setup - Works with Cursor, Claude Desktop, VS Code Copilot, and more
Related MCP server: Local Lens
π οΈ Available Tools
Tool | Description | Parameters |
| List available log files with metadata | None |
| Get last N lines from a log file |
|
| Get recent error log entries |
|
| Server status summary from logs | None |
| Monitor log file for changes |
|
| Search for text in log files |
|
π¦ Installation
π One-Command Setup (Recommended)
Linux/Mac:
curl -sSL https://raw.githubusercontent.com/mariosss/local-logs-mcp-server/main/install-new.js | nodeWindows (PowerShell):
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/mariosss/local-logs-mcp-server/main/install-new.js" | Invoke-ExpressionThat's it! The installation script will download the server file directly and configure Cursor automatically. Just restart Cursor and you're ready to go!
Alternative: Two-Command Setup
npm install -g https://github.com/mariosss/local-logs-mcp-server
local-logs-setupAlternative: Manual Setup
npm install -g local-logs-mcp-server
local-logs-setupNPX Usage (No Installation)
npx local-logs-mcp-serverManual Installation
git clone https://github.com/mariosss/local-logs-mcp-server.git
cd local-logs-mcp-server
npm install -g .βοΈ Configuration
β Automatic Configuration (Default)
The package automatically configures Cursor for you! No manual setup needed.
π§ Manual Configuration (If needed)
For Cursor IDE
Add to your .cursor/mcp.json (project-specific) or global MCP config:
{
"mcpServers": {
"local-logs": {
"command": "npx",
"args": ["-y", "local-logs-mcp-server"],
"env": {
"LOGS_DIR": "./logs"
}
}
}
}For Claude Desktop
Add to your Claude Desktop MCP config (~/Library/Application Support/Claude/claude_desktop_config.json on Mac):
{
"mcpServers": {
"local-logs": {
"command": "npx",
"args": ["-y", "local-logs-mcp-server"],
"env": {
"LOGS_DIR": "/path/to/your/logs"
}
}
}
}For VS Code (GitHub Copilot)
Add to your .vscode/mcp.json:
{
"servers": {
"local-logs": {
"command": "npx",
"args": ["-y", "local-logs-mcp-server"],
"env": {
"LOGS_DIR": "./logs"
}
}
}
}For Windsurf (Codium)
Add to your Windsurf MCP config:
{
"mcpServers": {
"local-logs": {
"command": "npx",
"args": ["-y", "local-logs-mcp-server"],
"env": {
"LOGS_DIR": "./logs"
}
}
}
}π§ Environment Variables
Variable | Description | Default |
| Directory containing log files | Auto-detected (see below) |
| Comma-separated log file extensions |
|
Log Directory Auto-Detection
If LOGS_DIR is not specified, the server automatically searches for logs in this priority order:
./logs(current directory)./apps/backend/logs(monorepo structure)./server/logs(server directory)./backend/logs(backend directory)/var/log(system logs on Linux/Mac)C:\logs(system logs on Windows)
π Usage Examples
Once configured with your MCP client, you can use natural language commands:
Basic Commands
"Check my server logs"
"Are there any errors in the logs?"
"What's my server status?"
"Show me available log files"
Advanced Commands
"Show me the last 50 lines from error.log"
"Search logs for 'database connection'"
"Monitor access.log for changes"
"Find all log entries containing 'TypeError'"
ποΈ Project Structure Examples
Standard Node.js Project
your-project/
βββ logs/
β βββ combined.log # Main application log
β βββ error.log # Error log
β βββ access.log # Access log (optional)
βββ .cursor/
β βββ mcp.json # MCP configuration
βββ src/
βββ package.jsonMonorepo Structure
your-monorepo/
βββ apps/
β βββ backend/
β βββ logs/
β βββ combined.log
β βββ error.log
βββ .cursor/
β βββ mcp.json
βββ package.jsonπ Supported Log Formats
The server works with any text-based log files and can parse:
Winston logs (JSON and text format)
Morgan access logs
Pino logs
Bunyan logs
Custom application logs
System logs
Any .log or .txt files
Example Log Formats
Winston Text Format:
2024-01-15 10:30:45 [INFO]: Server started on port 3000
2024-01-15 10:30:50 [ERROR]: Database connection failedWinston JSON Format:
{"level":"info","message":"Server started","timestamp":"2024-01-15T10:30:45.123Z"}
{"level":"error","message":"Database connection failed","timestamp":"2024-01-15T10:30:50.456Z"}π‘οΈ Security
Read-only access - Server only reads log files, never writes or modifies
Directory scoping - Only accesses files in the specified logs directory
No network access - Operates entirely on local files
Permission respect - Respects file system permissions
π Performance
Efficient file reading - Uses streaming for large log files
Memory conscious - Doesn't load entire files into memory
Fast search - Optimized text search algorithms
Minimal dependencies - Only uses Node.js built-in modules
π€ Contributing
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Troubleshooting
Server shows red/error status
Check that the logs directory exists and is accessible
Verify log files have proper read permissions
Ensure Node.js version is 14 or higher
Check that the server path is correct in your MCP config
No tools available
Restart your MCP client (Cursor, Claude, VS Code)
Verify MCP configuration syntax is valid JSON
Check that the MCP server is responding (test with
echo '{"jsonrpc":"2.0","method":"initialize","id":1}' | npx local-logs-mcp-server)
Log files not found
Set the correct
LOGS_DIRenvironment variableMake sure your application is actually writing to log files
Check that file extensions match
LOG_EXTENSIONSsettingVerify directory permissions allow reading
Common Log Directory Issues
Issue: "Logs directory not found"
# Solution: Set explicit path
export LOGS_DIR="/path/to/your/logs"Issue: "No log files found"
# Solution: Check file extensions
export LOG_EXTENSIONS=".log,.txt,.out"π Examples
Complete Cursor Setup
Install globally:
npm install -g local-logs-mcp-serverAdd to
.cursor/mcp.json:{ "mcpServers": { "local-logs": { "command": "local-logs-mcp", "env": { "LOGS_DIR": "./logs" } } } }Restart Cursor and test:
Ask: "Check my server logs"
Complete Claude Desktop Setup
Open Claude Desktop config:
# Mac open ~/Library/Application\ Support/Claude/claude_desktop_config.json # Windows notepad %APPDATA%\Claude\claude_desktop_config.jsonAdd configuration:
{ "mcpServers": { "local-logs": { "command": "npx", "args": ["-y", "local-logs-mcp-server"], "env": { "LOGS_DIR": "/Users/yourusername/projects/myapp/logs" } } } }Restart Claude Desktop
π Related Projects
Made with β€οΈ for the MCP community
Available Tools
6 toolsget_errorsC
Get recent error log entries
Inputs: lines.
get_log_filesB
Get list of available log files with metadata
Inputs: no named parameters.
get_server_statusB
Get server status summary from logs
Inputs: no named parameters.
search_logsC
Search for specific text in log files
Inputs: query (required), filename, lines.
tail_logA
Get the last N lines from a log file
Inputs: filename, lines.
watch_logC
Monitor a log file for changes
Inputs: filename.
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 with no overlap: get_errors retrieves error entries, get_log_files lists files, get_server_status provides a summary, search_logs finds text, tail_log gets last lines, and watch_log monitors changes. The descriptions reinforce these unique functions, making tool selection unambiguous.
All tool names follow a consistent verb_noun pattern using snake_case, such as get_errors, search_logs, and tail_log. This uniformity makes the set predictable and easy to understand, with no deviations in naming style.
With 6 tools, the server is well-scoped for log management, covering essential operations like listing, searching, tailing, and monitoring logs. Each tool earns its place without being excessive or insufficient for the domain.
The tool set provides strong coverage for log reading and monitoring, including search, tail, and watch functionalities. A minor gap exists in write operations (e.g., clearing or modifying logs), but agents can effectively work with the provided read-only tools for typical log analysis tasks.
Maintenance
Related MCP Connectors
Ingest and search LogsLoom logs from coding agents.
Read-only access to Auralogs production logs: search logs, inspect errors, review AI analyses.
Open-source agent that observes and fixes your application. Query logs, traces, metrics, incidents.
Errors, logs and AI-call costs for apps on Node.js, Next.js, Cloudflare Workers or the browser. Ask your AI whatβs broken, why, and how to fix it, right inside Cursor or Claude.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to automatically inspect and analyze application runtime log files for debugging and troubleshooting. Supports monitoring multiple log directories simultaneously with tools for listing, reading, searching, and paginating through log files.840 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceA 100% local development monitoring tool that captures browser console logs, network requests, and backend server output for analysis by AI assistants via MCP. It enables LLMs to debug applications by providing structured, real-time access to full-stack log data and persistent local storage.7MIT
- FlicenseNot gradedqualityDmaintenanceHandles log file management and analysis with tools to list, read, search, filter, and generate analytics on log files.1-
- FlicenseNot gradedqualityDmaintenanceAnalyzes log files using AI-powered tools to detect errors, patterns, and anomalies through natural language queries in Cursor IDE.-