Logfire MCP server for AI agents and assistants

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Logfire MCP or direct API to query traces, logs, and metrics, inspect exceptions and issues, manage dashboards and alerts, and control notification channels through natural language.

Logfire MCP logoLogfire MCP
Dcr Oauth

Logfire MCP is Pydantic Logfire's official MCP server for observability data in the US region. It provides a secure, natural-language interface for traces, logs, metrics, issues, and monitoring controls.

75 Tools

Try Logfire MCP now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
Logfire MCP
Try asking
TOOLS

Supported Tools

Every Logfire MCP action and event your agent gets out of the box.

Alert create

Create a new alert that periodically runs a SQL query and sends notifications based on results.

Alert delete

Permanently delete an alert.

Alert get

Get an alert's configuration and last run result by ID.

Alert history

Get the run history of an alert, showing each time it was evaluated and whether it matched.

Alert list

List alert summaries and their latest completed run status.

Alert status

Check if an alert is currently firing and when it last triggered or resolved.

Alert update

Update an existing alert's configuration.

Channel create opsgenie

Create an Opsgenie notification channel for incident management alerts.

Channel create webhook

Create a webhook notification channel for Slack, Discord, or custom HTTP endpoints.

Channel delete

Permanently delete a notification channel.

Channel get

Get a specific notification channel by ID.

Channel list

List all notification channels in the organization.

Channel update opsgenie

Update an Opsgenie channel's API key, label, or active status.

Channel update webhook

Update a webhook channel's URL, format, label, or active status.

Dashboard add panel

Add a new panel to an existing dashboard with optional layout position.

Dashboard add variable

Add a single variable to a dashboard at an optional position.

Dashboard create

Create a new dashboard from a Perses JSON definition or as an empty dashboard.

Dashboard create group

Create a new layout group in a dashboard.

Dashboard delete

Delete a dashboard by slug.

Dashboard delete group

Delete an empty layout group from a dashboard.

Dashboard get

Get the full dashboard definition as Perses-compatible JSON.

Dashboard get version

Get one kept version of a dashboard with its full Perses definition.

Dashboard list

List dashboards in a project with optional search and cursor-based pagination.

Dashboard list versions

List the kept versions of a dashboard, the newest first.

Dashboard panel reference

Get the panel guide and the JSON schema of every panel kind's settings.

Dashboard remove panel

Remove a panel from a dashboard.

Dashboard remove variable

Remove a variable from a dashboard by name.

Dashboard rename group

Change the title of a dashboard layout group.

Dashboard reorder groups

Change the display order of layout groups in a dashboard.

Dashboard restore

Make a kept version the current version of its dashboard.

Dashboard toggle group collapse

Set whether a dashboard layout group is collapsed or expanded.

Dashboard update

Update a dashboard's name and/or full Perses definition.

Dashboard update panel

Update an existing panel's properties.

Dashboard update settings

Update dashboard time range and auto-refresh settings.

Dashboard update variable

Update an existing variable by name, replacing it with a new definition.

Dashboard update variables

Replace all variables on a dashboard with the provided list.

Get agents setup prompt

Return the AI-agent prompt to instrument an AI agent so it appears on the Agents page.

Get feature flags setup prompt

Return the AI-agent prompt to set up runtime feature flags with Logfire managed variables.

Get infrastructure setup prompt

Return the AI-agent prompt to set up infrastructure monitoring with Logfire.

Get instrumentation setup prompt

Return the AI-agent prompt to instrument this application with the Logfire SDK.

Integration install

Install an integration into a project, enabling its standard dashboards and creating its alerts.

Integration list

List the Integrations catalog with this project's install/detection state.

Issue get

Get a single tracked exception issue by its number, including the stacktrace.

Issue list

List tracked exception issues for a project with cursor-based pagination.

Issue set states

Open, ignore, or resolve one or more exception issues.

Local dev session

Set up a local development session for sending telemetry to Logfire.

Notification window create

Create a new notification window that limits alert notification delivery to specific times.

Notification window delete

Permanently delete a notification window.

Notification window get

Get a specific notification window by ID.

Notification window list

List all notification windows in the organization.

Notification window update

Update an existing notification window.

Organization usage link

Generate a link to the built-in usage page of the organization.

Project list

List readable projects, including each project's last recorded telemetry ingestion time.

Project logfire link

Generate a Logfire UI link to view a specific trace.

Project logfire ui link

