Logfire

v1.0.0Monitoring & Observabilitystable

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.

logfire-mcp-servermcpai-integration
Share:
161
Stars
0
Downloads
0
Weekly
0/5

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

A Model Context Protocol server that enables LLMs to retrieve and analyze OpenTe
pydantic

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedApr 26, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx logfire-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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 auth
2

Add 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/mcp
3

Or 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"
    }
  }
}
4

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"
      }
    }
  }
}
5

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.

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.

Quick Config Preview

{ "mcpServers": { "logfire-mcp-server": { "command": "npx", "args": ["-y", "logfire-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides