# Langfuse MCP

Connects Langfuse telemetry to coding assistants to inspect traces, user sessions, and runtime errors. Useful for debugging AI workflows from your terminal.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 112
- Author: avivsinai
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/avivsinai/langfuse-mcp
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/langfuse-mcp

## What it does

The server supplies 48 tools focused on reading traces, observations, user sessions, and routing decisions. It aims at local troubleshooting rather than broad API coverage. Unlike the hosted official server, it includes route-decision analysis and compact output modes. It cannot write scores or manage comments.

Error tracking inspects observation entries with a strict `level == "ERROR"` filter. A text message alone will not trigger it. Results group failures by file or category, returning up to 50 groups alongside representative trace IDs.

Running this tool requires `uvx` and Python between 3.10 and 3.14. You must pass valid API credentials via `LANGFUSE_PUBLIC_KEY` and `LANGFUSE_SECRET_KEY` on startup.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `LANGFUSE_PUBLIC_KEY`, `LANGFUSE_SECRET_KEY`, `LANGFUSE_HOST`, `LANGFUSE_MCP_READ_ONLY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env LANGFUSE_PUBLIC_KEY=<LANGFUSE_PUBLIC_KEY> --env LANGFUSE_SECRET_KEY=<LANGFUSE_SECRET_KEY> --env LANGFUSE_HOST=<LANGFUSE_HOST> --env LANGFUSE_MCP_READ_ONLY=<LANGFUSE_MCP_READ_ONLY> --transport stdio langfuse-mcp -- uvx langfuse-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from langfuse-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add langfuse-mcp --env LANGFUSE_PUBLIC_KEY=<LANGFUSE_PUBLIC_KEY> --env LANGFUSE_SECRET_KEY=<LANGFUSE_SECRET_KEY> --env LANGFUSE_HOST=<LANGFUSE_HOST> --env LANGFUSE_MCP_READ_ONLY=<LANGFUSE_MCP_READ_ONLY> -- uvx langfuse-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from langfuse-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "langfuse-mcp": {
            "command": "uvx",
            "args": [
                "langfuse-mcp"
            ],
            "env": {
                "LANGFUSE_PUBLIC_KEY": "<LANGFUSE_PUBLIC_KEY>",
                "LANGFUSE_SECRET_KEY": "<LANGFUSE_SECRET_KEY>",
                "LANGFUSE_HOST": "<LANGFUSE_HOST>",
                "LANGFUSE_MCP_READ_ONLY": "<LANGFUSE_MCP_READ_ONLY>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from langfuse-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "langfuse-mcp": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "langfuse-mcp"
            ],
            "env": {
                "LANGFUSE_PUBLIC_KEY": "<LANGFUSE_PUBLIC_KEY>",
                "LANGFUSE_SECRET_KEY": "<LANGFUSE_SECRET_KEY>",
                "LANGFUSE_HOST": "<LANGFUSE_HOST>",
                "LANGFUSE_MCP_READ_ONLY": "<LANGFUSE_MCP_READ_ONLY>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from langfuse-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e LANGFUSE_PUBLIC_KEY=<LANGFUSE_PUBLIC_KEY> -e LANGFUSE_SECRET_KEY=<LANGFUSE_SECRET_KEY> -e LANGFUSE_HOST=<LANGFUSE_HOST> -e LANGFUSE_MCP_READ_ONLY=<LANGFUSE_MCP_READ_ONLY> langfuse-mcp uvx langfuse-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from langfuse-mcp <command>

## When to use it
- locate recent errors in execution traces grouped by file
- inspect slow user sessions and identify high latency points
- review low-confidence model routing decisions
- pull prompt definitions and dataset run items into the workspace

## Example prompts
- find exceptions in the last day
- fetch trace details for this trace ID and include observations
- why was this user session slow?

## Similar
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [labelhead-artist-momentum](https://affpapa.org/en/nevibecode/mcp/labelhead-artist-momentum.md) — MCP server · ★ 107423
- [Agent Skills Search Server](https://affpapa.org/en/nevibecode/mcp/agent-skills-search-server.md) — MCP server · ★ 26559
- [Skyvern](https://affpapa.org/en/nevibecode/mcp/skyvern.md) — MCP server · ★ 23263
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9366
- [PraisonAI](https://affpapa.org/en/nevibecode/mcp/praisonai.md) — MCP server · ★ 9289

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
