# langfuse

This MCP server lets an agent inspect Langfuse traces and observations. Use it to debug LLM pipelines and review cost or latency data.

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

## What it does

langfuse exposes read-only tools for exploring Langfuse data. An agent can filter traces by name, user, session, tags, time, or environment, then open a trace with its nested observations and scores. Observation searches can narrow results by type, model, or level.

Strings longer than 1000 characters are shortened in the response, while the complete value is saved under `/tmp/langfuse_*.txt`. The returned path lets an agent search the file with `grep` instead of loading the whole payload. Setup requires `LANGFUSE_SECRET_KEY` and `LANGFUSE_PUBLIC_KEY`; `LANGFUSE_BASE_URL` can point the server at another API endpoint. Without the two key variables, the connection will not work.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `LANGFUSE_SECRET_KEY`, `LANGFUSE_PUBLIC_KEY`, `LANGFUSE_BASE_URL` — 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_SECRET_KEY=<LANGFUSE_SECRET_KEY> --env LANGFUSE_PUBLIC_KEY=<LANGFUSE_PUBLIC_KEY> --env LANGFUSE_BASE_URL=<LANGFUSE_BASE_URL> --transport stdio langfuse -- npx -y langfuse-observability-mcp-server
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add langfuse --env LANGFUSE_SECRET_KEY=<LANGFUSE_SECRET_KEY> --env LANGFUSE_PUBLIC_KEY=<LANGFUSE_PUBLIC_KEY> --env LANGFUSE_BASE_URL=<LANGFUSE_BASE_URL> -- npx -y langfuse-observability-mcp-server
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "langfuse": {
            "command": "npx",
            "args": [
                "-y",
                "langfuse-observability-mcp-server"
            ],
            "env": {
                "LANGFUSE_SECRET_KEY": "<LANGFUSE_SECRET_KEY>",
                "LANGFUSE_PUBLIC_KEY": "<LANGFUSE_PUBLIC_KEY>",
                "LANGFUSE_BASE_URL": "<LANGFUSE_BASE_URL>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "langfuse": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "langfuse-observability-mcp-server"
            ],
            "env": {
                "LANGFUSE_SECRET_KEY": "<LANGFUSE_SECRET_KEY>",
                "LANGFUSE_PUBLIC_KEY": "<LANGFUSE_PUBLIC_KEY>",
                "LANGFUSE_BASE_URL": "<LANGFUSE_BASE_URL>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e LANGFUSE_SECRET_KEY=<LANGFUSE_SECRET_KEY> -e LANGFUSE_PUBLIC_KEY=<LANGFUSE_PUBLIC_KEY> -e LANGFUSE_BASE_URL=<LANGFUSE_BASE_URL> langfuse npx -y langfuse-observability-mcp-server
```
Replace <…> with your own values

## When to use it
- filter Langfuse traces by user and session
- inspect every observation inside a trace
- compare model usage with cost and latency
- search oversized payloads through `grep`

## Example prompts
- Find traces for user `user-123` and group the results by session.
- Open the complete trace with ID `trace-id` and locate the source of its latency.
- List `GENERATION` observations for the selected model and report their costs.

## 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

From the same set: [pulsemcp/mcp-servers](https://affpapa.org/en/nevibecode/by/pulsemcp/mcp-servers.md) — 17 cards

---
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
