Servidor Logfire Mcp
Resumen
¿Qué es Logfire MCP?
Logfire MCP es una solución de servidor innovadora desarrollada por la organización Pydantic. Sirve como una plataforma robusta diseñada para mejorar las capacidades de registro y simplificar los procesos de gestión de datos. Con su interfaz fácil de usar y potentes características, Logfire MCP tiene como objetivo simplificar las complejidades de la gestión de registros para desarrolladores y organizaciones por igual.
Características de Logfire MCP
- Interfaz Amigable: Logfire MCP ofrece una interfaz intuitiva que permite a los usuarios navegar fácilmente a través de sus características y funcionalidades.
- Registro en Tiempo Real: El servidor proporciona capacidades de registro en tiempo real, lo que permite a los usuarios monitorear y analizar registros a medida que ocurren.
- Gestión de Datos: Logfire MCP simplifica la gestión de datos al permitir a los usuarios categorizar, filtrar y buscar registros de manera eficiente.
- Capacidades de Integración: El servidor se puede integrar con varias aplicaciones y servicios, mejorando su funcionalidad y usabilidad.
- Escalabilidad: Logfire MCP está diseñado para escalar con tus necesidades, acomodando volúmenes de datos crecientes sin comprometer el rendimiento.
Cómo Usar Logfire MCP
- Instalación: Comienza descargando el servidor Logfire MCP del repositorio oficial de Pydantic. Sigue las instrucciones de instalación proporcionadas en la documentación.
- Configuración: Configura los ajustes del servidor de acuerdo a tus requisitos. Esto incluye establecer parámetros de registro, opciones de almacenamiento de datos y configuraciones de integración.
- Comenzar a Registrar: Una vez configurado, inicia el servidor y comienza a registrar los datos de tu aplicación. Utiliza la función de registro en tiempo real para monitorear los registros a medida que se generan.
- Analizar Registros: Usa las herramientas integradas para analizar y gestionar tus registros. Puedes filtrar, buscar y categorizar registros para obtener información sobre el rendimiento de tu aplicación.
- Integrar con Otras Herramientas: Si es necesario, integra Logfire MCP con otras herramientas y servicios para mejorar sus capacidades y optimizar tu flujo de trabajo.
Preguntas Frecuentes
P: ¿Qué lenguajes de programación soporta Logfire MCP?
R: Logfire MCP está diseñado para trabajar con múltiples lenguajes de programación, lo que lo hace versátil para varios entornos de desarrollo.
P: ¿Es Logfire MCP de código abierto?
R: Sí, Logfire MCP es un repositorio público, lo que permite a los desarrolladores contribuir y modificar el código según sea necesario.
P: ¿Cómo puedo reportar problemas o contribuir a Logfire MCP?
R: Puedes reportar problemas o contribuir al proyecto visitando el repositorio de GitHub y siguiendo las pautas de contribución proporcionadas.
P: ¿Cuáles son los requisitos del sistema para ejecutar Logfire MCP?
R: Los requisitos del sistema pueden variar según la escala de tu aplicación, pero en general, requiere un servidor con suficiente potencia de procesamiento y memoria para manejar las operaciones de registro de manera eficiente.
P: ¿Dónde puedo encontrar la documentación para Logfire MCP?
R: La documentación para Logfire MCP está disponible en el repositorio de GitHub, proporcionando instrucciones detalladas sobre instalación, configuración y uso.
Detalle
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-urlargument:
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.
Configuración del Servidor
{
"mcpServers": {
"logfire-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--pydantic--logfire-mcp--logfire-mcp",
"logfire-mcp"
],
"env": {}
}
}
}Información del Proyecto
Servidor Logfire Mcp Alternativas
Para algunas alternativas a Servidor Logfire Mcp que puedas necesitar, te ofrecemos sitios divididos por categoría.
Interactúa con la API de Paddle utilizando asistentes de IA como Claude, o en IDEs potenciados por IA como Cursor. Gestiona el catálogo de productos, la facturación y suscripciones, y los informes.
Ejecuta de manera segura código generado por IA en entornos aislados con estado que funcionen indefinidamente.
Agente de IA que maneja tareas de ingeniería de principio a fin: se integra con las herramientas de los desarrolladores, planifica, ejecuta e itera hasta lograr un resultado exitoso.
Crear un Servidor MCP Requisitos Previos - Java: Asegúrate de tener Java instalado en tu sistema. Puedes verificarlo ejecutando `java -version` en la terminal. - MCP: Descarga la última versión de MCP desde el [sitio oficial de MCP](http://mcp.ocean-labs.de/). Pasos para Crear el Servidor 1. Descargar MCP: - Ve al sitio oficial y descarga el archivo comprimido de MCP. - Extrae el contenido en una carpeta de tu elección. 2. Configurar MCP: - Navega a la carpeta extraída de MCP. - Abre el archivo `mcp.cfg` y ajusta las configuraciones según tus necesidades. 3. Iniciar el Servidor: - Abre una terminal y navega a la carpeta de MCP. - Ejecuta el siguiente comando para iniciar el servidor: ``` ./start.sh ``` - Si estás en Windows, usa: ``` start.bat ``` 4. Conectar al Servidor: - Abre tu cliente de Minecraft. - Ve a "Multijugador" y selecciona "Agregar servidor". - Introduce la dirección IP de tu servidor y haz clic en "Listo". 5. Configurar Plugins (Opcional): - Si deseas agregar plugins, busca los que sean compatibles con tu versión de MCP. - Coloca los archivos de los plugins en la carpeta `plugins` de tu servidor. Solución de Problemas - El servidor no inicia: Asegúrate de que Java esté correctamente instalado y que estés en la carpeta correcta. - Problemas de conexión: Verifica que la dirección IP sea correcta y que el puerto esté abierto en tu firewall. Conclusión Ahora tienes un servidor MCP funcionando. Puedes comenzar a personalizarlo y jugar con tus amigos. ¡Diviértete!