Skip to main content
Glama
fasterv410

logflare-mcp

by fasterv410

logflare-mcp

MCP-Server für die Logflare Management-API. Stellt Quellen, Endpunkte und Ad-hoc-SQL-Abfragetools für MCP-Clients (Claude Code, Claude Desktop, Cursor, …) über stdio bereit.

Basiert auf dem offiziellen @modelcontextprotocol/sdk und kommuniziert direkt mit der öffentlichen Logflare-REST-API – kein Drittanbieter-Authentifizierungs-Proxy.

Tools

Tool

Beschreibung

list_sources

Listet alle für den API-Schlüssel verfügbaren Quellen auf

get_source

Ruft eine einzelne Quelle anhand des Tokens ab

get_source_schema

Abgeleitete Feldtypen für eine Quelle

get_recent_events

Die neuesten Ereignisse einer Quelle

list_endpoints

Gespeicherte Abfrage-Endpunkte

query_endpoint

Führt einen gespeicherten Endpunkt per UUID oder Name mit Parametern aus

execute_query

Führt Ad-hoc BigQuery / Postgres / ClickHouse SQL aus

Installation

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

Konfiguration

Holen Sie sich Ihren Logflare-API-Schlüssel unter https://logflare.app/access-tokens.

cp .env.example .env
# edit .env and paste your key

Variable

Erforderlich

Standard

Hinweise

LOGFLARE_API_KEY

ja

Zugriffstoken

LOGFLARE_BASE_URL

nein

https://logflare.app

Für selbst gehostetes Logflare

LOGFLARE_AUTH_STYLE

nein

bearer

Verwenden Sie x-api-key für Legacy-Schlüssel

LOGFLARE_DEFAULT_SOURCE_TOKEN

nein

Standardquelle, wenn das Tool-Argument weggelassen wird

Registrierung bei Claude Code

claude mcp add logflare -- node /absolute/path/to/logflare-mcp/dist/index.js

Oder manuell zu ~/.claude.json hinzufügen:

{
  "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"
      }
    }
  }
}

Registrierung bei Claude Desktop

Bearbeiten Sie ~/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" }
    }
  }
}

Entwicklung

pnpm dev         # tsx watch mode
pnpm build       # emit dist/
pnpm typecheck

Smoke-Test über die 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

Hinweise

  • Die Authentifizierung erfolgt standardmäßig über Authorization: Bearer <key> (gemäß Logflares OpenAPI-Spezifikation). Setzen Sie LOGFLARE_AUTH_STYLE=x-api-key, um auf den Legacy-Header X-API-KEY zurückzugreifen.

  • execute_query akzeptiert genau eines der Argumente bq_sql, pg_sql oder ch_sql.

  • Bevorzugen Sie query_endpoint mit gespeicherten Endpunkten gegenüber execute_query; gespeicherte Endpunkte bieten Parametervalidierung und Caching auf Logflare-Seite.

Lizenz

MIT

Install Server
A
license - permissive license
A
quality
C
maintenance

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