Betterstack Logs MCP Server
Connects to a ClickHouse query endpoint to run structured SQL queries against log data, with support for filtering, time ranges, and schema inspection (e.g. query_logs, debug_table_info).
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Betterstack Logs MCP Server
An MCP (Model Context Protocol) server that enables AI assistants to query and analyze logs from Betterstack. Supports querying across multiple sources and source groups with intelligent source selection.
Features
Multi-source querying: Query individual sources or source groups
Source management: Discover and inspect available sources and groups
Query tools: Execute structured ClickHouse SQL queries with intelligent filtering
Historical data: Access both recent and archived logs
AI-friendly: Intelligent source selection based on query context
Related MCP server: aliyun-sls-mcp
Quick Start with NPX (Recommended)
The easiest way to use this MCP server is via NPX - no installation required!
1. Add to Claude Code Configuration
Add this to your Claude Code MCP configuration file:
{
"mcpServers": {
"betterstack": {
"command": "npx",
"args": ["-y", "@blaze-money/betterstack-logs-mcp"],
"env": {
"BETTERSTACK_API_TOKEN": "your-api-token-here",
"BETTERSTACK_CLICKHOUSE_USERNAME": "your-clickhouse-username",
"BETTERSTACK_CLICKHOUSE_PASSWORD": "your-clickhouse-password",
"BETTERSTACK_CLICKHOUSE_QUERY_ENDPOINT": "your-clickhouse-endpoint"
}
}
}
}2. Get Your Credentials
API Token: Get from BetterStack API settings
ClickHouse credentials: Available in your BetterStack team settings under "Log destinations"
3. Restart Claude
Restart Claude Code to load the new MCP server. The server will be automatically downloaded and started via NPX.
Local Development Installation
If you want to develop or modify the server locally:
Clone this repository
Install dependencies:
npm installBuild the project:
npm run buildConfigure environment variables (see Configuration section)
Configuration
Environment Variables
Betterstack requires two different authentication methods:
Copy .env.example to .env and configure:
# ClickHouse Database Credentials (for log queries)
BETTERSTACK_CLICKHOUSE_USERNAME=your_clickhouse_username
BETTERSTACK_CLICKHOUSE_PASSWORD=your_clickhouse_password
BETTERSTACK_CLICKHOUSE_QUERY_ENDPOINT=your_clickhouse_endpoint_url
# API Token (for source management)
BETTERSTACK_API_TOKEN=your_api_token_from_betterstack_dashboard
# Optional
BETTERSTACK_DEFAULT_SOURCE_GROUP=productionGetting Your Credentials:
ClickHouse Credentials (for log queries):
In Betterstack dashboard: Dashboards → Connect remotely → Create connection
Save the generated username, password, and endpoint URL
API Token (for source management):
Go to Betterstack API Tokens
Select your team
Create or copy an existing Telemetry API token
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"betterstack": {
"command": "npx",
"args": ["-y", "@blaze-money/betterstack-logs-mcp"],
"env": {
"BETTERSTACK_CLICKHOUSE_USERNAME": "your_clickhouse_username",
"BETTERSTACK_CLICKHOUSE_PASSWORD": "your_clickhouse_password",
"BETTERSTACK_CLICKHOUSE_QUERY_ENDPOINT": "your_clickhouse_endpoint_url",
"BETTERSTACK_API_TOKEN": "your_api_token_here",
"BETTERSTACK_DEFAULT_SOURCE_GROUP": "production"
}
}
}
}Available Tools
Source Management
list_sources: Get all available log sourceslist_source_groups: Get configured source groupsget_source_info: Get details about a specific sourceget_source_group_info: Get details about a source group
Query Tools
query_logs: Execute structured log queries with filtering and time range supportdebug_table_info: Inspect source table schemas and query generation
Usage Examples
# List available sources
AI: What sources do we have?
# Query recent logs with filtering
AI: Show me ERROR level logs from the last hour in production
# Query specific time range
AI: Show me all logs from yesterday between 2pm and 4pm
# Get source group details
AI: What's included in our production source group?Development
npm run dev # Watch mode
npm run build # Build for productionLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Query your Logspot analytics, companies, and revenue from any AI assistant, and run your actions.
Manage uptime monitors and incidents and search logs, metrics and traces from an AI assistant.
Lets AI agents analyze API metrics, request logs, and traces, and manage apps and alerts.
Query your app's logs, metrics and incidents, and set Rudow up, from your AI assistant.
Related MCP Servers
- AlicenseDqualityBmaintenanceIntegrates AI assistants with Graylog to query and analyze log data using Elasticsearch syntax and stream-specific filtering. It enables users to perform advanced searches, retrieve log statistics, and manage Graylog streams through natural language.912MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to query and analyze Alibaba Cloud SLS logs using natural language, supporting multiple log sources like Function Compute and ECS. It provides tools for searching logs, performing SQL analysis, and visualizing log distributions directly within Cursor or Claude.677 npm11MIT

tailpipe-mcpofficial
AlicenseNot gradedqualityDmaintenanceConnects AI assistants to cloud and SaaS logs via Tailpipe, enabling natural language querying and analysis of log data.7Apache 2.0- AlicenseAqualityCmaintenanceEnables MCP-capable AI clients to search ClickHouse logs, browse instances, databases, and tables, and inspect log histograms directly from a chat.71MIT