AI-powered log access for smarter debugging and analysis
π Log Reader Mcp
π Stop wasting time copy-pasting logs! π§ Let Cursor's AI instantly access, search, and explain your logs β no more manual work, just answers.
π Table of Contents
- Why Log Reader Mcp?
- Installation
- Who is it for?
- MCP Configuration
- Example Prompts for Cursor
- CLI Usage
- Log Format (JSON per line)
- Developer Guide
- Key Advantages
- FAQ
- Getting Help
- Contributing
- License
- Cursor Rule (Workflow)
β¨ Why Log Reader Mcp?
- π€ AI-powered log access: Give your AI assistant (Cursor, etc.) direct, on-demand access to your app logs.
- π§ Smarter debugging: Let the AI analyze, summarize, and explain logs as you code.
- β±οΈ Save hours: No more switching terminals, tailing files, or hunting for errorsβget instant feedback and context.
- π‘οΈ Safe & isolated: Never pollutes your project, robust CLI and test coverage.
- β‘ Plug & Play: One command, zero config, works everywhere.
π€ Who is it for?
- Backend & frontend developers
- DevOps & SREs
- Teams using AI-powered editors (Cursor, etc.)
- Anyone who wants faster, smarter log analysis!
π¦ Installation
π Automatic (recommended)
npx log-reader-mcp init
- Installs everything, creates
.cursor/mcp.jsonand workflow rules, and sets up your logs folder automatically.
π οΈ Manual
Install the package
npm install --save-dev log-reader-mcpCreate the config file
- At the root of your project, create a folder named
.cursor(if it doesn't exist). - Inside
.cursor/, create a file namedmcp.jsonwith:
{ "mcpServers": { "log-reader-mcp": { "command": "npx", "args": ["-y", "log-reader-mcp"] } }, "mcp.enabled": true, "mcp.autoStart": true, "mcp.showStatusBar": true, "mcp.logLevel": "info" }- This tells your editor (Cursor, VSCode, etc.) how to launch and connect to the log reader mcp server for your project.
- At the root of your project, create a folder named
πΌοΈ What does it do?
Log Reader Mcp exposes your application's logs to your AI assistant/editor (like Cursor) via the Model Control Protocol (MCP). This means:
- The AI can read, filter, and analyze your logs on demand (not streaming)
- You can ask the AI to fetch logs for a specific period, number of lines, error level, etc.
- Makes onboarding, debugging, and incident response dramatically faster
π§ Key Features
- Simplified Interface: No
logPathparameter needed - always useslogs/logs.login your working directory - Automatic Detection: The server automatically finds and reads your log file
- Time-based Filtering: Filter logs by specific time ranges using ISO 8601 format
- Line-based Reading: Read the last N lines with automatic validation
- Structured JSON: Full support for structured logging with metadata
π‘ Example Prompts for Cursor
Here are some real-world prompts you can use in Cursor (or any MCP-enabled AI) to interact with your logs:
| Use Case | Example Prompt to Cursor AI |
|---|---|
| π’ Last N logs | Show me the last 100 log entries |
| π Logs by time | Get all logs between 2024-06-01 and 2024-06-02 |
| β© Logs since date | Show all logs since 2024-06-01 |
| π¨ Errors only | Show only ERROR or CRITICAL logs from the last 50 entries |
| π Search message | Find all logs containing "database connection failed" |
| π§βπ» User-specific | Show all logs for user_id 12345 in the last 24 hours |
| π Summary | Summarize the main issues found in today's logs |
| π§Ή Clear context | Clear the log context and start a new analysis |
Note: The tool automatically uses
logs/logs.login your current working directory. ThelogPathparameter has been removed for maximum simplicity - no need to specify any file path!
Tip: You can combine filters, time ranges, and keywords in your prompts. The AI will use Log Reader Mcp to fetch and analyze the relevant log data for you!
π‘ Use Cases
| Use Case | How Log Reader Mcp Helps | Time Saved
Tools (1)
read_logsReads and filters application logs from logs/logs.logConfiguration
{"mcpServers": {"log-reader-mcp": {"command": "npx", "args": ["-y", "log-reader-mcp"]}}}