mcpField
L
log

log

Local
github.com/rog0xData & Analytics1Updated 32w ago

About log

@rog0x/mcp-log-tools is an MCP server for AI agents to process and analyze logs in common formats or custom regex-based formats. It provides filtering, statistics, anomaly detection, and format conversion.

Key features

  1. 01Parse common and custom log formats
  2. 02Filter by level, date, and keyword
  3. 03Summarize errors and request trends
  4. 04Detect unusual log-volume changes
  5. 05Convert formats and generate reports

Use cases

  1. 01Filter error logs for a date range
  2. 02Analyze HTTP traffic and slow endpoints
  3. 03Convert logs to CSV or tables

MCP support

It exposes log parsing, filtering, analysis, formatting, and statistics tools to AI agents through MCP.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"rog0x-log": {
"command": "npx",
"args": [
"-y",
"@rog0x/mcp-log-tools"
]
}
}
}
Run commandnpx -y @rog0x/mcp-log-tools

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@rog0x/mcp-log-tools1.0.2

Tools

5

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
limitnumberNoMaximum number of entries to return
formatenumNoLog format to use for parsing. Use 'auto' to detect automatically.auto | json | apache | nginx | syslog | custom
contentstringYesRaw log content to parse
custom_patternstringNoCustom regex pattern with named groups: (?<timestamp>), (?<level>), (?<message>), (?<source>)

Details

From the project README

@rog0x/mcp-log-tools

Log analysis and processing tools for AI agents, exposed via the Model Context Protocol (MCP).

Tools

parse_logs

Parse log content in common formats: JSON logs, Apache/Nginx access logs, syslog, and structured logs. Supports custom regex patterns with named capture groups. Extracts timestamp, level, message, source, and additional structured fields.

filter_logs

Filter parsed log entries by:

  • Log level (ERROR, WARN, INFO, DEBUG)
  • Date range (ISO 8601)
  • Keyword search (case-insensitive)
  • Regex pattern matching
  • Source/logger name

Returns matched entries along with level occurrence counts.

analyze_logs

Analyze log patterns to surface operational insights:

  • Top 10 most frequent errors (normalized)
  • Error rate over time (hourly buckets)
  • Request volume per hour
  • Slowest endpoints (from HTTP access logs)
  • Anomaly detection (sudden spikes or drops using standard deviation)
format_logs

Convert between log formats and produce reports:

  • JSON to plain text, plain to JSON, CSV, or table
  • ANSI colorization by log level
  • Structured field extraction
  • Summary report generation
log_stats

Compute comprehensive log statistics:

  • Total and non-empty line counts
  • Level distribution with percentages
  • Date range coverage
  • Unique IP addresses and request counts
  • Top user agents
  • HTTP status code distribution
  • Throughput (entries per second)

Setup

npm install
npm run build

Usage with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "log-tools": {
      "command": "node",
      "args": ["path/to/mcp-log-tools/dist/index.js"]
    }
  }
}

Supported Log Formats

FormatExample
JSON{"timestamp":"2024-01-15T10:30:00Z","level":"ERROR","message":"Connection failed"}
Apache/Nginx127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /index.html HTTP/1.1" 200 2326
SyslogJan 1 00:00:00 hostname process[1234]: Something happened
Structured2024-01-15T10:30:00.000Z [ERROR] [ModuleName] Something failed
CustomAny format using a regex with named capture groups

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.