Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
avivsinai avatar

Langfuse

  • 113 installs
  • 102 repo stars
  • Updated June 27, 2026
  • avivsinai/langfuse-mcp

langfuse is a Claude Code skill for debugging AI agents and LLM applications through the Langfuse MCP observability server.

About

langfuse is a Claude Code skill for debugging AI agents and LLM applications through Langfuse observability via the langfuse-mcp server. It provides playbooks that move from broad trace discovery to a root-cause hypothesis, covering exceptions, traces, slow generations, sessions, prompt versions, and datasets. A developer uses it when investigating what went wrong or why an LLM call is slow. It documents the highest-value MCP tools such as find_exceptions, fetch_trace, and fetch_observations.

  • Debug AI agents and LLM apps through Langfuse observability via the langfuse-mcp server
  • Playbooks for exception triage, trace inspection, latency analysis, sessions, prompts, and datasets
  • Includes read-only mode and setup steps for connecting langfuse-mcp to Claude Code or Codex

Langfuse by the numbers

  • 113 all-time installs (skills.sh)
  • Ranked #235 of 596 Debugging skills by installs in the Skillselion catalog
  • Data as of Jul 30, 2026 (Skillselion catalog sync)
At a glance

langfuse capabilities & compatibility

Requires Langfuse public and secret API keys; Langfuse Cloud has a free tier, or self-host.

Capabilities
llm observability · exception triage · trace inspection · latency analysis
Works with
anthropic · openai
Use cases
debugging · data analysis
Runs
Runs locally
Pricing
Bring your own API key
From the docs

What langfuse says it does

Debug AI agents and LLM applications via Langfuse MCP. Use when investigating traces, exceptions, slow generations, sessions, prompt versions, datasets, or evaluation sets.
SKILL.md
This skill is the agent-facing companion to `langfuse-mcp`.
SKILL.md
npx skills add https://github.com/avivsinai/langfuse-mcp --skill langfuse

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs113
repo stars102
Last updatedJune 27, 2026
Repositoryavivsinai/langfuse-mcp

What it does

Investigating exceptions, slow generations, and traces in an LLM app using Langfuse via MCP.

Who is it for?

Investigating exceptions, slow generations, traces, sessions, prompt versions, and datasets in an LLM application.

Skip if: Tasks unrelated to LLM observability or without a Langfuse instance and keys.

When should I use this skill?

You need to find exceptions, inspect a trace, diagnose slow generations, or manage prompts and datasets in Langfuse.

What you get

A concrete root-cause hypothesis reached by moving from broad trace discovery to the exact failing observation.

  • root-cause hypothesis
  • trace and exception analysis

By the numbers

  • requires Python 3.10 or newer
  • 6 debugging playbooks

Files

SKILL.mdMarkdownGitHub ↗

Langfuse Skill

Debug AI agents and LLM applications through Langfuse observability.

This skill is the agent-facing companion to langfuse-mcp. It tells Claude Code and Codex when to use Langfuse, which MCP tool to call first, and how to move from broad trace discovery to a concrete root-cause hypothesis.

Triggers: langfuse, traces, debug AI, find exceptions, set up langfuse, what went wrong, why is it slow, datasets, evaluation sets

What This Skill Provides

  • Setup steps for connecting langfuse-mcp to Claude Code or Codex.
  • Playbooks for exception triage, trace inspection, latency analysis, sessions, prompts, and datasets.
  • A quick reference for the highest-value MCP tools.
  • Links to full setup and tool references for deeper troubleshooting.

Use the playbooks before guessing at individual tools. Start broad, identify the relevant trace/session/observation, then drill into the exact failure or slow path.

Setup

Step 1: Get credentials from https://cloud.langfuse.com → Settings → API Keys

If self-hosted, use your instance URL for LANGFUSE_HOST and create keys there.

Step 2: Install MCP (pick one):

Requires Python 3.10 or newer. CI verifies Python 3.10 through 3.14.

# Claude Code (project-scoped, shared via .mcp.json)
claude mcp add \
  --scope project \
  --env LANGFUSE_PUBLIC_KEY=pk-... \
  --env LANGFUSE_SECRET_KEY=sk-... \
  --env LANGFUSE_HOST=https://cloud.langfuse.com \
  langfuse -- uvx langfuse-mcp

# Codex CLI (user-scoped, stored in ~/.codex/config.toml)
codex mcp add langfuse \
  --env LANGFUSE_PUBLIC_KEY=pk-... \
  --env LANGFUSE_SECRET_KEY=sk-... \
  --env LANGFUSE_HOST=https://cloud.langfuse.com \
  -- uvx langfuse-mcp

Add --python 3.14 before langfuse-mcp if you want to pin a CI-verified interpreter explicitly.

Step 3: Restart CLI, verify with /mcp (Claude) or codex mcp list (Codex)

Step 4: Test: fetch_traces(age=60)

Read-Only Mode

