Logfire MCP Server logo

Logfire MCP Server

by pydantic

The Logfire MCP Server allows LLMs to retrieve application telemetry data from Logfire, analyze distributed traces, and execute SQL queries. It provides tools to access OpenTelemetry traces and metrics sent to Logfire.

View on GitHub

Last updated: N/A

What is Logfire MCP Server?

The Logfire MCP Server is a Model Context Protocol server that provides access to OpenTelemetry traces and metrics stored in Logfire. It enables LLMs to analyze application telemetry data, distributed traces, and execute SQL queries against the Logfire APIs.

How to use Logfire MCP Server?

  1. Obtain a Logfire read token. 2. Install uv. 3. Run the server using uvx logfire-mcp --read-token=YOUR_TOKEN. 4. Configure your preferred MCP client (Cursor, Claude Desktop, or Cline) with the appropriate settings.

Key features of Logfire MCP Server

  • Access to OpenTelemetry traces and metrics

  • Ability to analyze distributed traces

  • Execution of arbitrary SQL queries

  • Integration with popular MCP clients (Cursor, Claude Desktop, Cline)

  • Tools for finding exceptions and their context

Use cases of Logfire MCP Server

  • Troubleshooting application errors

  • Analyzing performance bottlenecks

  • Understanding the flow of requests through a distributed system

  • Generating reports on application health

  • Providing LLMs with context for better decision-making

FAQ from Logfire MCP Server

How do I get a Logfire read token?

You can create one under the 'Read Tokens' section of your project settings in Logfire: https://logfire.pydantic.dev/-/redirect/latest-project/settings/read-tokens

What clients are supported?

Cursor, Claude Desktop, and Cline are explicitly supported with configuration examples provided.

How do I specify the Logfire base URL?

You can use the --base-url argument or set the LOGFIRE_BASE_URL environment variable.

What is the purpose of the age argument?

The age argument specifies the number of minutes to look back when querying data. The maximum value is 7 days.

Where can I find examples of other MCP servers?

See the Model Context Protocol servers repository: https://github.com/modelcontextprotocol/servers