logpare

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-Ready

Overview

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 --ucp flag)

Supported Clients

ClientTransportConfig Location
Claude Desktopstdioclaude_desktop_config.json
Claude Code (CLI)stdio~/.claude.json
Cursorstdio~/.cursor/mcp.json
VS Code + Copilotstdio.vscode/mcp.json
Windsurfstdio~/.codeium/windsurf/mcp_config.json
ChatGPTHTTP*Settings → Connectors
Geministdio~/.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

PlatformPath
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

  1. Open Claude Desktop → Settings (or Claude menu → Settings)
  2. Navigate to Developer tab
  3. Click Edit Config
  4. Add the configuration above
  5. 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 --ucp

Configuration 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 status

Cursor

Configuration File Locations

ScopePath
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

ScopePath
Workspace.vscode/mcp.json
GlobalUser profile (via Command Palette)

Configuration Format

{
  "servers": {
    "logpare": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@logpare/mcp", "--ucp"]
    }
  }
}

Setup via Command Palette

  1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Run MCP: Add Server
  3. Select Command (stdio)
  4. Enter:
    • Command: npx
    • Arguments: -y @logpare/mcp --ucp
    • Name: logpare
  5. Select scope (Workspace or Global)

Start the Server

  1. Open .vscode/mcp.json
  2. Click the Start button at the top
  3. Server tools will be discovered automatically

Windsurf

Configuration File Location

PlatformPath
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

  1. Open Windsurf Settings
  2. Select Manage MCPs
  3. Click View raw config to edit mcp_config.json
  4. Add the configuration above
  5. Restart Windsurf

ChatGPT

Requires: ChatGPT Pro or Plus account

Setup Steps

  1. Enable Developer Mode: Settings → Connectors → Advanced settings
  2. Open Settings → Connectors tab
  3. Click Create new connector
  4. Configure:
    • Name: logpare
    • MCP server URL: Your hosted logpare MCP endpoint
    • Authentication: As required

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

  1. Add configuration to mcp-config.json
  2. Restart your IDE
  3. Tools will be available in Gemini Code Assist

Available Tools

Core Tools

ToolDescription
compress_logsCompress log lines with format/depth/threshold options
compress_textCompress multi-line text
analyze_patternsQuick pattern extraction
estimate_compressionSample-based compression estimate

UCP Tools (--ucp flag)

ToolDescription
compress_checkout_logsUCP checkout session compression
analyze_checkout_errorsError pattern analysis with suggestions
compress_a2a_logsAgent-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 help

Environment Variables

VariableDescriptionDefault
LOGPARE_MCP_FORMATDefault output formatsummary
LOGPARE_MCP_DEPTHDrain algorithm depth4
LOGPARE_MCP_THRESHOLDSimilarity threshold0.4
LOGPARE_MCP_MAX_LINESMax lines per request100000

Troubleshooting

Server Not Appearing

  1. Verify JSON syntax is valid
  2. Restart the client application completely
  3. Check that npx is available in PATH
  4. Run npx @logpare/mcp --test to verify installation

Tools Not Working

  1. Check client's MCP logs for errors
  2. Verify the server is connected (look for status indicators)
  3. Ensure you have the latest version: npm update -g @logpare/mcp

Performance Issues

  1. Reduce maxTemplates parameter
  2. Use estimate_compression for large files first
  3. Process logs in smaller batches
  4. Increase simThreshold for fewer templates

Security Best Practices

  1. Local processing: MCP runs locally—logs stay on your machine
  2. PII masking: Ensure sensitive data is masked before compression
  3. Review output: Check compressed output before sharing
  4. Trusted sources: Only install MCP servers from trusted sources

See Also