MCP Integration
Integrate logpare with AI coding assistants via the Model Context Protocol
Learn how to integrate logpare with AI coding assistants via the Model Context Protocol (MCP).
Overview
logpare provides an MCP server that exposes log compression capabilities as tools for AI assistants like Claude Desktop. This enables AI agents to:
- Compress large log files before analysis
- Extract patterns from application logs
- Estimate compression ratios
- Process logs incrementally
Installation
Global Installation
Install the MCP server globally:
Local Installation
Or install in a project:
Claude Desktop Configuration
Add the logpare MCP server to Claude Desktop's configuration.
macOS
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
Windows
Edit %APPDATA%\Claude\claude_desktop_config.json:
Linux
Edit ~/.config/Claude/claude_desktop_config.json:
Verify Installation
Restart Claude Desktop and check that the logpare tools are available:
- Open Claude Desktop
- Start a new conversation
- Type
/toolsto see available tools - Look for
compress_logs,analyze_log_patterns, etc.
Available Tools
compress_logs
Compress an array of log lines with full options.
Parameters:
Example Usage:
analyze_log_patterns
Extract patterns without full compression (faster for quick analysis).
Parameters:
estimate_compression
Quick estimate of compression ratio without full processing.
Parameters:
Usage Examples
Basic Log Analysis
User prompt:
Claude's approach:
- Calls
compress_logswith default settings - Analyzes the compressed templates
- Identifies error patterns and frequencies
- Provides actionable insights
Comparing Log Files
User prompt:
Claude's approach:
- Calls
compress_logsfor each file - Compares template sets
- Identifies new patterns, removed patterns, frequency changes
Performance Investigation
User prompt:
Claude's approach:
- Calls
compress_logswithformat: 'detailed' - Examines
durationSamplesin templates - Identifies patterns with high latency
- Suggests optimizations
Configuration Options
Custom MCP Server Settings
You can configure the MCP server with environment variables or a config file.
Create .logpare-mcp.json in your home directory:
Environment Variables
Update your Claude Desktop config:
Best Practices
1. Start with Compression Estimates
For very large files, estimate first:
2. Use Appropriate Formats
- summary: Quick overview of main patterns
- detailed: Deep analysis with metadata
- json: When you need programmatic access
3. Tune Parameters for Log Type
Ask Claude to adjust based on your logs:
4. Leverage Metadata
Extract specific information from templates:
Troubleshooting
MCP Server Not Appearing
- Check Claude Desktop config syntax (valid JSON)
- Restart Claude Desktop completely
- Check MCP server logs:
macOS/Linux:
Windows:
Tools Not Working
- Verify
@logpare/mcpis installed:
- Test the server directly:
- Check for error messages in Claude Desktop
Performance Issues
If compression is slow:
- Reduce
maxTemplatesin requests - Use
estimate_compressionfirst for large files - Process in smaller batches
- Increase
simThresholdto create fewer templates
Security Considerations
Sensitive Data
Be cautious when sharing logs with AI assistants:
- PII Masking: Ensure sensitive data is masked
- Custom Patterns: Add patterns for proprietary IDs
- Local Processing: MCP runs locally - logs stay on your machine
- Review Output: Check compressed output before sharing