MCP.so
Sign In
Servers

JSON Logs MCP Server

@mfreeman451

MCP server for Python JSON logs

Overview

What is JSON Logs MCP Server?

A Model Context Protocol (MCP) server that enables Claude Desktop (or any MCP client) to read and analyze JSON-formatted log files. It provides tools for searching, filtering, aggregating, and analyzing structured log data.

How to use JSON Logs MCP Server?

Clone the repository, create a virtual environment, install the package, create a wrapper script, and set the MCP_JSON_LOGS_DIR environment variable to point to your log directory. Add the server to Claude Desktop’s configuration file under mcpServers. Once configured, interact with your logs through Claude Desktop by asking questions like “Show me all ERROR logs from today” or “Group logs by level”.

Key features of JSON Logs MCP Server

  • Browse and list JSON log files with metadata
  • Search logs by level, module, function, message content, and time range
  • Aggregate log data by level, module, function, or hour
  • Get comprehensive statistics about log files
  • On-demand loading optimized for large log files

Use cases of JSON Logs MCP Server

  • Finding all ERROR and CRITICAL logs from the last hour
  • Analyzing which module generates the most warnings
  • Debugging database connection errors by examining context
  • Getting a breakdown of log levels across all files
  • Investigating authentication failures in a specific time window

FAQ from JSON Logs MCP Server

Why won't the server start?

Ensure Python 3.8+ is installed, all dependencies are installed (pip install -e .), and the log directory exists and contains .log files.

Tools are not appearing in Claude Desktop?

Restart Claude Desktop after configuration changes, check the "Connect Apps" section, look for error messages in the developer console, and verify the server shows as "Connected".

No logs are found?

Verify log files exist in the configured directory, have a .log extension, are in the correct JSON format (one JSON object per line), and contain all required fields (timestamp, level, message, module, function, line).

I get a "spawn python ENOENT" error?

Use python3 instead of python in your configuration, provide the full absolute path to the wrapper script, and ensure the wrapper script is executable (chmod +x run-json-logs-server.sh).

How are large log files handled?

Log files are loaded on-demand, not all at once. Large files (>100MB) may take a moment to process. Use the limit parameter in queries to control result size. Consider rotating log files to maintain performance.

Tags

More from Developer Tools