The Logfire MCP Server allows LLMs to retrieve and analyze OpenTelemetry traces and metrics data, providing insights into application telemetry. You can:
Find Exceptions: Retrieve exception counts grouped by file using
find_exceptionsGet Exception Details: Access detailed trace information about exceptions in specific files with
find_exceptions_in_fileRun Custom Queries: Execute arbitrary SQL queries on your OpenTelemetry data via
arbitrary_queryAccess Schema: View the OpenTelemetry schema to help with query construction using
get_logfire_records_schema
The server supports analysis of distributed traces and metrics for time periods up to 7 days.
Enables access and analysis of OpenTelemetry traces and metrics data stored in Logfire, with tools for finding exceptions, retrieving trace information, and executing SQL queries against telemetry data.
Integrates with Logfire, a Pydantic service, to retrieve and analyze application telemetry data through the Logfire APIs using read tokens from the Logfire project settings.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Logfire MCP Serverfind the 10 most recent exceptions in app.py from the last hour"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Pydantic Logfire MCP Server
This repository contains a Model Context Protocol (MCP) server with tools that can access the OpenTelemetry traces and metrics you've sent to Pydantic Logfire.
Remote MCP Server (Recommended)
Pydantic Logfire provides a hosted remote MCP server that you can use instead of running this package locally. This is the easiest way to get started with the Logfire MCP server.
To use the remote MCP server, add the following configuration to your MCP client.
Choose the endpoint that matches your Logfire data region:
US region —
logfire-us.pydantic.devEU region —
logfire-eu.pydantic.dev
For US region (logfire-us.pydantic.dev):
For EU region (logfire-eu.pydantic.dev):
The remote MCP server handles authentication automatically through your browser. When you first connect, you'll be prompted to authenticate with your Pydantic Logfire account.
If you want to run logfire-mcp locally, check theOLD_README.md file.
Related MCP server: MCP File Context Server
Configuration with well-known MCP clients
The examples below use the US region endpoint. Replace the URL with https://logfire-eu.pydantic.dev/mcp if you are using the EU region.
Configure for Cursor
Create a .cursor/mcp.json file in your project root:
Configure for Claude Code
Run the following command:
Configure for Claude Desktop
Add to your Claude settings:
Configure for Cline
Add to your Cline settings in cline_mcp_settings.json:
Configure for VS Code
Make sure you enabled MCP support in VS Code.
Create a .vscode/mcp.json file in your project's root directory:
Configure for Zed
Create a .zed/settings.json file in your project's root directory: