Logfire MCP Server
OfficialThe Logfire MCP Server allows LLMs to retrieve and analyze OpenTelemetry traces and metrics data, providing insights into application telemetry. You can:
Find Exceptions: Retrieve exception counts grouped by file using
find_exceptionsGet Exception Details: Access detailed trace information about exceptions in specific files with
find_exceptions_in_fileRun Custom Queries: Execute arbitrary SQL queries on your OpenTelemetry data via
arbitrary_queryAccess Schema: View the OpenTelemetry schema to help with query construction using
get_logfire_records_schema
The server supports analysis of distributed traces and metrics for time periods up to 7 days.
Enables access and analysis of OpenTelemetry traces and metrics data stored in Logfire, with tools for finding exceptions, retrieving trace information, and executing SQL queries against telemetry data.
Integrates with Logfire, a Pydantic service, to retrieve and analyze application telemetry data through the Logfire APIs using read tokens from the Logfire project settings.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Logfire MCP Server find the 10 most recent exceptions in app.py from the last hour"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Pydantic Logfire MCP Server
This repository is archived. The STDIO MCP server in this package is no longer being updated. We now have a remote MCP server, which allows us to iterate faster on tools and provide a better experience.
Read more in our documentation.
If you have any questions, reach out to us on Slack or email us at engineering@pydantic.dev.
Available Tools
4 toolsarbitrary_queryB
Run an arbitrary query on the Pydantic Logfire database.
The SQL reference is available via the `sql_reference` tool.
Inputs: query (required), age (required). Returns: result
find_exceptions_in_fileA
Get the details about the 10 most recent exceptions on the file.
Inputs: filepath (required), age (required). Returns: result
logfire_linkA
Creates a link to help the user to view the trace in the Logfire UI.
Inputs: trace_id (required). Returns: result
schema_referenceA
The database schema for the Logfire DataFusion database.
This includes all tables, columns, and their types as well as descriptions.
For example:
```sql
-- The records table contains spans and logs.
CREATE TABLE records (
message TEXT, -- The message of the record
span_name TEXT, -- The name of the span, message is usually templated from this
trace_id TEXT, -- The trace ID, identifies a group of spans in a trace
exception_type TEXT, -- The type of the exception
exception_message TEXT, -- The message of the exception
-- other columns...
);
```
The SQL syntax is similar to Postgres, although the query engine is actually Apache DataFusion.
To access nested JSON fields e.g. in the `attributes` column use the `->` and `->>` operators.
You may need to cast the result of these operators e.g. `(attributes->'cost')::float + 10`.
You should apply as much filtering as reasonable to reduce the amount of data queried.
Filters on `start_timestamp`, `service_name`, `span_name`, `metric_name`, `trace_id` are efficient.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool serves a unique purpose: querying, exception viewing, link generation, and schema reference. No overlap or ambiguity.
All tools use consistent snake_case naming with clear verbs (arbitrary_query, find_exceptions_in_file, logfire_link, schema_reference).
With 4 tools, the set is concise and well-scoped for querying and debugging Logfire databases, covering key workflows without bloat.
The set covers querying, schema exploration, exception analysis, and UI linking. Missing explicit write operations, but that may be by design.
Maintenance
Related MCP Connectors
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Query application logs, traces, and metrics from your AI coding assistant via Foam's MCP server.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Related MCP Servers
- AlicenseBqualityNot gradedmaintenanceA Model Context Protocol server that enables AI assistants to interact with Datadog's observability platform through natural language.72MIT
- AlicenseNot gradedqualityNot gradedmaintenanceA Model Context Protocol server that provides access to Observe API functionality, enabling LLMs to execute OPAL queries, manage datasets/monitors, and leverage vector search for documentation and troubleshooting runbooks.1-
- AlicenseBqualityDmaintenanceModel Context Protocol server for Langfuse observability. Query traces, analyze accuracy, detect failures, track costs, debug latency, manage prompts and datasets.582MIT
- AlicenseAqualityCmaintenanceA Model Context Protocol server that enables LLMs to interact with MLflow tracking servers, allowing users to query experiments, analyze runs, compare metrics, manage the model registry, and promote models through natural language.40296 PyPI15MIT