Logfire Mcp Server
Panoramica
Che cos'è Logfire MCP?
Logfire MCP è una soluzione server innovativa sviluppata dall'organizzazione Pydantic. Funziona come una piattaforma robusta progettata per migliorare le capacità di registrazione e semplificare i processi di gestione dei dati. Con la sua interfaccia user-friendly e potenti funzionalità, Logfire MCP mira a semplificare le complessità della gestione dei log per sviluppatori e organizzazioni.
Caratteristiche di Logfire MCP
- Interfaccia User-Friendly: Logfire MCP offre un'interfaccia intuitiva che consente agli utenti di navigare facilmente tra le sue funzionalità.
- Registrazione in Tempo Reale: Il server fornisce capacità di registrazione in tempo reale, consentendo agli utenti di monitorare e analizzare i log mentre si verificano.
- Gestione dei Dati: Logfire MCP semplifica la gestione dei dati consentendo agli utenti di categorizzare, filtrare e cercare i log in modo efficiente.
- Capacità di Integrazione: Il server può essere integrato con varie applicazioni e servizi, migliorando la sua funzionalità e usabilità.
- Scalabilità: Logfire MCP è progettato per scalare con le tue esigenze, accogliendo volumi di dati in crescita senza compromettere le prestazioni.
Come Utilizzare Logfire MCP
- Installazione: Inizia scaricando il server Logfire MCP dal repository ufficiale di Pydantic. Segui le istruzioni di installazione fornite nella documentazione.
- Configurazione: Configura le impostazioni del server secondo le tue esigenze. Questo include la configurazione dei parametri di registrazione, delle opzioni di archiviazione dei dati e delle impostazioni di integrazione.
- Inizia a Registrare: Una volta configurato, avvia il server e inizia a registrare i dati della tua applicazione. Utilizza la funzionalità di registrazione in tempo reale per monitorare i log mentre vengono generati.
- Analizza i Log: Usa gli strumenti integrati per analizzare e gestire i tuoi log. Puoi filtrare, cercare e categorizzare i log per ottenere informazioni sulle prestazioni della tua applicazione.
- Integra con Altri Strumenti: Se necessario, integra Logfire MCP con altri strumenti e servizi per migliorare le sue capacità e semplificare il tuo flusso di lavoro.
Domande Frequenti
D: Quali linguaggi di programmazione supporta Logfire MCP?
R: Logfire MCP è progettato per funzionare con più linguaggi di programmazione, rendendolo versatile per vari ambienti di sviluppo.
D: Logfire MCP è open-source?
R: Sì, Logfire MCP è un repository pubblico, che consente agli sviluppatori di contribuire e modificare il codice secondo necessità.
D: Come posso segnalare problemi o contribuire a Logfire MCP?
R: Puoi segnalare problemi o contribuire al progetto visitando il repository GitHub e seguendo le linee guida per i contributi fornite.
D: Quali sono i requisiti di sistema per eseguire Logfire MCP?
R: I requisiti di sistema possono variare in base alla scala della tua applicazione, ma generalmente richiede un server con adeguata potenza di elaborazione e memoria per gestire le operazioni di registrazione in modo efficiente.
D: Dove posso trovare la documentazione per Logfire MCP?
R: La documentazione per Logfire MCP è disponibile nel repository GitHub, fornendo istruzioni dettagliate su installazione, configurazione e utilizzo.
Dettaglio
Logfire MCP Server
This repository contains a Model Context Protocol (MCP) server with tools that can access the OpenTelemetry traces and metrics you've sent to Logfire.
<a href="https://glama.ai/mcp/servers/@pydantic/logfire-mcp"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@pydantic/logfire-mcp/badge" alt="Logfire Server MCP server" /> </a>This MCP server enables LLMs to retrieve your application's telemetry data, analyze distributed traces, and make use of the results of arbitrary SQL queries executed using the Logfire APIs.
Available Tools
-
find_exceptions_in_file
- Get detailed trace information about exceptions in a specific file- Required arguments:
filepath
(string): Path to the file to analyzeage
(int): Number of minutes to look back (max 7 days)
- Required arguments:
-
arbitrary_query
- Run custom SQL queries on your OpenTelemetry traces and metrics- Required arguments:
query
(string): SQL query to executeage
(int): Number of minutes to look back (max 7 days)
- Required arguments:
-
get_logfire_records_schema
- Get the OpenTelemetry schema to help with custom queries- No required arguments
Setup
Install uv
The first thing to do is make sure uv
is installed, as uv
is used to run the MCP server.
For installation instructions, see the uv
installation docs.
If you already have an older version of uv
installed, you might need to update it with uv self update
.
Obtain a Logfire read token
In order to make requests to the Logfire APIs, the Logfire MCP server requires a "read token".
You can create one under the "Read Tokens" section of your project settings in Logfire: https://logfire.pydantic.dev/-/redirect/latest-project/settings/read-tokens
[!IMPORTANT] Logfire read tokens are project-specific, so you need to create one for the specific project you want to expose to the Logfire MCP server.
Manually run the server
Once you have uv
installed and have a Logfire read token, you can manually run the MCP server using uvx
(which is provided by uv
).
You can specify your read token using the LOGFIRE_READ_TOKEN
environment variable:
LOGFIRE_READ_TOKEN=YOUR_READ_TOKEN uvx logfire-mcp@latest
or using the --read-token
flag:
uvx logfire-mcp@latest --read-token=YOUR_READ_TOKEN
[!NOTE] If you are using Cursor, Claude Desktop, Cline, or other MCP clients that manage your MCP servers for you, you do NOT need to manually run the server yourself. The next section will show you how to configure these clients to make use of the Logfire MCP server.
Configuration with well-known MCP clients
Configure for Cursor
Create a .cursor/mcp.json
file in your project root:
{
"mcpServers": {
"logfire": {
"command": "uvx",
"args": ["logfire-mcp@latest", "--read-token=YOUR-TOKEN"]
}
}
}
The Cursor doesn't accept the env
field, so you need to use the --read-token
flag instead.
Configure for Claude Desktop
Add to your Claude settings:
{
"command": ["uvx"],
"args": ["logfire-mcp@latest"],
"type": "stdio",
"env": {
"LOGFIRE_READ_TOKEN": "YOUR_TOKEN"
}
}
Configure for Cline
Add to your Cline settings in cline_mcp_settings.json
:
{
"mcpServers": {
"logfire": {
"command": "uvx",
"args": ["logfire-mcp@latest"],
"env": {
"LOGFIRE_READ_TOKEN": "YOUR_TOKEN"
},
"disabled": false,
"autoApprove": []
}
}
}
Configure for VS Code
Make sure you enabled MCP support in VS Code.
Create a .vscode/mcp.json
file in your project's root directory:
{
"servers": {
"logfire": {
"type": "stdio",
"command": "uvx", // or the absolute /path/to/uvx
"args": ["logfire-mcp@latest"],
"env": {
"LOGFIRE_READ_TOKEN": "YOUR_TOKEN",
"LOGFIRE_BASE_URL": "https://api-eu.pydantic.dev" // choose the correct base url
}
}
}
}
Customization - Base URL
By default, the server connects to the Logfire API at https://api-us.pydantic.dev
. You can override this by:
- Using the
--base-url
argument:
uvx logfire-mcp@latest --base-url=https://your-logfire-instance.com
- Setting the environment variable:
LOGFIRE_BASE_URL=https://your-logfire-instance.com uvx logfire-mcp@latest
Example Interactions
- Get details about exceptions from traces in a specific file:
{
"name": "find_exceptions_in_file",
"arguments": {
"filepath": "app/api.py",
"age": 1440
}
}
Response:
[
{
"created_at": "2024-03-20T10:30:00Z",
"message": "Failed to process request",
"exception_type": "ValueError",
"exception_message": "Invalid input format",
"function_name": "process_request",
"line_number": "42",
"attributes": {
"service.name": "api-service",
"code.filepath": "app/api.py"
},
"trace_id": "1234567890abcdef"
}
]
- Run a custom query on traces:
{
"name": "arbitrary_query",
"arguments": {
"query": "SELECT trace_id, message, created_at, attributes->>'service.name' as service FROM records WHERE severity_text = 'ERROR' ORDER BY created_at DESC LIMIT 10",
"age": 1440
}
}
Examples of Questions for Claude
- "What exceptions occurred in traces from the last hour across all services?"
- "Show me the recent errors in the file 'app/api.py' with their trace context"
- "How many errors were there in the last 24 hours per service?"
- "What are the most common exception types in my traces, grouped by service name?"
- "Get me the OpenTelemetry schema for traces and metrics"
- "Find all errors from yesterday and show their trace contexts"
Getting Started
-
First, obtain a Logfire read token from: https://logfire.pydantic.dev/-/redirect/latest-project/settings/read-tokens
-
Run the MCP server:
uvx logfire-mcp@latest --read-token=YOUR_TOKEN
-
Configure your preferred client (Cursor, Claude Desktop, or Cline) using the configuration examples above
-
Start using the MCP server to analyze your OpenTelemetry traces and metrics!
Contributing
We welcome contributions to help improve the Logfire MCP server. Whether you want to add new trace analysis tools, enhance metrics querying functionality, or improve documentation, your input is valuable.
For examples of other MCP servers and implementation patterns, see the Model Context Protocol servers repository.
License
Logfire MCP is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License.
Configurazione Server
{
"mcpServers": {
"logfire-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--pydantic--logfire-mcp--logfire-mcp",
"logfire-mcp"
],
"env": {}
}
}
}
Informazioni sul Progetto
Logfire Mcp Server Alternative
Per alcune alternative a Logfire Mcp Server che potresti aver bisogno, ti forniamo siti divisi per categoria.
Interagisci con l'API di Paddle utilizzando assistenti AI come Claude, o in IDE potenziati da AI come Cursor. Gestisci il catalogo prodotti, la fatturazione e gli abbonamenti, e i report.
Esegui in modo sicuro codice generato dall'IA in sandbox stateful che funzionano per sempre.
Agente AI che gestisce compiti di ingegneria dall'inizio alla fine: si integra con gli strumenti degli sviluppatori, pianifica, esegue e itera fino a raggiungere un risultato di successo.
Creare un Server MCP Requisiti - Java: Assicurati di avere installato Java JDK. - MCP: Scarica l'ultima versione di Minecraft Coder Pack (MCP) dal sito ufficiale. Passaggi per la Creazione del Server 1. Estrai MCP: Estrai il file ZIP di MCP in una cartella sul tuo computer. 2. Configura MCP: - Apri la cartella estratta. - Modifica il file `mcp.cfg` per impostare le configurazioni desiderate. 3. Avvia MCP: - Apri il terminale o il prompt dei comandi. - Naviga nella cartella di MCP. - Esegui il comando `run.bat` (Windows) o `run.sh` (Linux/Mac) per avviare MCP. 4. Crea il tuo Mod: - Naviga nella cartella `src/main/java` per iniziare a scrivere il tuo codice. - Usa le classi e i metodi di Minecraft per sviluppare il tuo mod. 5. Compila il Mod: - Esegui il comando `gradlew build` per compilare il tuo mod. - Troverai il file `.jar` nella cartella `build/libs`. 6. Avvia il Server: - Copia il file `.jar` nella cartella del tuo server Minecraft. - Avvia il server utilizzando il comando `java -jar nome_del_tuo_mod.jar`. Conclusione Ora hai un server MCP funzionante! Puoi iniziare a testare il tuo mod e fare ulteriori modifiche secondo necessità. Buon divertimento!