Langfuse MCP Server

A local MCP and skill for Langfuse: read traces, sessions and exceptions from an agent, with compact output or a file dump.

  • 112 ★ on the repository
  • Last commit
MCP server

Extended access

Why this level

  • Langfuse project keys are handed to a local process and some tools modify prompts and datasets and delete their items.
All reasons and checks

avivsinai/langfuse-mcp

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add mcp/langfuse-mcp-server

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • Langfuse project keys are handed to a local process and some tools modify prompts and datasets and delete their items.

This is third-party code. Review the repository files before installing.

What it does

Langfuse MCP Server gives an agent Langfuse observability data: traces, observations, sessions, exceptions, prompts, datasets, annotation queues, scores and metrics. It has 48 tools such as `fetch_trace`, `find_exceptions`, `get_exception_details` and `query_metrics`. A request like "find exceptions in the last day" becomes a chain: group errors by file, drill into a file, open a specific trace. The repository also ships a `langfuse` skill with ready playbooks for trace debugging, exception triage, latency analysis and prompt and dataset work. The server runs locally over stdio or HTTP through the Langfuse Python SDK. Output is controlled by compact summaries, a mode that dumps full JSON to a file, and the `--tools traces,prompts` flag that selects tool groups.

Who it is for. Developers of LLM applications traced in Langfuse who want to triage errors and latency from Claude Code, Codex or Cursor without opening the web interface.

Good fit when

  • After a release an agent system shows more errors and they should be grouped by file.
  • A user complains about a slow answer and the full session with its traces is needed.
  • Prompt versions should be compared and labels switched from a conversation with the agent.
  • The agent's context overflows and a tool answer is better dumped to a file.
  • Cost and p95 latency by model should come from one metrics query.

Not a fit when

  • Hosted zero-install access is wanted, since Langfuse has its own HTTP MCP.
  • The agent must write scores, comments and model data, which this server does not offer.
  • Langfuse keys cannot be handed to a local process on a developer machine.

Example request

Find exceptions in Langfuse for the last day, group them by file and drill into the trace of the most frequent error.

MCP

Transport
stdio, http
Authentication
API key

Environment variables

LANGFUSE_PUBLIC_KEY required
Public key of the Langfuse project from Settings, API Keys.
LANGFUSE_SECRET_KEY required, secret
Secret key of the Langfuse project.
LANGFUSE_HOST required
Langfuse address: cloud `https://cloud.langfuse.com` or your own instance.
LANGFUSE_MCP_READ_ONLY
The value `true` disables all write operations.

Limitations

The server needs `uv`, Python 3.10 or newer and Langfuse project API keys (`LANGFUSE_PUBLIC_KEY`, `LANGFUSE_SECRET_KEY`, `LANGFUSE_HOST`). Some of the 48 tools change data: creating prompts and datasets and deleting dataset items; `--read-only` enables safe reading. Writing scores, comments, models and media is not supported. In Observations API v2, traces without a root observation are not found, and v2 metrics exist only in Langfuse Cloud, so a self-hosted instance may return 404.

How to disable. Run `claude mcp remove langfuse` or `codex mcp remove langfuse` and delete the skill from `~/.claude/skills/langfuse` or `~/.codex/skills/langfuse`. Revoke the Langfuse keys in project settings if needed.

FAQ

Which tools should I call first?

`find_exceptions` groups errors by file, `find_exceptions_in_file` shows a file's records and `get_exception_details` opens the trace. For an overview use `fetch_traces` and `query_metrics`.

How do I forbid changes?

Start `langfuse-mcp --read-only` or set `LANGFUSE_MCP_READ_ONLY=true`. The create and delete tools turn off and reading stays.

How do I cut token use?

Load only the groups you need with `--tools traces,prompts` and set `--default-output-mode full_json_file`; the full answer then goes to a file and a short summary enters the conversation.

How does it differ from the native Langfuse MCP?

This server targets local debugging: traces, sessions, exceptions and route decisions. The native HTTP MCP covers more of the API and can write scores and comments.

How do I verify the connection?

Restart the client and run `/mcp` in Claude Code or `codex mcp list` in Codex. The langfuse server should appear in the list.

Discussion

No questions or reviews yet.

Official

A local code graph with version history: an MCP server that tells the agent who calls a function and what an edit breaks

MCP serverExtended access511Repository stars

A bridge from an LSP language server to the agent: definitions, references, diagnostics, hover and symbol rename

MCP serverExtended access1.6KRepository stars

An MCP server that builds a code graph once and serves the answer to the agent instead of re-reading files

MCP serverExtended access202Repository stars

mcpdoc

MCP LLMS-TXT Documentation Server

An MCP server from LangChain that serves docs from the llms.txt files you choose, with auditable tool calls

MCP serverExtended access1KRepository stars

A transparent proxy between an AI client and an MCP server: shows every JSON-RPC frame in the terminal, checks a capture in CI and exports spans

CLIBroad access367Repository stars

An MCP server that lets an agent read files, search code and run commands in a workspace

MCP serverBroad access1.2KRepository stars

README in short

A comparison table with the native Langfuse MCP, a quick start for Claude Code and Codex, a table of 48 tools by group, selective loading, read-only mode and output modes.

README badge

Report a problem

Foxx AILangfuse MCP Server
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.