MCP Log Analyzer
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., "@MCP Log AnalyzerRead logs from sample_logs and show me any errors"
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.
📊 MCP Log Analyzer
An intelligent log file analyzer powered by Python and integrated with Cursor IDE through the Model Context Protocol (MCP).
🎯 What It Does
Analyzes log files instantly using AI-powered tools. Instead of manually searching through thousands of log lines, ask questions in natural language and get instant insights about errors, patterns, and anomalies.
Before vs After
Before (❌):
Manually open and search log files
Hours of tedious analysis
Error-prone manual work
After (✅):
Ask Claude in natural language
Get instant analysis in seconds
Automatic pattern detection
AI-powered insights
Related MCP server: Local Logs MCP Server
🛠️ Features
6 Analysis Tools
read_logs - Fetch and display log content
count_log_types - Count logs by severity (INFO, ERROR, WARNING, CRITICAL)
generate_statistics - Analyze patterns and detect anomalies
extract_critical_logs - Extract only critical issues
detect_anomalies - Find unusual activity and spikes
generate_report - Create formatted HTML/text reports
🚀 Quick Start
1. Clone Repository
git clone https://github.com/BBashh/log_file_mcp.git
cd log_file_mcp2. Set Up Virtual Environment
# Windows
python -m venv venv
venv\Scripts\activate# Mac/Linux
python3 -m venv venv
source venv/bin/activate3. Install Dependencies
pip install -r requirements.txt4. Test Locally
python mcp_server.py
# Should show: "Log Analyzer MCP Server starting..."
# Press Ctrl+C to stop5. Configure Cursor IDE
Update your mcp.json file:
Location: C:\Users\[YourUsername]\AppData\Roaming\Cursor\User\settings\mcp.json
{
"mcpServers": {
"log-analyzer": {
"command": "[FULL_PATH_TO_VENV]\\venv\\Scripts\\python.exe",
"args": ["[FULL_PATH_TO_PROJECT]\\mcp_server.py"]
}
}
}6. Use in Cursor
Restart Cursor IDE
Look for green dot in Tools & MCP
Ask questions in Cursor chat:
"Read logs from sample_logs"
"How many errors are there?"
"Generate a report"
🔧 Configuration
Edit `config.py` to customize:
DEFAULT_LOG_DIR = "C:\\path\\to\\logs" # Your log directory
LOG_LEVELS = ["CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG"]
STATS_CONFIG = {
"min_line_length": 5,
"max_line_length": 1000,
"rare_threshold": 0.01,
}📝 Usage Examples
In Cursor Chat:
NOTE: If the chat is giving responses without using the mcp tool, then explicitly mention in the chat to use the xyz tool.
Ex:
Read logs:
Read the logs from sample_logs and show me the last 10 lines using the read_logs mcp toolCount by type:
How many INFO, WARNING, and ERROR logs are there using `xyz` tool?Get statistics:
Analyze the logs for patterns and anomalies using `xyz` toolExtract critical:
Show me all critical logs only using `xyz` toolGenerate report:
Create a comprehensive analysis report of the logs using `xyz` tool.Ex:
🏛️ Technical Details
Technologies
FastMCP - MCP server framework
Python 3.x - Programming language
Cursor IDE - IDE integration
JSON-RPC - Communication protocol
Design Patterns
MVC Pattern - Separation of concerns
Factory Pattern - Tool creation
Observer Pattern - Event handling
Singleton Pattern - Config management
Key Features
Modular architecture (easy to extend)
Error handling and validation
Configuration management
Report generation (HTML/Text)
Pattern detection
Anomaly detection
🔐 Security Notes
Server runs locally only (no internet exposure)
Log files processed in memory
No data stored externally
Compatible with confidential logs
🐛 Troubleshooting
Green dot not showing?
Check mcp.json has correct paths
Verify venv Python path is correct
Restart Cursor completely
"Module not found" error?
Make sure venv is activated
Run: pip install -r requirements.txt
Tools not responding?
Verify server running: python mcp_server.py
Check sample_logs/sample.log exists
Restart Cursor and try again
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
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/BBashh/log_file_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server