Get the FREE Ultimate OpenClaw Setup Guide →

logchef

MCP server for Logchef

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio mr-karan-logchef-mcp node path/to/server.js \
  --env LOGCHEF_DEBUG="false" \
  --env LOGCHEF_BASE_URL="https://your-logchef-instance" \
  --env LOGCHEF_API_TOKEN="your-logchef-api-token"

How to use

The Logchef MCP Server bridges AI assistants with your Logchef deployment, enabling natural-language-style interactions for log exploration, querying, and administration. It exposes tools categorized into Profile & Metadata, Source Management, Log Analysis, and Administration. With these tools, AI agents can retrieve your profile and team information, list and inspect log sources, execute ClickHouse SQL queries against log sources, fetch schemas, generate histograms and time-series data, manage saved query collections, and administer teams, users, sources, and API tokens (with appropriate admin privileges). To use the server, configure your environment with your Logchef API token and base URL, then run the server process. The AI assistant can then invoke tools such as get_profile, get_sources, query_logs, get_source_schema, get_log_histogram, create_collection, and various admin operations depending on your permissions. You can enable or disable entire tool categories using flags like --disable-admin to tailor capabilities to your needs.

How to install

Prerequisites:

  • A running Logchef instance with an API token
  • Node.js installed (LTS version)
  1. Prepare the environment
  • Set required environment variables (replace placeholders with your actual values):
  1. Acquire the MCP server code
  • Clone or download the Logchef MCP server repository to your machine.
  1. Install dependencies
  • In the project directory:
    • npm install
  1. Run the MCP server
  • Start the server (adjust the path to your actual entry file if needed):
    • node path/to/server.js
  1. Alternative run methods
  • If the project publishes an npm package, you might use:
    • npm i -g your-logchef-mcp-package
    • your-start-command (as documented in the package)
  1. Verify operation
  • Check logs for an indication that the MCP server is listening and ready to accept MCP requests.
  • Use a client tool or your AI assistant to invoke tools such as get_profile, get_sources, query_logs, or get_log_histogram to verify integration.

Additional notes

Tips and notes:

  • Ensure the Logchef instance URL and API token have appropriate permissions for the actions you intend to perform.
  • Use the --disable-<category> flags to reduce available tools if you want a more restricted setup (e.g., --disable-admin to hide admin tools).
  • Expose only necessary endpoints behind secure access and consider network restrictions to protect your Logchef data.
  • If you encounter authentication errors, double-check that LOGCHEF_API_TOKEN is correctly set and that the token has not expired.
  • For large query workloads, monitor ClickHouse load and consider using get_log_histogram to sample data before running heavy queries.
  • Store credentials securely (e.g., using a secret manager) rather than embedding them in code or config files.
  • Review tool descriptions in the README to understand required parameters (e.g., get_sources vs get_team_sources) before invoking them.

Related MCP Servers

Sponsor this space

Reach thousands of developers