For safer observability without risk of modifying prompts or datasets, enable read-only mode:

# CLI flag
langfuse-mcp --read-only

# Or environment variable
LANGFUSE_MCP_READ_ONLY=true

This disables write tools: create_text_prompt, create_chat_prompt, update_prompt_labels, create_dataset, create_dataset_item, delete_dataset_item.

Default Output Mode

If you want MCP clients to default to writing full payloads to files when they omit output_mode, configure:

langfuse-mcp --default-output-mode full_json_file

# Or via environment variable
LANGFUSE_MCP_DEFAULT_OUTPUT_MODE=full_json_file

For manual .mcp.json setup or troubleshooting, see references/setup.md.

---

Playbooks

"Where are the errors?"

find_exceptions(age=1440, group_by="file")

→ Shows error counts by file. Pick the worst offender.

find_exceptions_in_file(filepath="src/ai/chat.py", age=1440)

→ Lists specific exceptions. Grab a trace_id.

get_exception_details(trace_id="...")

→ Full stacktrace and context.

---

"What happened in this interaction?"

fetch_traces(age=60, user_id="...")

→ Find the trace. Note the trace_id.

If you don't know the user_id, start with:

fetch_traces(age=60)
fetch_trace(trace_id="...", include_observations=true)

→ See all LLM calls in the trace.

fetch_observation(observation_id="...")

→ Inspect a specific generation's input/output.

---

"Why is it slow?"

fetch_observations(age=60, type="GENERATION")

→ Find recent LLM calls. Look for high latency.

fetch_observation(observation_id="...")

→ Check token counts, model, timing.

---

"What's this user experiencing?"

get_user_sessions(user_id="...", age=1440)

→ List their sessions.

get_session_details(session_id="...")

→ See all traces in the session.

---

"Manage datasets"

list_datasets()

→ See all datasets.

get_dataset(name="evaluation-set-v1")

→ Get dataset details.

list_dataset_items(dataset_name="evaluation-set-v1", page=1, limit=10)

→ Browse items in the dataset.

create_dataset(name="qa-test-cases", description="QA evaluation set")

→ Create a new dataset.

create_dataset_item(
  dataset_name="qa-test-cases",
  input={"question": "What is 2+2?"},
  expected_output={"answer": "4"}
)

→ Add test cases.

create_dataset_item(
  dataset_name="qa-test-cases",
  item_id="item_123",
  input={"question": "What is 3+3?"},
  expected_output={"answer": "6"}
)

→ Upsert: updates existing item by id or creates if missing.

---

"Manage prompts"

list_prompts()

→ See all prompts with labels.

get_prompt(name="...", label="production")

→ Fetch current production version.

create_text_prompt(name="...", prompt="...", labels=["staging"])

→ Create new version in staging.

update_prompt_labels(name="...", version=N, labels=["production"])

→ Promote to production. (Rollback = re-apply label to older version)

---

Quick Reference

TaskTool
List tracesfetch_traces(age=N)
Get trace detailsfetch_trace(trace_id="...", include_observations=true)
List LLM callsfetch_observations(age=N, type="GENERATION")
Get observationfetch_observation(observation_id="...")
Error countget_error_count(age=N)
Find exceptionsfind_exceptions(age=N, group_by="file")
List sessionsfetch_sessions(age=N)
User sessionsget_user_sessions(user_id="...", age=N)
List promptslist_prompts()
Get promptget_prompt(name="...", label="production")
List datasetslist_datasets()
Get datasetget_dataset(name="...")
List dataset itemslist_dataset_items(dataset_name="...", limit=N)
Create/update dataset itemcreate_dataset_item(dataset_name="...", item_id="...")

age = minutes to look back (max 10080 = 7 days)

---

Troubleshooting

MCP connection fails

  • Verify credentials: check LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_HOST
  • Restart CLI after adding/updating MCP config
  • Test MCP independently: fetch_traces(age=60) — if this fails, the issue is MCP, not the skill
  • See references/setup.md for detailed troubleshooting

No traces found

  • Increase the age parameter (default lookback may be too short)
  • Verify your application is sending traces to the correct Langfuse project
  • Check LANGFUSE_HOST points to the right instance (cloud vs self-hosted)

Permission denied

  • Regenerate API keys from Langfuse dashboard
  • Ensure keys have the required scopes for the operation
  • Write operations require read-write keys (not read-only mode)

---

References

  • references/tool-reference.md — Full parameter docs, filter semantics, response schemas
  • references/setup.md — Manual setup, troubleshooting, advanced configuration

Related skills

FAQ

How do I connect Langfuse to Claude Code?

Run claude mcp add with LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, and LANGFUSE_HOST env vars pointing at uvx langfuse-mcp.

Can I use it without risking writes?

Yes. Read-only mode via --read-only or LANGFUSE_MCP_READ_ONLY=true disables write tools like create_text_prompt and create_dataset.

Debuggingmonitoring

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.