langfuse-mcp

MCP.Pizza Chef: avivsinai

Langfuse records what happened inside each request to an AI feature — the prompts, the responses, the costs, the errors. Finding the bad one usually means scrolling a dashboard. This lets an assistant query those records directly, so you can ask which requests failed, what a specific one did, or where the cost went. Works in Claude Desktop and Cursor, and needs keys from your Langfuse project.

Coding
Data

Use This MCP server To

Find which requests failed recently See exactly what one request did Work out where the cost is going Compare a working and a failing request Check how long requests are taking Get a summary of recent errors

README

Langfuse MCP (Model Context Protocol)

Test PyPI version Python 3.10+ License: MIT

This project provides a Model Context Protocol (MCP) server for Langfuse, allowing AI agents to query Langfuse trace data for better debugging and observability.

Features

  • Integration with Langfuse for trace and observation data
  • Tool suite for AI agents to query trace data
  • Exception and error tracking capabilities
  • Session and user activity monitoring

Available Tools

The MCP server provides the following tools for AI agents:

  • fetch_traces - Find traces based on criteria like user ID, session ID, etc.
  • fetch_trace - Get a specific trace by ID
  • fetch_observations - Get observations filtered by type
  • fetch_observation - Get a specific observation by ID
  • fetch_sessions - List sessions in the current project
  • get_session_details - Get detailed information about a session
  • get_user_sessions - Get all sessions for a user
  • find_exceptions - Find exceptions and errors in traces
  • find_exceptions_in_file - Find exceptions in a specific file
  • get_exception_details - Get detailed information about an exception
  • get_error_count - Get the count of errors
  • get_data_schema - Get schema information for the data structures

Setup

Install uv

First, make sure uv is installed. 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.

langfuse-mcp FAQ

Can I use this to find out why one request failed?
Yes — you can ask about a specific trace and get its details without scrolling the dashboard.
Do I need an account or keys?
Yes, keys from your own Langfuse project.
Which apps does it work with?
It is documented for Claude Desktop and Cursor.
Can I use this to check costs?
Yes — cost and timing information recorded against requests can be queried.
How hard is it to set up?
It installs through common Python tools and takes your project keys, so expect a short technical setup.