logpare

MCP Integration

Current status of the logpare MCP server, how to run it from source today, and the client configs it will use once published.

Learn how to integrate logpare with AI coding assistants via the Model Context Protocol (MCP).

UCP-Ready

@logpare/mcp is not published to npm yet. Every npx -y @logpare/mcp and npm install -g @logpare/mcp command on this page will currently fail with a registry 404. The server lives in this repository at packages/mcp — see Running it from source below for what works today. The per-client configuration blocks are kept here as a reference for when the package ships.

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.


Running it from source

Until the package is published, clone the monorepo and build the server, then point your client at the built entry point by absolute path.

git clone https://github.com/logpare/logpare.git
cd logpare
pnpm install
pnpm build                              # builds the logpare library it depends on
pnpm --filter @logpare/mcp build        # builds packages/mcp/dist

Verify the build:

node packages/mcp/dist/cli.js --test

Then use an absolute path in any client config that would otherwise call npx:

{
  "mcpServers": {
    "logpare": {
      "command": "node",
      "args": ["/absolute/path/to/logpare/packages/mcp/dist/cli.js"]
    }
  }
}

Every config block below works the same way: replace "command": "npx" and the "-y", "@logpare/mcp" arguments with the pair above, and keep whatever optional flags that block already had. A block showing --ucp keeps --ucp; a basic block stays basic.


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

Defaults are set with CLI flags, not environment variables:

{
  "mcpServers": {
    "logpare": {
      "command": "npx",
      "args": ["-y", "@logpare/mcp", "--ucp", "--format", "detailed", "--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

These npx forms will fail until the package is published — use the source build below.

# 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

Working today, from a local build:

claude mcp add logpare -s user -- node /absolute/path/to/logpare/packages/mcp/dist/cli.js

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"]
    }
  }
}

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
  --version, -v       Show version

--depth must be between 2 and 8 and --threshold between 0.0 and 1.0; the server exits with an error otherwise. There are no LOGPARE_MCP_* environment variables — these flags are the only way to change the defaults.


Troubleshooting

Server Not Appearing

  1. Verify JSON syntax is valid
  2. Restart the client application completely
  3. While the package is unpublished, npx @logpare/mcp cannot resolve — use the absolute path from Running it from source
  4. Run node packages/mcp/dist/cli.js --test to verify the build

Tools Not Working

  1. Check client's MCP logs for errors
  2. Verify the server is connected (look for status indicators)
  3. Rebuild after pulling: pnpm --filter @logpare/mcp build

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