logfire-mcp

logfire-mcp

72

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).
  • find_exceptions_in_file: Get trace details for exceptions in a specific file.

    • Requires: filepath, age.
  • arbitrary_query: Execute custom SQL queries.

    • Requires: query, age.
  • get_logfire_records_schema: Obtain the OpenTelemetry schema.

Setup

  1. Install uv to run the MCP server.
  2. Obtain a Logfire read token.
  3. Run the server with uvx.

Configuration with MCP Clients

Instructions to configure for common clients like Cursor, Claude Desktop, and Cline.

Getting Started

  1. Obtain a read token.
  2. Run the server.
  3. Configure the client.
  4. Analyze traces and metrics.

Contributing

Contributions for enhancing trace analysis tools, metrics querying, or documentation are welcomed.

License

Licensed under the MIT License.