MCP Server#

clp-json includes an MCP server that allows AI agents–such as Claude Desktop, Cursor, and Visual Studio Code (VSCode)–to query CLP-compressed logs.

This guide explains how to configure and run CLP’s MCP server, as well as how to connect an AI agent to the MCP server.

Note

Currently, support for the MCP server is only included with clp-json (not clp-text).

Prerequisites#

This guide assumes:

  1. you can configure, start, stop, and use clp-json as described in the clp-json quick-start guide.

  2. you have an Agent installed that supports connections to MCP servers over HTTP.

Starting the MCP Server#

  1. Configure clp-json to run the MCP server by locating the mcp_server section in etc/clp-config.yaml

    #mcp_server: null
    

    then uncommenting it and specifying a host and port:

    mcp_server:
       host: "localhost"
       port: 8000
       # other settings
    

    Replace the default host and port shown above if necessary.

    Note

    If you set mcp_server: null or leave the mcp_server section commented, the MCP server won’t be started with the rest of clp-json.

  2. Start clp-json and compress the logs you want to query by following the clp-json quick-start guide. This will run the CLP MCP server on the host and port you specified in step (1).

Connecting to the MCP Server#

See one of the following guides for how to connect CLP’s MCP server to the agent of your choice.

Note

Agents sometimes ignore MCP instructions even after making the get_instructions tool call. To reduce erroneous queries from the agent, in your prompt, you can tell the agent to read the MCP instructions carefully before analyzing any logs.

Connecting Claude Desktop

Configuring Claude Desktop to connect to the CLP MCP server

mcp-claude-desktop

Connecting Cursor

Configuring Cursor to connect to the CLP MCP server

mcp-cursor

Connecting VSCode

Configuring VSCode to connect to the CLP MCP server

mcp-vscode

Limitations#

CLP currently doesn’t store time zone information in the compressed logs. This means that if the logs you compressed were not in the UTC time zone, you will need to tell your agent what time zone the logs were in originally. Support for encoding time zone information in the compressed logs will be available in a future release.