Logfire
A Model Context Protocol server that enables LLMs to retrieve and analyze OpenTelemetry traces and metrics from Logfire, supporting exception tracking and custom SQL queries against telemetry data.
What is Logfire?
Logfire is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol server that enables llms to retrieve and analyze opentelemetry traces and metrics from logfire, supporting exception tracking and custom sql queries against telemetry data.
A Model Context Protocol server that enables LLMs to retrieve and analyze OpenTelemetry traces and metrics from Logfire, supporting exception tracking and custom SQL queries against telemetry data.
This server falls under the Monitoring & Observability category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A Model Context Protocol server that enables LLMs to retriev
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx logfire-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Logfire
Logfire MCP Server provides AI assistants with live access to Pydantic Logfire's OpenTelemetry observability platform, enabling natural-language querying of traces, metrics, exceptions, and custom telemetry via SQL. Developers can ask Claude to find recent exceptions, analyze slow database queries, or build alert rules without opening the Logfire web UI. The server also supports dashboard and alert management, making it a conversational interface for the full Logfire feature set.
Prerequisites
- Pydantic Logfire account (logfire.pydantic.dev)
- A Logfire project with telemetry data ingested
- Claude Desktop, Claude Code, or another MCP-compatible client
- For headless/API-key authentication: a Logfire API token with read permissions
Create a Logfire project and ingest data
Sign up at logfire.pydantic.dev and instrument your application using the Logfire Python SDK or OpenTelemetry exporters. The MCP server can only query data that has already been sent to Logfire.
pip install logfire
logfire authAdd the remote MCP server to Claude Code
For Claude Code, run the following command to register the Logfire MCP server. Authentication is handled via browser OAuth the first time you connect.
claude mcp add logfire --transport http https://logfire-us.pydantic.dev/mcpOr add the server to Claude Desktop config
For Claude Desktop or other clients, add the Logfire server using its HTTPS endpoint. If you prefer EU data residency, use the EU endpoint instead.
{
"mcpServers": {
"logfire": {
"type": "http",
"url": "https://logfire-us.pydantic.dev/mcp"
}
}
}Authenticate via browser
On first use, Logfire will redirect you to authenticate in your browser. For headless or CI environments, use an API key as a Bearer token instead.
{
"mcpServers": {
"logfire": {
"type": "http",
"url": "https://logfire-us.pydantic.dev/mcp",
"headers": {
"Authorization": "Bearer your_logfire_api_key"
}
}
}
}Start querying your telemetry
Open Claude and ask it to query your Logfire data. The server supports arbitrary SQL against your telemetry schema as well as structured tools for exceptions, dashboards, and alerts.
Logfire Examples
Client configuration
Claude Desktop config using the US region remote MCP endpoint with API key authentication. Use https://logfire-eu.pydantic.dev/mcp for EU region.
{
"mcpServers": {
"logfire": {
"type": "http",
"url": "https://logfire-us.pydantic.dev/mcp",
"headers": {
"Authorization": "Bearer your_logfire_api_key"
}
}
}
}Prompts to try
Use natural language to explore traces, exceptions, and performance data in Logfire.
- "Show me the 10 most recent exceptions in my Logfire project"
- "Which database queries took longer than 500ms in the last hour?"
- "Run a SQL query to count HTTP 5xx errors grouped by endpoint for today"
- "Create an alert that fires when the error rate exceeds 5% over 5 minutes"
- "What are the slowest spans in my traces from the last 30 minutes?"Troubleshooting Logfire
401 Unauthorized when connecting to the MCP endpoint
Ensure your Authorization header contains a valid Logfire API token with at least read permissions. Generate a new token in the Logfire dashboard under Settings → Tokens.
No data returned from SQL queries
Verify your application is actively sending telemetry to Logfire. Check the Logfire web UI to confirm data is visible. Also confirm the project name in your query matches your actual project — the MCP server scopes queries to the authenticated project.
Browser authentication loop in Claude Code
Run 'claude mcp add logfire --transport http https://logfire-us.pydantic.dev/mcp' to re-register, then use the /mcp slash command in Claude Code to complete the OAuth flow. For persistent headless auth, switch to API key authentication via the Authorization header.
Frequently Asked Questions about Logfire
What is Logfire?
Logfire is a Model Context Protocol (MCP) server that model context protocol server that enables llms to retrieve and analyze opentelemetry traces and metrics from logfire, supporting exception tracking and custom sql queries against telemetry data. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Logfire?
Follow the installation instructions on the Logfire GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Logfire?
Logfire works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Logfire free to use?
Yes, Logfire is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
Logfire Alternatives — Similar Monitoring & Observability Servers
Looking for alternatives to Logfire? Here are other popular monitoring & observability servers you can use with Claude, Cursor, and VS Code.
Netdata
★ 78.9kReal-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.
Kubeshark
★ 11.9keBPF-powered network observability for Kubernetes. Indexes L4/L7 traffic with full K8s context, decrypts TLS without keys. Queryable by AI agents via MCP and humans via dashboard.
Mission Control
★ 4.9kSelf-hosted AI agent orchestration platform: dispatch tasks, run multi-agent workflows, monitor spend, and govern operations from one mission control dashboard.
Grafana
★ 3.0kThis MCP server enables natural-language querying of Grafana logs by automatically detecting log sources and service labels. It provides read-only access to log data with intelligent caching for efficient repeat queries.
Sentrux
★ 2.4kReal-time architectural sensor that helps AI agents close the feedback loop, enabling recursive self-improvement of code quality. Pure Rust.
OpenInference
★ 986OpenTelemetry Instrumentation for AI Observability
Browse More Monitoring & Observability MCP Servers
Explore all monitoring & observability servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Logfire in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Logfire?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.