logflare-mcp

logflare-mcp

Enables querying and managing Logflare log sources, endpoints, and executing ad-hoc SQL via MCP.

Category
Visit Server

README

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_sources List all sources available to the API key
get_source Fetch a single source by token
get_source_schema Inferred field types for a source
get_recent_events Most recent events from a source
list_endpoints Saved query endpoints
query_endpoint Run a saved endpoint by UUID or name, with parameters
execute_query Run ad-hoc BigQuery / Postgres / ClickHouse SQL

Install

git clone git@github.com:fasterv410/logflare-mcp.git
cd logflare-mcp
pnpm install
pnpm build

Configure

Get your Logflare API key from https://logflare.app/access-tokens.

cp .env.example .env
# edit .env and paste your key
Variable Required Default Notes
LOGFLARE_API_KEY yes Access token
LOGFLARE_BASE_URL no https://logflare.app For self-hosted Logflare
LOGFLARE_AUTH_STYLE no bearer Use x-api-key for legacy keys
LOGFLARE_DEFAULT_SOURCE_TOKEN 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.js

Or 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 typecheck

Smoke 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.js

Notes

  • Auth defaults to Authorization: Bearer <key> (per Logflare's OpenAPI spec). Set LOGFLARE_AUTH_STYLE=x-api-key to fall back to the legacy X-API-KEY header.
  • execute_query accepts exactly one of bq_sql, pg_sql, ch_sql.
  • Prefer query_endpoint with saved endpoints over execute_query; saved endpoints give you parameter validation and caching on Logflare's side.

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured