# Pydantic Logfire (MCP Server)

> Query Logfire traces, exceptions, dashboards and alerts with SQL

- Type: MCP server
- Publisher: Pydantic (official)
- Categories: DevOps & Cloud, Development
- Website: https://pydantic.dev/docs/logfire/guides/mcp-server/
- Source: https://github.com/pydantic/logfire-mcp
- Transport: streamable-http
- Server URL: https://logfire-us.pydantic.dev/mcp
- Sign-in: oauth
- GitHub stars: 161
- Listed: 2025-03-06

## About

Pydantic's hosted Logfire MCP server lets agents run SQL over your traces and logs, find exceptions by file, and manage dashboards, alerts, notification channels and issues. It has US and EU endpoints over Streamable HTTP with browser OAuth, or an API key with project:read scope as a bearer token. The older local server is deprecated.

## Install

1. **Connect it in ChatGPT** Turn on Developer mode in ChatGPT (Settings → Security and login), open Plugins, select + and paste https://logfire-us.pydantic.dev/mcp as the MCP server URL, then sign in with OAuth. Add it to a chat from the composer's tools menu.

2. **Or add it to Codex or the API**

   Codex CLI:

   ```bash
   codex mcp add logfire --url https://logfire-us.pydantic.dev/mcp
   codex mcp login logfire
   ```

   config.toml:

   ```toml
   [mcp_servers.logfire]
   url = "https://logfire-us.pydantic.dev/mcp"
   ```

   Responses API:

   ```python
   import os
   from openai import OpenAI
   
   client = OpenAI()
   
   response = client.responses.create(
       model="gpt-6-astra",
       tools=[{
           "type": "mcp",
           "server_label": "logfire",
           "server_url": "https://logfire-us.pydantic.dev/mcp",
           "authorization": os.environ["LOGFIRE_API_KEY"],
           "require_approval": "never",
       }],
       input="What exceptions were raised in app/payments.py in the last hour?",
   )
   print(response.output_text)
   ```

## Tools

- `query_run`
- `query_schema_reference`
- `query_find_exceptions_in_file`
- `project_list`
- `dashboard_create`
- `dashboard_add_panel`
- `alert_create`
- `alert_list`
- `issue_list`

## Example prompts

- "What exceptions were raised in app/payments.py in the last hour?"
- "Show the slowest endpoints over the last 24 hours"
- "Create an alert when error rate exceeds 5%"
- "Build a dashboard of request latency by route"

## Also available as

- app: [Pydantic Logfire](https://chatgptplugins.directory/apps/pydantic-logfire.md)

## Related

- [Chrome DevTools MCP](https://chatgptplugins.directory/mcp/chrome-devtools.md): Let coding agents control and debug a live Chrome browser
- [Playwright MCP](https://chatgptplugins.directory/mcp/playwright.md): Browser automation for agents via Playwright accessibility snapshots
- [GitHub](https://chatgptplugins.directory/mcp/github.md): Manage repos, issues, pull requests and Actions from your AI agent
- [Context7](https://chatgptplugins.directory/mcp/context7.md): Pull up-to-date, version-specific library docs into your coding agent
- [Supabase](https://chatgptplugins.directory/mcp/supabase.md): Manage Supabase databases, migrations, edge functions and logs
- [Stripe](https://chatgptplugins.directory/mcp/stripe.md): Query and act on your Stripe account and search Stripe docs from any agent

---
Source: https://chatgptplugins.directory/mcp/logfire · Index: https://chatgptplugins.directory/llms.txt · Independent and community-run. Not affiliated with or endorsed by OpenAI. ChatGPT is a trademark of OpenAI.
