Skip to content

Logfire MCP Server

An MCP (Model Context Protocol) server that provides access to OpenTelemetry traces and metrics through Logfire. This server enables LLMs to query your application's telemetry data, analyze distributed traces, and perform custom queries using Logfire's OpenTelemetry-native API.

You can check the Logfire MCP server repository for more information.

Pydantic Logfire provides a hosted remote MCP server that you can use without installing anything 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 regionlogfire-us.pydantic.dev
  • EU regionlogfire-eu.pydantic.dev

Note

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.

Note

If you are running a self-hosted Logfire instance, replace the URL above with your own Logfire instance URL (e.g., https://logfire.my-company.com/mcp), as the remote MCP server is hosted alongside your Logfire deployment.


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.

Cursor

Create a .cursor/mcp.json file in your project root:

{
  "mcpServers": {
    "logfire": {
      "type": "http",
      "url": "https://logfire-us.pydantic.dev/mcp"
    }
  }
}

For more detailed information, you can check the Cursor documentation.

Claude Code

Run the following command:

claude mcp add logfire --transport http https://logfire-us.pydantic.dev/mcp

Claude Desktop

Add to your Claude settings:

{
  "mcpServers": {
    "logfire": {
      "type": "http",
      "url": "https://logfire-us.pydantic.dev/mcp"
    }
  }
}

Check out the MCP quickstart for more information.

Cline

Add to your Cline settings in cline_mcp_settings.json:

{
  "mcpServers": {
    "logfire": {
      "type": "http",
      "url": "https://logfire-us.pydantic.dev/mcp"
    }
  }
}

VS Code

Make sure you enabled MCP support in VS Code.

Create a .vscode/mcp.json file in your project's root directory:

{
  "servers": {
    "logfire": {
      "type": "http",
      "url": "https://logfire-us.pydantic.dev/mcp"
    }
  }
}

Zed

Create a .zed/settings.json file in your project's root directory:

{
  "context_servers": {
    "logfire": {
      "type": "http",
      "url": "https://logfire-us.pydantic.dev/mcp"
    }
  }
}

Sandboxed Environments

If browser-based authentication is not available (e.g. in sandboxed environments), generate an API key with at least the project:read scope from your organization or project settings, then use it as a Bearer token:

{
  "mcpServers": {
    "logfire": {
      "type": "http",
      "url": "https://logfire-us.pydantic.dev/mcp",
      "headers": {
        "Authorization": "Bearer <your-logfire-api-key>"
      }
    }
  }
}

Running Locally (Deprecated)

Warning

If you still want to run the MCP server locally, refer to the local mcp server documentation for setup and configuration instructions.