Skip to content

Latest commit

 

History

History
125 lines (88 loc) · 5.13 KB

File metadata and controls

125 lines (88 loc) · 5.13 KB

logfire

Add Logfire observability to Python applications.

Features

  • /instrument - detect frameworks and add Logfire instrumentation
  • logfire-setup skill - authenticate, inspect the repository, and route to the right setup workflow
  • logfire-infrastructure skill - monitor hosts, containers, Kubernetes, databases, and cloud infrastructure
  • logfire-evals skill - add dataset-based evaluations for AI and agent behavior
  • /debug - investigate errors using Logfire traces via MCP
  • /query - query traces, logs, and metrics interactively or add query capabilities to code
  • logfire-ui skill - open Logfire project pages, live views, traces, and Explore filters directly in Codex
  • SKILL.md with core Logfire patterns (configure, instrument, structured logging, AI/LLM instrumentation)
  • MCP server for querying Logfire data

Query vs UI Routing

The Codex Logfire plugin uses one primary workflow per request:

User intent Route
Analyze, query, count, summarize, compare, or find root cause Use logfire-query and return analysis in chat.
Open, show in browser, live view, Explore, Logfire UI, or give a link Use logfire-ui and open or return a Logfire URL without querying first.
Ambiguous prompts like "show recent errors" or "view logs" Ask whether the user wants a UI view or query analysis.
Explicit combined prompts like "analyze this and give me a link" Do the requested query work, then provide the relevant Logfire link.

For UI requests that omit the organization/project, the agent should resolve the current project through Logfire MCP auth/current-project metadata before asking the user. Environment values such as LOGFIRE_BASE_URL, LOGFIRE_URL, and exporter config identify the platform/API base only; they are not enough to infer the target organization/project.

Install In Claude Code

claude plugin marketplace add pydantic/skills
claude plugin install logfire@pydantic-skills

The Claude plugin provides /instrument, /debug, /query, and the Logfire MCP server.

Install In Codex

Add the published Pydantic marketplace to Codex:

codex plugin marketplace add pydantic/skills

Then enable Logfire from the Codex plugin UI. The Codex plugin metadata lives in .codex-plugin/plugin.json and configures:

  • display name Logfire
  • category Coding
  • capabilities Interactive and Write
  • Logfire icon and pink brand color
  • Logfire skills for instrumentation, querying, and UI-opening workflows
  • MCP server from .codex-plugin/mcp.json

For local development after changing this plugin, refresh the Codex plugin cache:

./scripts/reload-codex-plugin.sh logfire

A new Codex conversation may be required for updated skills, MCP servers, icons, or metadata to load.

Install In Cursor

Install the Logfire plugin from the published pydantic/skills repository:

git clone https://github.com/pydantic/skills.git
mkdir -p ~/.cursor/plugins/local
cp -R skills/plugins/logfire ~/.cursor/plugins/local/logfire

Then restart Cursor or run Developer: Reload Window. The Cursor plugin metadata lives in .cursor-plugin/plugin.json and configures:

  • display name Logfire
  • Logfire skills for instrumentation, querying, and UI-opening workflows
  • hosted Logfire MCP server from mcp.json

MCP

The Logfire MCP server is configured automatically when you install the plugin. By default it targets the US region endpoint (https://logfire-us.pydantic.dev/mcp). The plugin's skills and commands are region-independent; only the MCP server entry differs per region.

EU region and self-hosted instances

Claude Code reads the endpoint from the LOGFIRE_MCP_URL environment variable, so set it in the shell where you launch Claude Code:

export LOGFIRE_MCP_URL=https://logfire-eu.pydantic.dev/mcp

This needs plugin version 0.1.4 or later; on earlier versions the URL is hardcoded. Run claude plugin list to see the installed version and the marketplace it came from, then update and restart Claude Code:

claude plugin marketplace update pydantic-skills
claude plugin update logfire@pydantic-skills

If you installed from Anthropic's claude-plugins-official marketplace instead, substitute that name. That marketplace pins a specific commit of this repository, so a release can take longer to appear there than on pydantic-skills, which tracks main.

Codex users can switch by replacing the MCP entry and re-authenticating:

codex mcp remove logfire
codex mcp add logfire --url https://logfire-eu.pydantic.dev/mcp
codex mcp login logfire
codex mcp get logfire

Start a new Codex conversation after switching so the MCP tools reload.

Cursor installs are a local copy, so edit the url in ~/.cursor/plugins/local/logfire/mcp.json and reload the window.

In Claude Code, .mcp.json configures the logfire MCP server. In Codex, .codex-plugin/mcp.json configures it. In Cursor, mcp.json configures the same hosted server.

The Logfire MCP server requires normal Logfire authentication, such as logfire auth or a suitable LOGFIRE_TOKEN.