logfire-mcp
The Logfire MCP Server facilitates access to and analysis of OpenTelemetry traces and metrics via Logfire. It offers tools to retrieve and analyze telemetry data, execute SQL queries, and is compatible with popular MCP clients for additional functionality.
Logfire MCP Server
This project is a Model Context Protocol (MCP) server that integrates with OpenTelemetry traces and metrics via Logfire. It allows LLMs to access and analyze telemetry data, distributed traces, and execute SQL queries using Logfire APIs.
Available Tools
-
find_exceptions: Retrieve exception counts grouped by file.
- Requires:
age
(time frame in minutes).
- Requires:
-
find_exceptions_in_file: Get trace details for exceptions in a specific file.
- Requires:
filepath
,age
.
- Requires:
-
arbitrary_query: Execute custom SQL queries.
- Requires:
query
,age
.
- Requires:
-
get_logfire_records_schema: Obtain the OpenTelemetry schema.
Setup
- Install
uv
to run the MCP server. - Obtain a Logfire read token.
- Run the server with
uvx
.
Configuration with MCP Clients
Instructions to configure for common clients like Cursor, Claude Desktop, and Cline.
Getting Started
- Obtain a read token.
- Run the server.
- Configure the client.
- Analyze traces and metrics.
Contributing
Contributions for enhancing trace analysis tools, metrics querying, or documentation are welcomed.
License
Licensed under the MIT License.