log-collector
Parses Apache access logs for HTTP errors (4xx, 5xx).
Parses and collects esbuild build errors from log files.
Parses JavaScript stack traces (Error, TypeError, etc.) from log files.
Parses NGINX access logs for HTTP errors (4xx, 5xx).
Captures npm ERR! output from log files for analysis.
Parses TypeScript stack traces (TypeError, ReferenceError, etc.) from log files.
Parses and collects Vite build errors and warnings from log files.
Click on "Install 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., "@log-collectoranalyze the latest build errors from my vite project"
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.
log-collector
MCP server for collecting and analyzing CLI/web server error logs.
A lightweight server that watches log files and directories, parses common error patterns from CLI tools and web servers, and provides structured querying and analysis — all through the Model Context Protocol (MCP).
Features
File & directory watching — watch single log files or entire directories with glob patterns
Multi-source support — simultaneously monitor multiple log sources
Smart parsing — automatically detects and parses errors from:
Vite / Rollup build errors
JavaScript/TypeScript stack traces (Error, TypeError, ReferenceError, etc.)
esbuild / Vite ×-prefixed build errors
npm ERR! output
Build failures ("Build failed", "Failed to compile")
Warnings (WARN, ⚠, [warn])
HTTP server errors (4xx client errors, 5xx server errors)
Build success / ready messages
Filtered queries — retrieve logs by source, level, time range, and limit
Auto-analysis — get summary statistics and top error counts grouped by normalized message
In-memory ring buffer — retains up to 10,000 entries per session
Related MCP server: log-mcp
Quick Start
Prerequisites
Node.js >= 20
npm
Installation
# Install globally
npm install --global @bonsai/log-collector
# Or run with npx
npx @bonsai/log-collectorBuild from source
git clone https://github.com/bonsai/log-collector.git
cd log-collector
npm install
npm run build
npm startUsage
log-collector is an MCP server that communicates over stdio. It is designed to be used as a tool provider for MCP-compatible clients (e.g., Claude Desktop, Claude Code).
MCP Tools
Tool | Description |
| Start watching a log file or directory for changes |
| Stop watching a log source |
| Retrieve collected error logs with optional filters |
| Analyze collected logs and return a summary |
| List all currently watched log sources |
| Clear all stored logs or logs for a specific source |
Tool Parameters
watch_start
Parameter | Type | Required | Description |
| string | ✅ | Path to log file or directory to watch |
| `"file" | "dir"` | ✅ |
| string | ❌ | Glob pattern when watching a directory (default: |
get_errors
Parameter | Type | Required | Description |
| string | ❌ | Filter by source path/name |
| `"error" | "warn" | "info"` |
| number | ❌ | Max results (default: 50) |
| string | ❌ | ISO timestamp — only return logs after this time |
analyze
Parameter | Type | Required | Description |
| string | ❌ | Focus analysis on a specific source |
Returns: total entries, error/warning/info counts, top 10 most frequent errors, and list of active sources.
Architecture
┌─────────────┐ ┌──────────┐ ┌──────────┐
│ chokidar │────▶│Collector │────▶│ Storage │
│ (FS watcher)│ │(readTail)│ │(10k ring)│
└─────────────┘ └──────────┘ └──────────┘
│
┌──────▼──────┐
│ Parser │
│ (pattern │
│ matching) │
└─────────────┘
┌─────────────┐
│ MCP Server │ (stdio transport)
│ (index.ts) │
└─────────────┘
│
▼
MCP Client
(Claude Desktop,
Claude Code, etc.)Components
index.ts— MCP server entry point; registers tools and handles requestscollector.ts— File watcher manager using chokidar; reads tail of changed filesparser.ts— Pattern-based log parser; recognizes Vite, npm, HTTP, and generic error formats; also providesanalyze()for summary aggregationstorage.ts— In-memory ring buffer with filtered query support
Development
# Install dependencies
npm install
# Build
npm run build
# Run locally
npm start
# Watch mode (auto-restart on changes)
npx tsx src/index.tsAdding new log patterns
Edit src/parser.ts and add a new entry to the patterns array:
{
name: "my-tool-error",
test: (line) => {
const m = line.match(/^MY_ERROR:\s+(.+)/);
if (m) return { level: "error", message: m[1], detail: line };
return null;
},
},Use Cases
AI-assisted debugging — Feed your local dev server logs to Claude via MCP and ask it to diagnose errors
CI log monitoring — Watch build logs during development to catch failures early
Web server log analysis — Point it at your Nginx/Apache access logs to get structured error summaries
Multi-project log aggregation — Watch multiple project log directories simultaneously
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/bonsai/log-collector'
If you have feedback or need assistance with the MCP directory API, please join our Discord server