Generate a Logfire project UI link for live-view/filter pages.

Prompt get

Get a prompt by slug.

Prompt get settings

Get a prompt's playground settings (mutable, shared across versions).

Prompt get version

Get a specific template version, including the raw `template` body.

Prompt list

List prompts in a project.

Prompt list versions

List a prompt's template versions, ordered by version number.

Prompt preview

Render a saved prompt without calling the model.

Query exception context

Inspect up to three exception records in one trace, without fetching the whole trace or its attributes.

Query find exceptions in file

Get the details about the 10 most recent exceptions matching a source file path.

Query run

Run a read-only SQL SELECT query against Logfire telemetry.

Query schema reference

Get the table schemas and the query handbook for the Logfire DataFusion database.

Schedule create

Deprecated.

Schedule delete

Deprecated.

Schedule get

Deprecated.

Schedule list

Deprecated.

Schedule update

Deprecated.

Slo list

List the service level objectives (SLOs) of a project with their current status.

Token info

Get information about the current authentication token.

Variable get

Get a managed variable (feature flag) by name, with optional version/history detail.

Variable list

List all managed variables (feature flags) in a project.

Variable resolve

Resolve what value a client would receive for a variable *right now*, and why.

SETUP GUIDE

Connect Logfire MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/mcp @ai-sdk/openai
Install the Composio SDK and your agent framework
2

Create a session with MCP enabled

typescript
import { Composio } from "@composio/core";

const composio = new Composio();
const { mcp } = await composio.create("your-user-id", {
  toolkits: ["logfire_mcp"],
  mcp: true,
});
Create a session scoped to Logfire MCP and read its MCP URL and headers
3

Connect your agent to the MCP server

typescript
import { createMCPClient } from "@ai-sdk/mcp";
import { openai } from "@ai-sdk/openai";
import { generateText, stepCountIs } from "ai";

const client = await createMCPClient({
  transport: { type: "http", url: mcp.url, headers: mcp.headers },
});

const { text } = await generateText({
  model: openai("gpt-5.6-sol"),
  tools: await client.tools(),
  prompt: "Run a SQL query over my recent Logfire traces and show the five slowest requests.",
  stopWhen: stepCountIs(10),
});

console.log(text);
await client.close();
Pass the session's MCP URL and headers to your agent and run a Logfire MCP request
SETUP GUIDE

Connect Logfire MCP API Tool with your Agent

1

Install Composio

typescript
npm install @composio/core @composio/openai openai
Install the Composio SDK, the OpenAI provider, and the OpenAI SDK
2

Create a Composio session

typescript
import OpenAI from "openai";
import { Composio } from "@composio/core";
import { OpenAIResponsesProvider } from "@composio/openai";

const composio = new Composio({ provider: new OpenAIResponsesProvider() });
const client = new OpenAI();

const session = await composio.create("your-user-id", { toolkits: ["logfire_mcp"] });
const tools = await session.tools();
Initialize Composio with the OpenAI Responses provider and create a session scoped to Logfire MCP
3

Run Logfire MCP tools with your agent

typescript
let response = await client.responses.create({
  model: "gpt-5.6-sol",
  tools,
  input: [{ role: "user", content: "Run a SQL query over my recent Logfire traces and show the five slowest requests." }],
});

while (response.output.some((o) => o.type === "function_call")) {
  const outputs = await composio.provider.handleToolCalls(session, response.output);
  response = await client.responses.create({
    model: "gpt-5.6-sol",
    tools,
    previous_response_id: response.id,
    input: outputs,
  });
}

console.log(response.output_text);
Send a request, execute the Logfire MCP tool calls through the session, and print the final answer

Why Use Composio?

AI Native Logfire MCP Integration

  • Supports both Logfire MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for reading, writing, and querying your Logfire MCP data

Managed Auth

  • Built-in OAuth handling with automatic token refresh and rotation
  • Central place to manage, scope, and revoke Logfire MCP access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Logfire MCP
  • Scoped, least privilege access to Logfire MCP resources
  • Full audit trail of agent actions to support review and compliance
FRAMEWORKS

Use Logfire MCP with any AI Agent Framework

Choose a Framework you want to connect Logfire MCP with

Rolling this out across your team?

Give your team centralized access control across every framework with Composio’s MCP Gateway.

EXPLORE MCP GATEWAY
FAQ

Frequently asked questions

Start with Logfire MCP.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Logfire MCP tool your agent needs.Free to start.

Start building