{"id":"16f8c8ed-cd94-4204-b375-044c3cd45f15","shortId":"dFbhL6","kind":"skill","title":"langfuse","tagline":"Debug AI agents and LLM applications via Langfuse MCP. Use when investigating traces, exceptions, slow generations, sessions, prompt versions, datasets, or evaluation sets. Triggers on \"langfuse\", \"traces\", \"debug AI\", \"find exceptions\", \"what went wrong\", \"why is it slow\", \"data","description":"# Langfuse Skill\n\nDebug AI agents and LLM applications through Langfuse observability.\n\nThis 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.\n\n**Triggers:** langfuse, traces, debug AI, find exceptions, set up langfuse, what went wrong, why is it slow, datasets, evaluation sets\n\n## What This Skill Provides\n\n- Setup steps for connecting `langfuse-mcp` to Claude Code or Codex.\n- Playbooks for exception triage, trace inspection, latency analysis, sessions, prompts, and datasets.\n- A quick reference for the highest-value MCP tools.\n- Links to full setup and tool references for deeper troubleshooting.\n\nUse the playbooks before guessing at individual tools. Start broad, identify the relevant trace/session/observation, then drill into the exact failure or slow path.\n\n## Setup\n\n**Step 1:** Get credentials from https://cloud.langfuse.com → Settings → API Keys\n\nIf self-hosted, use your instance URL for `LANGFUSE_HOST` and create keys there.\n\n**Step 2:** Install MCP (pick one):\n\nRequires Python 3.10 or newer. CI verifies Python 3.10 through 3.14.\n\n```bash\n# Claude Code (project-scoped, shared via .mcp.json)\nclaude mcp add \\\n  --scope project \\\n  --env LANGFUSE_PUBLIC_KEY=pk-... \\\n  --env LANGFUSE_SECRET_KEY=sk-... \\\n  --env LANGFUSE_HOST=https://cloud.langfuse.com \\\n  langfuse -- uvx langfuse-mcp\n\n# Codex CLI (user-scoped, stored in ~/.codex/config.toml)\ncodex mcp add langfuse \\\n  --env LANGFUSE_PUBLIC_KEY=pk-... \\\n  --env LANGFUSE_SECRET_KEY=sk-... \\\n  --env LANGFUSE_HOST=https://cloud.langfuse.com \\\n  -- uvx langfuse-mcp\n```\n\nAdd `--python 3.14` before `langfuse-mcp` if you want to pin a CI-verified interpreter explicitly.\n\n**Step 3:** Restart CLI, verify with `/mcp` (Claude) or `codex mcp list` (Codex)\n\n**Step 4:** Test: `fetch_traces(age=60)`\n\n### Read-Only Mode\n\nFor safer observability without risk of modifying prompts or datasets, enable read-only mode:\n\n```bash\n# CLI flag\nlangfuse-mcp --read-only\n\n# Or environment variable\nLANGFUSE_MCP_READ_ONLY=true\n```\n\nThis disables write tools: `create_text_prompt`, `create_chat_prompt`, `update_prompt_labels`, `create_dataset`, `create_dataset_item`, `delete_dataset_item`.\n\n### Default Output Mode\n\nIf you want MCP clients to default to writing full payloads to files when they omit `output_mode`, configure:\n\n```bash\nlangfuse-mcp --default-output-mode full_json_file\n\n# Or via environment variable\nLANGFUSE_MCP_DEFAULT_OUTPUT_MODE=full_json_file\n```\n\nFor manual `.mcp.json` setup or troubleshooting, see `references/setup.md`.\n\n---\n\n## Playbooks\n\n### \"Where are the errors?\"\n\n```\nfind_exceptions(age=1440, group_by=\"file\")\n```\n→ Shows error counts by file. Pick the worst offender.\n\n```\nfind_exceptions_in_file(filepath=\"src/ai/chat.py\", age=1440)\n```\n→ Lists specific exceptions. Grab a trace_id.\n\n```\nget_exception_details(trace_id=\"...\")\n```\n→ Full stacktrace and context.\n\n---\n\n### \"What happened in this interaction?\"\n\n```\nfetch_traces(age=60, user_id=\"...\")\n```\n→ Find the trace. Note the trace_id.\n\nIf you don't know the user_id, start with:\n```\nfetch_traces(age=60)\n```\n\n```\nfetch_trace(trace_id=\"...\", include_observations=true)\n```\n→ See all LLM calls in the trace.\n\n```\nfetch_observation(observation_id=\"...\")\n```\n→ Inspect a specific generation's input/output.\n\n---\n\n### \"Why is it slow?\"\n\n```\nfetch_observations(age=60, type=\"GENERATION\")\n```\n→ Find recent LLM calls. Look for high latency.\n\n```\nfetch_observation(observation_id=\"...\")\n```\n→ Check token counts, model, timing.\n\n---\n\n### \"What's this user experiencing?\"\n\n```\nget_user_sessions(user_id=\"...\", age=1440)\n```\n→ List their sessions.\n\n```\nget_session_details(session_id=\"...\")\n```\n→ See all traces in the session.\n\n---\n\n### \"Manage datasets\"\n\n```\nlist_datasets()\n```\n→ See all datasets.\n\n```\nget_dataset(name=\"evaluation-set-v1\")\n```\n→ Get dataset details.\n\n```\nlist_dataset_items(dataset_name=\"evaluation-set-v1\", page=1, limit=10)\n```\n→ Browse items in the dataset.\n\n```\ncreate_dataset(name=\"qa-test-cases\", description=\"QA evaluation set\")\n```\n→ Create a new dataset.\n\n```\ncreate_dataset_item(\n  dataset_name=\"qa-test-cases\",\n  input={\"question\": \"What is 2+2?\"},\n  expected_output={\"answer\": \"4\"}\n)\n```\n→ Add test cases.\n\n```\ncreate_dataset_item(\n  dataset_name=\"qa-test-cases\",\n  item_id=\"item_123\",\n  input={\"question\": \"What is 3+3?\"},\n  expected_output={\"answer\": \"6\"}\n)\n```\n→ Upsert: updates existing item by id or creates if missing.\n\n---\n\n### \"Manage prompts\"\n\n```\nlist_prompts()\n```\n→ See all prompts with labels.\n\n```\nget_prompt(name=\"...\", label=\"production\")\n```\n→ Fetch current production version.\n\n```\ncreate_text_prompt(name=\"...\", prompt=\"...\", labels=[\"staging\"])\n```\n→ Create new version in staging.\n\n```\nupdate_prompt_labels(name=\"...\", version=N, labels=[\"production\"])\n```\n→ Promote to production. (Rollback = re-apply label to older version)\n\n---\n\n## Quick Reference\n\n| Task | Tool |\n|------|------|\n| List traces | `fetch_traces(age=N)` |\n| Get trace details | `fetch_trace(trace_id=\"...\", include_observations=true)` |\n| List LLM calls | `fetch_observations(age=N, type=\"GENERATION\")` |\n| Get observation | `fetch_observation(observation_id=\"...\")` |\n| Error count | `get_error_count(age=N)` |\n| Find exceptions | `find_exceptions(age=N, group_by=\"file\")` |\n| List sessions | `fetch_sessions(age=N)` |\n| User sessions | `get_user_sessions(user_id=\"...\", age=N)` |\n| List prompts | `list_prompts()` |\n| Get prompt | `get_prompt(name=\"...\", label=\"production\")` |\n| List datasets | `list_datasets()` |\n| Get dataset | `get_dataset(name=\"...\")` |\n| List dataset items | `list_dataset_items(dataset_name=\"...\", limit=N)` |\n| Create/update dataset item | `create_dataset_item(dataset_name=\"...\", item_id=\"...\")` |\n\n`age` = minutes to look back (max 10080 = 7 days)\n\n---\n\n## Troubleshooting\n\n### MCP connection fails\n- Verify credentials: check `LANGFUSE_PUBLIC_KEY`, `LANGFUSE_SECRET_KEY`, `LANGFUSE_HOST`\n- Restart CLI after adding/updating MCP config\n- Test MCP independently: `fetch_traces(age=60)` — if this fails, the issue is MCP, not the skill\n- See `references/setup.md` for detailed troubleshooting\n\n### No traces found\n- Increase the `age` parameter (default lookback may be too short)\n- Verify your application is sending traces to the correct Langfuse project\n- Check `LANGFUSE_HOST` points to the right instance (cloud vs self-hosted)\n\n### Permission denied\n- Regenerate API keys from Langfuse dashboard\n- Ensure keys have the required scopes for the operation\n- Write operations require read-write keys (not read-only mode)\n\n---\n\n## References\n\n- `references/tool-reference.md` — Full parameter docs, filter semantics, response schemas\n- `references/setup.md` — Manual setup, troubleshooting, advanced configuration","tags":["langfuse","mcp","avivsinai","agent-skills","ai-agents","claude-code","codex","developer-tools","genai","llm","mcp-server","observability"],"capabilities":["skill","source-avivsinai","skill-langfuse","topic-agent-skills","topic-ai-agents","topic-claude-code","topic-codex","topic-developer-tools","topic-genai","topic-langfuse","topic-llm","topic-mcp","topic-mcp-server","topic-observability","topic-tracing"],"categories":["langfuse-mcp"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/avivsinai/langfuse-mcp/langfuse","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add avivsinai/langfuse-mcp","source_repo":"https://github.com/avivsinai/langfuse-mcp","install_from":"skills.sh"}},"qualityScore":"0.494","qualityRationale":"deterministic score 0.49 from registry signals: · indexed on github topic:agent-skills · 88 github stars · SKILL.md body (6,866 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:56:39.437Z","embedding":null,"createdAt":"2026-04-18T22:12:32.006Z","updatedAt":"2026-05-18T18:56:39.437Z","lastSeenAt":"2026-05-18T18:56:39.437Z","tsv":"'+2':657 '+3':683 '/.codex/config.toml':268 '/mcp':315 '1':188,620 '10':622 '10080':859 '123':677 '1440':447,467,578 '2':212,656 '3':310,682 '3.10':219,225 '3.14':227,293 '4':323,661 '6':687 '60':328,492,515,547,889 '7':860 'add':239,271,291,662 'adding/updating':880 'advanc':984 'age':327,446,466,491,514,546,577,755,772,787,793,802,811,853,888,910 'agent':4,45,57 'agent-fac':56 'ai':3,30,44,99 'analysi':138 'answer':660,686 'api':194,945 'appli':742 'applic':7,48,920 'back':857 'bash':228,348,408 'broad':85,172 'brows':623 'call':78,526,553,769 'case':634,651,664,673 'caus':93 'chat':373 'check':562,868,929 'ci':222,305 'ci-verifi':304 'claud':66,127,229,237,316 'cli':262,312,349,878 'client':393 'cloud':937 'cloud.langfuse.com':192,255,286 'code':67,128,230 'codex':69,130,261,269,318,321 'companion':59 'concret':90 'config':882 'configur':407,985 'connect':122,864 'context':483 'correct':926 'count':453,564,783,786 'creat':208,369,372,378,380,628,639,643,665,695,716,723,846 'create/update':843 'credenti':190,867 'current':713 'dashboard':949 'data':40 'dataset':21,112,142,342,379,381,384,594,596,599,601,608,611,613,627,629,642,644,646,666,668,825,827,829,831,834,837,839,844,847,849 'day':861 'debug':2,29,43,98 'deeper':161 'default':386,395,413,425,912 'default-output-mod':412 'delet':383 'deni':943 'descript':635 'detail':477,584,609,759,903 'disabl':366 'discoveri':87 'doc':975 'drill':178 'enabl':343 'ensur':950 'env':242,247,252,273,278,283 'environ':358,421 'error':443,452,782,785 'evalu':23,113,604,616,637 'evaluation-set-v1':603,615 'exact':181 'except':15,32,101,133,445,461,470,476,790,792 'exist':690 'expect':658,684 'experienc':571 'explicit':308 'face':58 'fail':865,892 'failur':182 'fetch':325,489,512,516,530,544,558,712,753,760,770,778,800,886 'file':401,418,430,450,455,463,797 'filepath':464 'filter':976 'find':31,100,444,460,495,550,789,791 'first':79 'flag':350 'found':907 'full':155,398,416,428,480,973 'generat':17,537,549,775 'get':189,475,572,582,600,607,707,757,776,784,806,817,819,828,830 'grab':471 'group':448,795 'guess':167 'happen':485 'high':556 'highest':149 'highest-valu':148 'host':199,206,254,285,876,931,941 'hypothesi':94 'id':474,479,494,501,509,519,533,561,576,586,675,693,763,781,810,852 'identifi':173 'includ':520,764 'increas':908 'independ':885 'individu':169 'input':652,678 'input/output':539 'inspect':136,534 'instal':213 'instanc':202,936 'interact':488 'interpret':307 'investig':13 'issu':894 'item':382,385,612,624,645,667,674,676,691,835,838,845,848,851 'json':417,429 'key':195,209,245,250,276,281,871,874,946,951,965 'know':506 'label':377,706,710,721,730,734,743,822 'langfus':1,9,27,41,50,62,73,96,104,124,205,243,248,253,256,259,272,274,279,284,289,296,352,360,410,423,869,872,875,927,930,948 'langfuse-mcp':61,123,258,288,295,351,409 'latenc':137,557 'limit':621,841 'link':153 'list':320,468,579,595,610,700,751,767,798,813,815,824,826,833,836 'llm':6,47,525,552,768 'look':554,856 'lookback':913 'manag':593,698 'manual':432,981 'max':858 'may':914 'mcp':10,63,75,125,151,214,238,260,270,290,297,319,353,361,392,411,424,863,881,884,896 'mcp.json':236,433 'minut':854 'miss':697 'mode':332,347,388,406,415,427,970 'model':565 'modifi':339 'move':83 'n':733,756,773,788,794,803,812,842 'name':602,614,630,647,669,709,719,731,821,832,840,850 'new':641,724 'newer':221 'note':498 'observ':51,335,521,531,532,545,559,560,765,771,777,779,780 'offend':459 'older':745 'omit':404 'one':216 'oper':958,960 'output':387,405,414,426,659,685 'page':619 'paramet':911,974 'path':185 'payload':399 'permiss':942 'pick':215,456 'pin':302 'pk':246,277 'playbook':131,165,439 'point':932 'product':711,714,735,738,823 'project':232,241,928 'project-scop':231 'promot':736 'prompt':19,140,340,371,374,376,699,701,704,708,718,720,729,814,816,818,820 'provid':118 'public':244,275,870 'python':218,224,292 'qa':632,636,649,671 'qa-test-cas':631,648,670 'question':653,679 'quick':144,747 're':741 're-appli':740 'read':330,345,355,362,963,968 'read-on':329,344,354,967 'read-writ':962 'recent':551 'refer':145,159,748,971 'references/setup.md':438,901,980 'references/tool-reference.md':972 'regener':944 'relev':175 'requir':217,954,961 'respons':978 'restart':311,877 'right':935 'risk':337 'rollback':739 'root':92 'root-caus':91 'safer':334 'schema':979 'scope':233,240,265,955 'secret':249,280,873 'see':437,523,587,597,702,900 'self':198,940 'self-host':197,939 'semant':977 'send':922 'session':18,139,574,581,583,585,592,799,801,805,808 'set':24,102,114,193,605,617,638 'setup':119,156,186,434,982 'share':234 'short':917 'show':451 'sk':251,282 'skill':42,53,117,899 'skill-langfuse' 'slow':16,39,111,184,543 'source-avivsinai' 'specif':469,536 'src/ai/chat.py':465 'stacktrac':481 'stage':722,727 'start':171,510 'step':120,187,211,309,322 'store':266 'task':749 'tell':65 'test':324,633,650,663,672,883 'text':370,717 'time':566 'token':563 'tool':76,152,158,170,368,750 'topic-agent-skills' 'topic-ai-agents' 'topic-claude-code' 'topic-codex' 'topic-developer-tools' 'topic-genai' 'topic-langfuse' 'topic-llm' 'topic-mcp' 'topic-mcp-server' 'topic-observability' 'topic-tracing' 'trace':14,28,86,97,135,326,473,478,490,497,500,513,517,518,529,589,752,754,758,761,762,887,906,923 'trace/session/observation':176 'triag':134 'trigger':25,95 'troubleshoot':162,436,862,904,983 'true':364,522,766 'type':548,774 'updat':375,689,728 'upsert':688 'url':203 'use':11,72,163,200 'user':264,493,508,570,573,575,804,807,809 'user-scop':263 'uvx':257,287 'v1':606,618 'valu':150 'variabl':359,422 'verifi':223,306,313,866,918 'version':20,715,725,732,746 'via':8,235,420 'vs':938 'want':300,391 'went':34,106 'without':336 'worst':458 'write':367,397,959,964 'wrong':35,107","prices":[{"id":"9dc3951a-f8d2-4f6b-9aa4-5855c030e8b8","listingId":"16f8c8ed-cd94-4204-b375-044c3cd45f15","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"avivsinai","category":"langfuse-mcp","install_from":"skills.sh"},"createdAt":"2026-04-18T22:12:32.006Z"}],"sources":[{"listingId":"16f8c8ed-cd94-4204-b375-044c3cd45f15","source":"github","sourceId":"avivsinai/langfuse-mcp/langfuse","sourceUrl":"https://github.com/avivsinai/langfuse-mcp/tree/main/skills/langfuse","isPrimary":false,"firstSeenAt":"2026-04-18T22:12:32.006Z","lastSeenAt":"2026-05-18T18:56:39.437Z"},{"listingId":"16f8c8ed-cd94-4204-b375-044c3cd45f15","source":"skills_sh","sourceId":"avivsinai/langfuse-mcp/langfuse","sourceUrl":"https://skills.sh/avivsinai/langfuse-mcp/langfuse","isPrimary":true,"firstSeenAt":"2026-05-07T20:45:21.901Z","lastSeenAt":"2026-05-07T22:43:20.687Z"}],"details":{"listingId":"16f8c8ed-cd94-4204-b375-044c3cd45f15","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"avivsinai","slug":"langfuse","github":{"repo":"avivsinai/langfuse-mcp","stars":88,"topics":["agent-skills","ai-agents","claude-code","codex","developer-tools","genai","langfuse","llm","mcp","mcp-server","observability","tracing"],"license":"mit","html_url":"https://github.com/avivsinai/langfuse-mcp","pushed_at":"2026-05-18T17:38:33Z","description":"A Model Context Protocol (MCP) server for Langfuse, enabling AI agents to query Langfuse trace data for enhanced debugging and observability","skill_md_sha":"3bda3b7abfb61872a5d07fdcc4cf650d4bf300a7","skill_md_path":"skills/langfuse/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/avivsinai/langfuse-mcp/tree/main/skills/langfuse"},"layout":"multi","source":"github","category":"langfuse-mcp","frontmatter":{"name":"langfuse","description":"Debug AI agents and LLM applications via Langfuse MCP. Use when investigating traces, exceptions, slow generations, sessions, prompt versions, datasets, or evaluation sets. Triggers on \"langfuse\", \"traces\", \"debug AI\", \"find exceptions\", \"what went wrong\", \"why is it slow\", \"datasets\", \"evaluation sets\"."},"skills_sh_url":"https://skills.sh/avivsinai/langfuse-mcp/langfuse"},"updatedAt":"2026-05-18T18:56:39.437Z"}}