logflare-mcp
logflare-mcp
Logflare管理API用のMCPサーバーです。ソース、エンドポイント、およびアドホックSQLクエリツールを、stdio経由でMCPクライアント(Claude Code、Claude Desktop、Cursorなど)に公開します。
公式の @modelcontextprotocol/sdk を基盤として構築されており、サードパーティの認証プロキシを介さず、Logflareの公開REST APIと直接通信します。
ツール
ツール | 説明 |
| APIキーで利用可能なすべてのソースを一覧表示 |
| トークンで単一のソースを取得 |
| ソースの推論されたフィールド型 |
| ソースからの最新イベント |
| 保存されたクエリエンドポイント |
| UUIDまたは名前で保存されたエンドポイントをパラメータ付きで実行 |
| アドホックなBigQuery / Postgres / ClickHouse SQLを実行 |
インストール
git clone git@github.com:fasterv410/logflare-mcp.git
cd logflare-mcp
pnpm install
pnpm build設定
Logflare APIキーを https://logflare.app/access-tokens から取得してください。
cp .env.example .env
# edit .env and paste your key変数 | 必須 | デフォルト | 備考 |
| はい | — | アクセストークン |
| いいえ |
| セルフホスト版Logflare用 |
| いいえ |
| レガシーキーの場合は |
| いいえ | — | ツール引数が省略された場合のデフォルトソース |
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_queryはbq_sql、pg_sql、ch_sqlのいずれか1つのみを受け付けます。execute_queryよりも、保存されたエンドポイントを使用するquery_endpointを優先してください。保存されたエンドポイントは、Logflare側でのパラメータ検証とキャッシュが利用可能です。
ライセンス
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