logflare-mcp
Supports executing SQL queries against ClickHouse via the Logflare Management API.
Click on "Install 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-mcplist 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 |
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/fasterv410/logflare-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server