Get exception counts from traces grouped by file
Get detailed trace information about exceptions in a specific file
Run custom SQL queries on your OpenTelemetry traces and metrics
Get the OpenTelemetry schema to help with custom queries
The Logfire Telemetry Analysis MCP enables LLMs to retrieve and analyze application telemetry data stored in Logfire. It provides tools to examine distributed traces, find exceptions, and execute custom SQL queries against your OpenTelemetry data. With this MCP, AI assistants can help you troubleshoot application issues by identifying error patterns, analyzing trace information, and extracting insights from your telemetry data. It bridges the gap between your monitoring infrastructure and AI assistance for more effective debugging and system analysis.
The Logfire Telemetry Analysis MCP provides access to your application's OpenTelemetry traces and metrics stored in Logfire. This allows AI assistants to help you analyze performance issues, troubleshoot errors, and gain insights from your telemetry data.
Before using this MCP, you'll need:
uv
package manager installed on your systemFirst, ensure you have uv
installed on your system. If you don't have it yet, follow the uv installation instructions.
If you already have uv
but need to update it, run:
uv self update
To access your telemetry data, you'll need a Logfire read token:
Note that read tokens are project-specific, so create one for the specific project you want to analyze.
Create a .cursor/mcp.json
file in your project root with the following content:
{
"mcpServers": {
"logfire": {
"command": "uvx",
"args": ["logfire-mcp", "--read-token=YOUR-TOKEN"]
}
}
}
Replace YOUR-TOKEN
with your actual Logfire read token.
Add this configuration to your Claude settings:
{
"command": ["uvx"],
"args": ["logfire-mcp"],
"type": "stdio",
"env": {
"LOGFIRE_READ_TOKEN": "YOUR_TOKEN"
}
}
Replace YOUR_TOKEN
with your actual Logfire read token.
Add to your Cline settings in cline_mcp_settings.json
:
{
"mcpServers": {
"logfire": {
"command": "uvx",
"args": ["logfire-mcp"],
"env": {
"LOGFIRE_READ_TOKEN": "YOUR_TOKEN"
},
"disabled": false,
"autoApprove": []
}
}
}
Replace YOUR_TOKEN
with your actual Logfire read token.
If you need to run the MCP server manually (not required for most client integrations), use:
LOGFIRE_READ_TOKEN=YOUR_READ_TOKEN uvx logfire-mcp
Or with the token as a command-line argument:
uvx logfire-mcp --read-token=YOUR_READ_TOKEN
By default, the server connects to https://logfire-api.pydantic.dev
. To use a different Logfire instance:
Using the command line:
uvx logfire-mcp --base-url=https://your-logfire-instance.com
Using an environment variable:
LOGFIRE_BASE_URL=https://your-logfire-instance.com uvx logfire-mcp
Here are some questions you can ask your AI assistant with this MCP:
The AI will use the appropriate tools to query your Logfire data and provide insights based on the results.