pydantic/logfire-mcp
logfire-mcp is hosted online, so all tools can be tested directly either in theInspector tabor in theOnline Client.
If you are the rightful owner of logfire-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Logfire MCP Server is a Model Context Protocol server that allows LLMs to access and analyze OpenTelemetry traces and metrics sent to Logfire.
Try logfire-mcp with chat:
Tools
Functions exposed to the LLM to take actions
find_exceptions_in_file
Get the details about the 10 most recent exceptions on the file.
arbitrary_query
Run an arbitrary query on the Pydantic Logfire database.
The SQL reference is available via the `sql_reference` tool.
logfire_link
Creates a link to help the user to view the trace in the Logfire UI.
schema_reference
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.
Prompts
Interactive templates invoked by user choice
No prompts
Resources
Contextual data attached and managed by the client
sql_reference
URI: config://sql_reference
MIME: text/plain
Contains a reference for the SQL syntax that can be used to query the Logfire database.
This tool should be called before any other tool.