logflare-mcp
Supports executing SQL queries against ClickHouse via the Logflare Management API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@logflare-mcp list all sources"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
logflare-mcp
MCP server for the Logflare Management API. Exposes sources, endpoints, and ad-hoc SQL query tools to MCP clients (Claude Code, Claude Desktop, Cursor, …) over stdio.
Built on the official @modelcontextprotocol/sdk and talks directly to the public
Logflare REST API — no third-party auth proxy.
Tools
Tool | Description |
| List all sources available to the API key |
| Fetch a single source by token |
| Inferred field types for a source |
| Most recent events from a source |
| Saved query endpoints |
| Run a saved endpoint by UUID or name, with parameters |
| Run ad-hoc BigQuery / Postgres / ClickHouse SQL |
Related MCP server: Sumo Logic MCP Server
Install
git clone git@github.com:fasterv410/logflare-mcp.git
cd logflare-mcp
pnpm install
pnpm buildConfigure
Get your Logflare API key from https://logflare.app/access-tokens.
cp .env.example .env
# edit .env and paste your keyVariable | Required | Default | Notes |
| yes | — | Access token |
| no |
| For self-hosted Logflare |
| no |
| Use |
| no | — | Default source when the tool arg is omitted |
Register with Claude Code
claude mcp add logflare -- node /absolute/path/to/logflare-mcp/dist/index.jsOr add manually to ~/.claude.json:
{
"mcpServers": {
"logflare": {
"command": "node",
"args": ["/absolute/path/to/logflare-mcp/dist/index.js"],
"env": {
"LOGFLARE_API_KEY": "lf-xxxxxxxx",
"LOGFLARE_DEFAULT_SOURCE_TOKEN": "optional-uuid"
}
}
}
}Register with Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"logflare": {
"command": "node",
"args": ["/absolute/path/to/logflare-mcp/dist/index.js"],
"env": { "LOGFLARE_API_KEY": "lf-xxxxxxxx" }
}
}
}Dev
pnpm dev # tsx watch mode
pnpm build # emit dist/
pnpm typecheckSmoke test from the shell:
LOGFLARE_API_KEY=xxx printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"t","version":"0"}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
| node dist/index.jsNotes
Auth defaults to
Authorization: Bearer <key>(per Logflare's OpenAPI spec). SetLOGFLARE_AUTH_STYLE=x-api-keyto fall back to the legacyX-API-KEYheader.execute_queryaccepts exactly one ofbq_sql,pg_sql,ch_sql.Prefer
query_endpointwith saved endpoints overexecute_query; saved endpoints give you parameter validation and caching on Logflare's side.
License
MIT
Available Tools
7 toolsexecute_queryExecute ad-hoc SQLA
Run an ad-hoc SQL query. Provide exactly one dialect: BigQuery, Postgres, or ClickHouse. Prefer query_endpoint when a saved endpoint exists.
Inputs: bq_sql, pg_sql, ch_sql.
get_recent_eventsGet recent events from a sourceA
Fetch the most recent log events for a source. Useful for tailing and incident triage.
Inputs: source_token.
get_sourceFetch a single sourceB
Get a single source by its token.
Inputs: source_token (required).
get_source_schemaGet source schemaB
Return the inferred schema (field names and types) for a source.
Inputs: source_token.
list_endpointsList Logflare endpointsB
List saved query endpoints for the account.
Inputs: no named parameters.
list_sourcesList Logflare sourcesA
List all sources (log streams) accessible to the configured API key.
Inputs: no named parameters.
query_endpointRun a saved endpointC
Execute a Logflare endpoint by UUID or name. Pass endpoint parameters as a flat key/value object.
Inputs: token_or_name (required), params.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct operation: ad-hoc queries, saved endpoint execution, source retrieval, schema inspection, recent events, and listing. No two tools have overlapping purposes; descriptions clearly differentiate them.
All tool names follow a consistent verb_noun pattern with lowercase and underscores (e.g., execute_query, list_sources). The prefixes 'get', 'list', 'execute', and 'query' are uniformly used for similar actions.
With 7 tools, the server is well-scoped for a logging/query domain. Each tool serves a clear purpose without redundancy, and the count is neither too sparse nor overwhelming.
The tool set covers core operations: listing and inspecting sources, querying via ad-hoc SQL or saved endpoints, and fetching recent events. Missing create/update/delete for sources and endpoints, but these may be out of scope for a read-focused MCP server.
Maintenance
Related MCP Connectors
Access New Relic observability data through MCP - query metrics, logs, traces, entities, and more
MCP server for interacting with the Supabase platform
Managed Postgres MCP: projects, SQL, docs search, and storage buckets via OAuth.
Analytics and debugging for your MCP server — explore usage and sessions, then root-cause errors.
Related MCP Servers
- FlicenseAqualityCmaintenanceEnables interaction with InfluxDB v3 (Core/Enterprise/Cloud Dedicated) through MCP clients. Supports database management, data querying and writing, schema inspection, and token administration operations.21-
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Sumo Logic's REST APIs through MCP, allowing log search, dashboard management, metrics querying, collector and monitor operations.5MIT
- AlicenseNot gradedqualityFmaintenanceExposes configured log files as MCP tools, enabling agents to list, query, and follow logs from local and SSH sources.MIT
- FlicenseAqualityCmaintenanceRead-only MCP server for searching migrated Papertrail logs via SolarWinds Observability API. Provides tools to list environments and perform bearer-authenticated log queries through stdio.2-