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).
UCP-ReadyOverview
logpare provides an MCP server that exposes log compression capabilities as tools for AI assistants. This enables AI agents to:
- Compress large log files before analysis
- Extract patterns from application logs
- Estimate compression ratios
- Process UCP checkout and A2A logs (with
--ucpflag)
Supported Clients
| Client | Transport | Config Location |
|---|---|---|
| Claude Desktop | stdio | claude_desktop_config.json |
| Claude Code (CLI) | stdio | ~/.claude.json |
| Cursor | stdio | ~/.cursor/mcp.json |
| VS Code + Copilot | stdio | .vscode/mcp.json |
| Windsurf | stdio | ~/.codeium/windsurf/mcp_config.json |
| ChatGPT | HTTP* | Settings → Connectors |
| Gemini | stdio | ~/.config/gcloud/mcp-config.json |
Note: @logpare/mcp currently supports stdio transport only. Clients marked with * require hosting the MCP server with an HTTP adapter.
Claude Desktop
Configuration File Locations
| Platform | Path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
Basic Configuration
{
"mcpServers": {
"logpare": {
"command": "npx",
"args": ["-y", "@logpare/mcp"]
}
}
}With UCP Extension
{
"mcpServers": {
"logpare": {
"command": "npx",
"args": ["-y", "@logpare/mcp", "--ucp"]
}
}
}With Custom Settings
{
"mcpServers": {
"logpare": {
"command": "npx",
"args": ["-y", "@logpare/mcp", "--ucp"],
"env": {
"LOGPARE_MCP_FORMAT": "detailed",
"LOGPARE_MCP_DEPTH": "5"
}
}
}
}Setup Steps
- Open Claude Desktop → Settings (or Claude menu → Settings)
- Navigate to Developer tab
- Click Edit Config
- Add the configuration above
- Save and restart Claude Desktop completely
Verify Installation
After restart, look for the MCP server indicator (hammer icon) in the bottom-right corner of the input box.
Claude Code (CLI)
Add via CLI
# Basic installation
claude mcp add logpare -s user -- npx -y @logpare/mcp
# With UCP extension
claude mcp add logpare -s user -- npx -y @logpare/mcp --ucpConfiguration File
Edit ~/.claude.json:
{
"mcpServers": {
"logpare": {
"command": "npx",
"args": ["-y", "@logpare/mcp", "--ucp"]
}
}
}Verify Installation
claude mcp list
# or use /mcp in a conversation to check statusCursor
Configuration File Locations
| Scope | Path |
|---|---|
| Global | ~/.cursor/mcp.json |
| Project | .cursor/mcp.json (in project root) |
stdio Configuration
{
"mcpServers": {
"logpare": {
"command": "npx",
"args": ["-y", "@logpare/mcp", "--ucp"]
}
}
}With Environment Variables
{
"mcpServers": {
"logpare": {
"command": "npx",
"args": ["-y", "@logpare/mcp"],
"env": {
"LOGPARE_MCP_FORMAT": "${env:LOGPARE_FORMAT}"
}
}
}
}Variable Interpolation
Cursor supports these variables:
${env:NAME}— environment variables${userHome}— home directory${workspaceFolder}— project root
VS Code + GitHub Copilot
Requires: VS Code 1.102+ with GitHub Copilot
Configuration File Locations
| Scope | Path |
|---|---|
| Workspace | .vscode/mcp.json |
| Global | User profile (via Command Palette) |
Configuration Format
{
"servers": {
"logpare": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@logpare/mcp", "--ucp"]
}
}
}Setup via Command Palette
- Open Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Run MCP: Add Server
- Select Command (stdio)
- Enter:
- Command:
npx - Arguments:
-y @logpare/mcp --ucp - Name:
logpare
- Command:
- Select scope (Workspace or Global)
Start the Server
- Open
.vscode/mcp.json - Click the Start button at the top
- Server tools will be discovered automatically
Windsurf
Configuration File Location
| Platform | Path |
|---|---|
| macOS/Linux | ~/.codeium/windsurf/mcp_config.json |
| Windows | %USERPROFILE%\.codeium\windsurf\mcp_config.json |
Configuration
{
"mcpServers": {
"logpare": {
"command": "npx",
"args": ["-y", "@logpare/mcp", "--ucp"]
}
}
}Setup via UI
- Open Windsurf Settings
- Select Manage MCPs
- Click View raw config to edit
mcp_config.json - Add the configuration above
- Restart Windsurf
ChatGPT
Requires: ChatGPT Pro or Plus account
Setup Steps
- Enable Developer Mode: Settings → Connectors → Advanced settings
- Open Settings → Connectors tab
- Click Create new connector
- Configure:
- Name:
logpare - MCP server URL: Your hosted logpare MCP endpoint
- Authentication: As required
- Name:
Note: ChatGPT requires an HTTP endpoint. For local usage, you'll need to host the MCP server with HTTP transport.
Gemini Code Assist
Configuration File
Edit ~/.config/gcloud/mcp-config.json:
{
"servers": {
"logpare": {
"command": "npx",
"args": ["-y", "@logpare/mcp", "--ucp"]
}
}
}Setup Steps
- Add configuration to
mcp-config.json - Restart your IDE
- Tools will be available in Gemini Code Assist
Available Tools
Core Tools
| Tool | Description |
|---|---|
compress_logs | Compress log lines with format/depth/threshold options |
compress_text | Compress multi-line text |
analyze_patterns | Quick pattern extraction |
estimate_compression | Sample-based compression estimate |
UCP Tools (--ucp flag)
| Tool | Description |
|---|---|
compress_checkout_logs | UCP checkout session compression |
analyze_checkout_errors | Error pattern analysis with suggestions |
compress_a2a_logs | Agent-to-Agent log compression |
Tool Reference
compress_logs
Compress an array of log lines with full options.
{
lines: string[]; // Log lines to compress
format?: 'summary' | 'detailed' | 'json';
depth?: number; // Default: 4
simThreshold?: number; // Default: 0.4
maxTemplates?: number; // Default: 50
}compress_text
Compress multi-line log text.
{
text: string; // Multi-line log text
format?: 'summary' | 'detailed' | 'json';
depth?: number;
simThreshold?: number;
maxTemplates?: number;
}analyze_patterns
Extract patterns without full compression (faster).
{
lines: string[];
maxPatterns?: number; // Default: 20
}estimate_compression
Quick compression ratio estimate from sample.
{
lines: string[];
sampleSize?: number; // Default: 1000
}compress_checkout_logs (UCP)
Compress UCP checkout session logs.
{
lines: string[];
session_id?: string; // Filter by session ID (cs_*)
preserve_errors?: boolean; // Default: true
format?: 'summary' | 'detailed' | 'json' | 'ucp_json';
}analyze_checkout_errors (UCP)
Analyze UCP checkout error patterns.
{
lines: string[];
include_suggestions?: boolean; // Default: true
group_by?: 'error_code' | 'severity' | 'session' | 'time';
}compress_a2a_logs (UCP)
Compress Agent-to-Agent communication logs.
{
lines: string[];
group_by_agent?: boolean;
preserve_handoffs?: boolean;
trace_id?: string;
}CLI Options
npx @logpare/mcp [options]
Options:
--ucp, -u Enable UCP extension
--format, -f Default format (summary|detailed|json)
--depth, -d Parse tree depth (2-8, default: 4)
--threshold, -t Similarity threshold (0.0-1.0, default: 0.4)
--max-lines, -m Max lines per request (default: 100000)
--test Run self-test
--help, -h Show helpEnvironment Variables
| Variable | Description | Default |
|---|---|---|
LOGPARE_MCP_FORMAT | Default output format | summary |
LOGPARE_MCP_DEPTH | Drain algorithm depth | 4 |
LOGPARE_MCP_THRESHOLD | Similarity threshold | 0.4 |
LOGPARE_MCP_MAX_LINES | Max lines per request | 100000 |
Troubleshooting
Server Not Appearing
- Verify JSON syntax is valid
- Restart the client application completely
- Check that
npxis available in PATH - Run
npx @logpare/mcp --testto verify installation
Tools Not Working
- Check client's MCP logs for errors
- Verify the server is connected (look for status indicators)
- Ensure you have the latest version:
npm update -g @logpare/mcp
Performance Issues
- Reduce
maxTemplatesparameter - Use
estimate_compressionfor large files first - Process logs in smaller batches
- Increase
simThresholdfor fewer templates
Security Best Practices
- Local processing: MCP runs locally—logs stay on your machine
- PII masking: Ensure sensitive data is masked before compression
- Review output: Check compressed output before sharing
- Trusted sources: Only install MCP servers from trusted sources