Langfuse MCP logo

Langfuse MCP

by avivsinai

Connects MCP clients to Langfuse for trace debugging, exception analysis, metrics, prompts, datasets, and annotation queues.

Install Langfuse MCP

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "avivsinai-langfuse-mcp": {
      "command": "uvx",
      "args": [
        "langfuse-mcp"
      ],
      "env": {
        "LANGFUSE_PUBLIC_KEY": "YOUR_VALUE_HERE",
        "LANGFUSE_SECRET_KEY": "YOUR_VALUE_HERE",
        "LANGFUSE_HOST": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Install not yet sandbox-tested— the server itself is confirmed live (we called its tools/list endpoint). The stdio install command is a separate, ongoing check.

Overview

avivsinai/langfuse-mcp connects MCP clients to Langfuse through the Python SDK and runs locally over stdio or HTTP. Its tools cover traces, observations, sessions, error investigation, prompts, datasets, annotation queues, scores, and aggregated metrics. Reach for it when an agent needs to inspect LLM application telemetry, investigate failing traces, manage evaluation data, or query Langfuse project resources. The server requires Langfuse API credentials and supports Langfuse Cloud or a configured self-hosted endpoint, with some metrics functionality limited to Cloud.

Use cases

  • Debug failing Langfuse traces and observations
  • Investigate error-level observations by file or function
  • Analyze latency, cost, token, and score metrics
  • Manage evaluation datasets and dataset runs
  • Create and assign annotation queue work

Key features

  • Trace, session, and observation retrieval
  • Exception grouping and detailed error inspection
  • Server-side metrics aggregation
  • Dataset and evaluation-run management
  • Prompt and annotation queue operations
  • Compact, full JSON, and file-oriented output modes

Tools48

What Langfuse MCP lets your agent do. Expand a tool for its parameters.

Verified live~14.7k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

20/20 checks healthy over the last 78d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 8d ago via OSV.dev · langfuse-mcp (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars112Stargazers on the source repository.
Last commit2d agoMost recent push to the default branch.
Tools exposed48Callable tools this server registers over MCP.
Directory activity6 viewsConfig copies, upvotes, and views on AllMCPs.

How Langfuse MCP works

What avivsinai/langfuse-mcp does

avivsinai/langfuse-mcp exposes Langfuse project data and operations through MCP tools. It is focused on local, agent-assisted investigation of LLM application behavior, including trace and observation lookup, session analysis, error triage, prompt management, dataset operations, annotation queues, scores, and metrics.

Exception tools identify observations whose level is ERROR, group them by fields such as file path, function, exception type, observation name, or observation type, and return representative trace and observation identifiers. Detailed tools can inspect errors for a file or a particular trace and support compact, full JSON string, or file-oriented output modes.

Dataset tools support evaluation workflows: listing and inspecting datasets, adding or removing items, storing input and expected-output pairs, linking items to traces or observations, and working with dataset runs. Annotation queue tools cover queue creation, item management, status updates, and user assignments.

How it works

The server uses the Langfuse Python SDK to serve MCP requests. It can be launched locally with uvx langfuse-mcp and connected to an MCP client using stdio; the project also supports HTTP deployment. Agents can call pagination-aware list operations, apply filters to observations, and choose response formats where the tool provides an output_mode parameter.

For analytics, query_metrics sends aggregation queries to Langfuse rather than requiring an agent to download and process raw observations. get_metrics_schema describes available views, dimensions, measures, aggregations, operators, and query structure before a metrics request is assembled.

A bundled langfuse agent skill provides workflows for trace debugging, exception triage, latency analysis, prompt work, and dataset tasks. The skill guides tool selection, while the MCP server performs the Langfuse operations.

Setup and configuration

Install uv, then provide Langfuse credentials when registering the server with an MCP client. The quick-start configuration uses:

  • LANGFUSE_PUBLIC_KEY for the project’s public API key
  • LANGFUSE_SECRET_KEY for the project’s secret API key
  • LANGFUSE_HOST for the Langfuse endpoint, such as https://cloud.langfuse.com or a self-hosted URL

Python 3.10 or newer is required. Claude Code and Codex CLI examples use uvx langfuse-mcp; after registration, restart the client and verify that the MCP server is available. The included skill can be installed for Claude Code or Codex through the repository’s skill files, the add-skill utility, or a manual copy into the client’s skills directory.

Tools and capabilities

The tool set includes:

  • Trace, session, observation, and user-session retrieval
  • Exception grouping, file-level investigation, trace-level details, and error counts
  • Route-decision discovery and summaries
  • Prompt listing, retrieval, creation, and label updates
  • Dataset and dataset-run management, including item upserts
  • Annotation queues, queue items, and assignments
  • Score reads and server-side metrics queries
  • Data-schema and metrics-schema inspection

Dataset item creation behaves as an upsert when an existing item_id is supplied. Dataset runs use the experiments API when the installed SDK supports it, with older routes available as a fallback for some self-hosted deployments.

Limitations and notes

The Langfuse v2 metrics endpoint is available only in Langfuse Cloud. Newly ingested telemetry can take time to appear, with OpenTelemetry ingestion delays of up to roughly ten minutes. High-cardinality fields such as IDs, user IDs, and session IDs are intended as filters rather than metric dimensions.

Trace retrieval depends on root observations: traces without one are omitted from trace listings and cannot be found through the single-trace lookup. Exception counts represent error-level observations, not individual exception events, and error details depend on exception metadata recorded in Langfuse. Deleting dataset items is permanent. Dataset-run deletion may remove associated traces, observations, and related scores when the legacy deletion route is unavailable and trace deletion is explicitly used.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Langfuse MCP

avivsinai/langfuse-mcp is an MCP server that connects AI clients to Langfuse through the Python SDK and exposes tools for traces, observations, exceptions, sessions, prompts, datasets, annotation queues, scores, and metrics. It supports local stdio or HTTP deployment for debugging and analyzing LLM application telemetry.

Install it with `uvx langfuse-mcp` after installing `uv`, then register that command with your MCP client and provide the Langfuse API environment variables. Python 3.10 or newer is required. The documented setup includes commands for Claude Code and Codex CLI.

Set `LANGFUSE_PUBLIC_KEY`, `LANGFUSE_SECRET_KEY`, and `LANGFUSE_HOST`. The first two identify and authenticate to the Langfuse project, while `LANGFUSE_HOST` selects Langfuse Cloud or a self-hosted endpoint.

Yes, it works with Cursor through MCP. The server is described as compatible with Cursor and other MCP clients, and it can run locally using the `uvx langfuse-mcp` command with the required Langfuse credentials.

Yes, it provides `query_metrics` and `get_metrics_schema` for aggregated cost, latency, token, count, and score queries. The v2 metrics endpoint is Langfuse Cloud-only, and recently ingested data may take up to roughly ten minutes to appear.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewLangfuse MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/avivsinai-langfuse-mcp?style=directory)](https://allmcps.com/mcp/avivsinai-langfuse-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/avivsinai-langfuse-mcp"><img src="https://allmcps.com/api/badge/avivsinai-langfuse-mcp?style=directory" alt="Langfuse MCP on AllMCPs" /></a>