checkmatez/coralogix-mcp-server
If you are the rightful owner of coralogix-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Coralogix MCP Server is a Model Context Protocol server designed for seamless integration with Coralogix, offering robust tools for log querying and management.
log_query
Execute synchronous Dataprime queries against Coralogix logs.
log_background_query
Submit asynchronous background queries for long-running operations.
log_background_query_status
Check the status of a background query.
log_background_query_data
Retrieve results from completed background queries.
log_background_query_cancel
Cancel a running background query.
Coralogix MCP Server
A Model Context Protocol (MCP) server for Coralogix integration, currently providing tools for log querying.
Features
- Log Queries: Execute synchronous and asynchronous Dataprime queries
- Background Query Support: Submit long-running queries and retrieve results later
- Query Management: Check status, retrieve data, and cancel running queries
- CLI Interface: Full-featured command-line interface with Cobra
- Configuration Management: Flexible configuration with Viper
- Production Ready: Comprehensive error handling, logging, and testing
Quick Start
Prerequisites
- Go 1.23 or higher
- Git
- Coralogix API key
Installation
# Clone the repository
git clone https://github.com/checkmatez/coralogix-mcp-server.git
cd coralogix-mcp
# Install dependencies
make install
# Build the server
make build
Configuration
Set your Coralogix API credentials:
# Environment variables
export CORALOGIX_API_KEY="your-api-key"
export CORALOGIX_API_URL="https://api.coralogix.com" # Optional, defaults to US region
# Or use command line flags
./bin/coralogix-mcp-server stdio --api-key="your-api-key" --api-url="https://api.coralogix.com"
Usage
Run the server in stdio mode:
# Run from source (development)
make dev
# Run built binary
./bin/coralogix-mcp-server stdio
# With specific configuration
./bin/coralogix-mcp-server stdio \
--api-key="your-key" \
--enabled-toolsets="logs" \
--read-only=true
Available Tools
Log Query Tools
log_query
- Execute synchronous Dataprime queries against Coralogix logslog_background_query
- Submit asynchronous background queries for long-running operationslog_background_query_status
- Check the status of a background querylog_background_query_data
- Retrieve results from completed background querieslog_background_query_cancel
- Cancel a running background query
Example Usage
Synchronous Query
{
"tool": "log_query",
"arguments": {
"query": "source logs | filter severity == 'error' | limit 100",
"startDate": "2024-01-01T00:00:00Z",
"endDate": "2024-01-02T00:00:00Z",
"tier": "TIER_FREQUENT_SEARCH"
}
}
Background Query (for long-running queries)
// 1. Submit the query
{
"tool": "log_background_query",
"arguments": {
"query": "source logs | stats count() by severity",
"startDate": "2024-01-01T00:00:00Z",
"endDate": "2024-01-31T00:00:00Z"
}
}
// Returns: { "queryId": "abc123..." }
// 2. Check status
{
"tool": "log_background_query_status",
"arguments": {
"queryId": "abc123..."
}
}
// 3. Retrieve results when complete
{
"tool": "log_background_query_data",
"arguments": {
"queryId": "abc123..."
}
}
Development
Available Commands
make build # Build binary for current platform
make test # Run tests with coverage
make dev # Run development server
make run # Run built binary
make lint # Run linters
make check # Run all checks (fmt, vet, lint, test)
make clean # Clean build artifacts
make help # Show all available commands
Project Structure
coralogix-mcp/
āāā cmd/
ā āāā coralogix-mcp-server/ # Main server application
ā āāā main.go # CLI entry point
āāā internal/
ā āāā server/ # Core server implementation
ā āāā server.go # MCP server logic
āāā integration/ # Integration tests
ā āāā integration_test.go # Integration tests
āāā .golangci.yml # Linting configuration
āāā Makefile # Build automation
āāā go.mod # Go module file
āāā go.sum # Go module checksums
āāā README.md # This file
Running Tests
# Unit tests
make test
# Integration tests
go test ./integration/...
# With coverage
make test && open coverage.html
Environment Variables
Variable | Description | Default |
---|---|---|
CORALOGIX_API_KEY | Coralogix API key | Required |
CORALOGIX_API_URL | Coralogix API URL | https://api.coralogix.com |
LOG_LEVEL | Log level | info |
CLI Flags
Flag | Description | Default |
---|---|---|
--api-key | Coralogix API key | |
--api-url | Coralogix API URL | https://api.coralogix.com |
--enabled-toolsets | Comma-separated list of enabled toolsets | logs |
--read-only | Enable read-only mode | false |
--log-level | Log level (debug, info, warn, error) | info |
Production Deployment
Docker
# Build Docker image
docker build -t coralogix-mcp .
# Run container
docker run -e CORALOGIX_API_KEY="your-key" coralogix-mcp
Read-Only Mode
For production deployments, consider using read-only mode to prevent accidental modifications:
./bin/coralogix-mcp-server stdio --read-only=true
License
MIT