Natural Language Queries
Ask AI assistants to query your logs using plain English. No need to remember SQL syntax or field names.
The LogChef MCP server enables AI assistants to interact with your LogChef deployment through the Model Context Protocol. This integration makes log analysis and troubleshooting accessible through natural conversation with AI assistants like Claude Desktop.
Natural Language Queries
Ask AI assistants to query your logs using plain English. No need to remember SQL syntax or field names.
Schema Discovery
AI assistants can explore your log structure and understand what data is available in your sources.
Team Management
Manage teams, users, and source access through conversational AI interaction.
Saved Query Collections
Create and organize frequently-used queries through AI assistance.
With the LogChef MCP server, you can ask AI assistants to help you:
Here are some examples of how you might interact with AI assistants through the MCP server:
Discovery:
“What log sources do I have access to?”
Troubleshooting:
“Find all 500 errors in the last hour from the web service logs”
Analysis:
“Show me a histogram of log volume over the past day”
Investigation:
“What are the most common error messages in the database logs?”
Query Management:
“Create a saved query for tracking API response times above 1 second”
For most users, Docker provides the easiest setup:
# Pull the latest imagedocker pull logchef-mcp
# For Claude Desktop integration (STDIO mode)docker run --rm -i \ -e LOGCHEF_URL=http://localhost:8125 \ -e LOGCHEF_API_KEY=<your_api_token> \ logchef-mcp -t stdio
Download the latest release from the releases page and place it in your $PATH
.
If you have Go installed:
git clone https://github.com/mr-karan/logchef-mcp.gitcd logchef-mcpgo build -o logchef-mcp ./cmd/logchef-mcp
Add the MCP server to your Claude Desktop configuration:
Using Docker:
{ "mcpServers": { "logchef": { "command": "docker", "args": [ "run", "--rm", "-i", "-e", "LOGCHEF_URL", "-e", "LOGCHEF_API_KEY", "logchef-mcp", "-t", "stdio" ], "env": { "LOGCHEF_URL": "http://localhost:8125", "LOGCHEF_API_KEY": "<your_api_token>" } } }}
Using Binary:
{ "mcpServers": { "logchef": { "command": "logchef-mcp", "args": [], "env": { "LOGCHEF_URL": "http://localhost:8125", "LOGCHEF_API_KEY": "<your_api_token>" } } }}
The MCP server provides tools organized into categories that can be selectively enabled:
get_profile
- Get current user informationget_teams
- List user’s team membershipsget_meta
- Get server version and metadataget_sources
- List all accessible log sourcesget_team_sources
- List sources for a specific teamquery_logs
- Execute ClickHouse SQL queriesget_source_schema
- Get table schema informationget_log_histogram
- Generate histogram dataget_collections
- List saved query collectionscreate_collection
- Create new saved queriesupdate_collection
- Modify existing collectionsdelete_collection
- Remove saved queriesThe MCP server supports multiple transport modes:
Direct integration with AI assistants like Claude Desktop:
logchef-mcp -t stdio
Run as HTTP server for web-based clients:
logchef-mcp -t sse
Independent server for multiple client connections:
logchef-mcp -t streamable-http
You can selectively enable tool categories:
# Enable only profile and log analysis toolslogchef-mcp --enabled-tools "profile,logs"
# Disable admin toolslogchef-mcp --disable-admin
Available categories: profile
, sources
, logs
, admin
export LOGCHEF_URL=http://localhost:8125export LOGCHEF_API_KEY=your_token_here
For server modes, credentials can be passed via headers:
X-Logchef-URL
: LogChef instance URLX-Logchef-API-Key
: API tokenEnable detailed logging for troubleshooting:
logchef-mcp -debug
This provides HTTP request/response logging between the MCP server and LogChef API.
The MCP server enables powerful natural language interactions:
get_sources
get_source_schema
Troubleshooting:
“Find all 500 errors in the last hour from the web service logs”
Analysis:
“Show me a histogram of log volume over the past day grouped by service”
Investigation:
“What are the most common error messages in logs containing ‘database’?”
Monitoring:
“Create a saved query for tracking API response times above 2 seconds”
The AI assistant understands ClickHouse SQL and can help you:
Since LogChef uses ClickHouse as the storage backend, you get the full power of ClickHouse’s analytical capabilities through natural language interaction.
Connection Errors:
LOGCHEF_URL
is correct and accessiblePermission Errors:
Tool Availability:
Use debug mode to see detailed HTTP interactions:
logchef-mcp -debug -t stdio
The LogChef MCP server is open source and available at: https://github.com/mr-karan/logchef-mcp
Contributions are welcome! The project includes:
For development setup and contribution guidelines, see the repository documentation.