Skip to main content
Glama
fasterv410

logflare-mcp

by fasterv410

logflare-mcp

Logflare 관리 API를 위한 MCP 서버입니다. MCP 클라이언트(Claude Code, Claude Desktop, Cursor 등)에 stdio를 통해 소스, 엔드포인트 및 임시 SQL 쿼리 도구를 노출합니다.

공식 @modelcontextprotocol/sdk를 기반으로 구축되었으며, 타사 인증 프록시 없이 Logflare 공개 REST API와 직접 통신합니다.

도구

도구

설명

list_sources

API 키로 접근 가능한 모든 소스 나열

get_source

토큰으로 단일 소스 가져오기

get_source_schema

소스에 대한 추론된 필드 유형

get_recent_events

소스의 가장 최근 이벤트

list_endpoints

저장된 쿼리 엔드포인트

query_endpoint

UUID 또는 이름으로 저장된 엔드포인트를 매개변수와 함께 실행

execute_query

임시 BigQuery / Postgres / ClickHouse SQL 실행

설치

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

구성

https://logflare.app/access-tokens에서 Logflare API 키를 받으세요.

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

변수

필수

기본값

참고

LOGFLARE_API_KEY

액세스 토큰

LOGFLARE_BASE_URL

아니요

https://logflare.app

자체 호스팅 Logflare용

LOGFLARE_AUTH_STYLE

아니요

bearer

레거시 키의 경우 x-api-key 사용

LOGFLARE_DEFAULT_SOURCE_TOKEN

아니요

도구 인수가 생략될 때의 기본 소스

Claude Code에 등록

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

또는 ~/.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"
      }
    }
  }
}

Claude Desktop에 등록

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

개발

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

셸에서 스모크 테스트:

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

참고

  • 인증은 기본적으로 Authorization: Bearer <key>를 사용합니다(Logflare의 OpenAPI 사양에 따름). 레거시 X-API-KEY 헤더로 돌아가려면 LOGFLARE_AUTH_STYLE=x-api-key를 설정하세요.

  • execute_querybq_sql, pg_sql, ch_sql 중 정확히 하나만 허용합니다.

  • execute_query보다는 저장된 엔드포인트를 사용하는 query_endpoint를 선호하십시오. 저장된 엔드포인트는 Logflare 측에서 매개변수 유효성 검사 및 캐싱을 제공합니다.

라이선스

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