Skip to main content
MCP server CX Codex

langfuse — Claude Code MCP server: what it does, how to install

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

Install into Claude Code · Platform CLI All methods and platforms ↓
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
Open on GitHub

What langfuse 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.

What it helps with

  • 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 for the agent

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

How to install langfuse

Platform CLI

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

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about langfuse

How do I install langfuse in Claude Code?

Run `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`.

What does langfuse do?

It gives an agent read-only access to Langfuse traces and observations, with filters and detail views for models, scores, costs, and latency.

What credentials does langfuse need?

Set LANGFUSE_SECRET_KEY and LANGFUSE_PUBLIC_KEY. Use LANGFUSE_BASE_URL when the API should use a different endpoint.

Similar MCP servers

All MCP servers for AI and ML →

From the same set17

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor