Prerequisites
-
Install uv:
- Ensure
uv is installed on your system. Refer to the uv installation docs for guidance.
- If you have an older version, update it using:
uv self update
-
Obtain a Logfire Read Token:
- Create a “read token” in the “Read Tokens” section of your project settings in Logfire:
Logfire Read Tokens
Running the MCP Server
- Manually Run the Server:
- Use the following command to start the MCP server, replacing
YOUR_READ_TOKEN with your actual read token:
LOGFIRE_READ_TOKEN=YOUR_READ_TOKEN uvx logfire-mcp
- Alternatively, use the
--read-token flag:
uvx logfire-mcp --read-token=YOUR_READ_TOKEN
Configuration with MCP Clients
Configure for Cursor
- Create a
.cursor/mcp.json file in your project root with the following content:
{
"mcpServers": {
"logfire": {
"command": "uvx",
"args": ["logfire-mcp", "--read-token=YOUR-TOKEN"]
}
}
}
Configure for Claude Desktop
- Add the following to your Claude settings:
{
"command": ["uvx"],
"args": ["logfire-mcp"],
"type": "stdio",
"env": {
"LOGFIRE_READ_TOKEN": "YOUR_TOKEN"
}
}
Configure for Cline
- Add to your
cline_mcp_settings.json:
{
"mcpServers": {
"logfire": {
"command": "uvx",
"args": ["logfire-mcp"],
"env": {
"LOGFIRE_READ_TOKEN": "YOUR_TOKEN"
},
"disabled": false,
"autoApprove": []
}
}
}
Customization
- Base URL:
- Override the default Logfire API URL by using the
--base-url argument:
uvx logfire-mcp --base-url=https://your-logfire-instance.com
- Or set the environment variable:
LOGFIRE_BASE_URL=https://your-logfire-instance.com uvx logfire-mcp
Getting Started
-
Obtain a Logfire Read Token:
-
Run the MCP Server:
uvx logfire-mcp --read-token=YOUR_TOKEN
-
Configure Your Preferred Client:
- Use the configuration examples provided above for Cursor, Claude Desktop, or Cline.
-
Start Using the MCP Server:
- Analyze your OpenTelemetry traces and metrics.
Install uv:
- Ensure
uvis installed on your system. Refer to the uv installation docs for guidance. - If you have an older version, update it using:
uv self update
Obtain a Logfire Read Token:
- Create a “read token” in the “Read Tokens” section of your project settings in Logfire:
Logfire Read Tokens
- Use the following command to start the MCP server, replacing
YOUR_READ_TOKENwith your actual read token:LOGFIRE_READ_TOKEN=YOUR_READ_TOKEN uvx logfire-mcp - Alternatively, use the
--read-tokenflag:uvx logfire-mcp --read-token=YOUR_READ_TOKEN
.cursor/mcp.json file in your project root with the following content:
{
"mcpServers": {
"logfire": {
"command": "uvx",
"args": ["logfire-mcp", "--read-token=YOUR-TOKEN"]
}
}
}
{
"command": ["uvx"],
"args": ["logfire-mcp"],
"type": "stdio",
"env": {
"LOGFIRE_READ_TOKEN": "YOUR_TOKEN"
}
}
cline_mcp_settings.json:
{
"mcpServers": {
"logfire": {
"command": "uvx",
"args": ["logfire-mcp"],
"env": {
"LOGFIRE_READ_TOKEN": "YOUR_TOKEN"
},
"disabled": false,
"autoApprove": []
}
}
}
- Override the default Logfire API URL by using the
--base-urlargument:uvx logfire-mcp --base-url=https://your-logfire-instance.com - Or set the environment variable:
LOGFIRE_BASE_URL=https://your-logfire-instance.com uvx logfire-mcp
Obtain a Logfire Read Token:
Run the MCP Server:
uvx logfire-mcp --read-token=YOUR_TOKEN
Configure Your Preferred Client:
- Use the configuration examples provided above for Cursor, Claude Desktop, or Cline.
Start Using the MCP Server:
- Analyze your OpenTelemetry traces and metrics.