developer-toolsapi_key

Langfuse

Open source LLM engineering platform. Traces, evals, prompt management and metrics to debug and improve your LLM application.

Verdict

Langfuse tracks and evaluates LLM application behavior — traces, prompts, datasets, and human annotation queues. @mention it to pull evaluation scores into your Project, compare experiment runs side-by-side, or retrieve versioned prompts your team is testing in production. Engineers debugging model regressions get the most value: you can query dataset run results, inspect annotation queues awaiting review, and score traces without leaving the conversation. Auth requires a Langfuse API key with read/write access; the MCP cannot create new traces or observations, only read existing telemetry and attach scores.

Common use cases

  • Compare experiment scores across dataset runs
  • Retrieve production prompt versions for A/B tests
  • Review annotation queues awaiting human labels
  • Attach evaluation scores to specific traces
  • Audit dataset items before model retraining

Integration

Vendor
Langfuse
Category
developer-tools
Auth
API_KEY
Tools
13
Composio slug
langfuse

Tools

  • Create Score

    Attach an evaluation score to exactly one Langfuse trace, session, or dataset run, optionally narrowing a trace score to an observation.

  • Get Annotation Queue

    Retrieve one Langfuse annotation queue by its ID.

  • Get Prompt

    Retrieve a Langfuse text or chat prompt by name, deployment label, or exact version, with optional dependency resolution.

  • List Annotation Queues

    List annotation queues configured for human evaluation in the connected Langfuse project.

  • List Dataset Items

    List dataset items, optionally scoped to a dataset, source trace or observation, or historical dataset version.

  • List Dataset Run Items

    List run items for a specific Langfuse dataset and run name.

  • List Datasets

    List datasets available to the connected Langfuse project.

  • List Experiments

    List Langfuse experiments active in a required time range, optionally including metadata and directly attached scores.

  • List Models

    List Langfuse-managed and project-custom model pricing definitions used for usage and cost calculation.

  • List Observations

    Search Langfuse observations such as generations, spans, events, agents, and tool calls, selecting only the field groups needed.

  • List Scores

    Search numeric, boolean, categorical, text, and correction scores with subject and annotation context.

  • Query Metrics

    Run an aggregate Langfuse metrics query over observations or numeric, boolean, or categorical scores.

  • Upsert LLM Connection

    Create or update a Langfuse LLM provider connection by provider name.

Setup

Setup guide

  1. 11. Open your Switchy workspace settings and navigate to the Integrations tab. 2. Click 'Add MCP' and select Langfuse from the developer tools category. 3. In a separate tab, log into your Langfuse project and go to Settings → API Keys. 4. Generate a new API key with read access to traces, datasets, and prompts, plus write access if you plan to attach scores. 5. Copy the secret key and the public key, then paste both into the Switchy connection form along with your Langfuse host URL (typically cloud.langfuse.com or your self-hosted domain). 6. Click 'Connect' — Switchy validates the credentials and lists available projects. 7. Inside any Project, type '@Langfuse list datasets' to confirm the connection works and see your evaluation datasets.

What teammates see: by default, memories from Langfuse are scoped to the Project (PROJECT visibility) - you can mark any memory PRIVATE or share it ORG-wide.

Works well with

Top models

Compatibility data appears once enough Projects have used this MCP together with a given model.

How Switchy teams use it

Not enough Projects yet to publish anonymised usage stats (we require ≥ 50 Projects per week).

Starter prompts

Compare Experiment Results

@Langfuse list experiments from the past 7 days, include scores and metadata, then compare the mean accuracy score for experiment A versus experiment B.

Fetch Prompt Version

@Langfuse get the prompt named 'customer_support_greeting' using the production label, then show me the full template text.

Review Annotation Queue

@Langfuse get annotation queue 'model_v2_edge_cases' and list the first 10 items, including their trace IDs and current status.

Score a Trace

@Langfuse create a score for trace ID abc123, name it 'helpfulness', set the value to 0.85, and add the comment 'response was clear and actionable'.

Audit Dataset Items

@Langfuse list dataset items for the dataset named 'customer_queries_v3', show me the input text and expected output for each.

Example outputs

Illustrative - representative of the model's voice and quality, not literal recordings.

Prompt

@Langfuse list all datasets in our project and show me the item count for each one

Output

Found 4 datasets in your Langfuse project: 'customer-support-qa' (127 items), 'product-classification' (89 items), 'sentiment-analysis-v2' (203 items), and 'summarization-benchmark' (45 items). Each dataset includes ground-truth examples you've curated for evaluation. The sentiment-analysis-v2 dataset was last modified 3 days ago and appears to be your most actively maintained collection.

Notes

This read-only query demonstrates how Langfuse organizes evaluation datasets. Useful for auditing what test sets exist before running experiments. Requires API key with read access to datasets; no side effects.

Prompt

@Langfuse create a score for trace abc123 with name 'accuracy' value 0.87 and comment 'correct entity extraction'

Output

Score created successfully. Attached 'accuracy' score (0.87) to trace abc123 with your comment. This score is now visible in the Langfuse UI under that trace's evaluation tab and will be included in aggregate metrics for any experiment or dataset run referencing this trace. The timestamp reflects when this score was recorded, not when the original trace executed.

Notes

This write operation permanently adds evaluation metadata to a trace. Useful for programmatic scoring after manual review or automated eval runs. Cannot be undone through the MCP—you'd delete via Langfuse UI. Ensure trace ID exists before scoring.

Prompt

@Langfuse get the latest production prompt named 'system-instruction' and compare it to version 3 to see what changed

Output

Retrieved two versions of 'system-instruction': production deployment (v5, updated 2 days ago) and your requested v3 (from 11 days ago). The production version added a new constraint about citation formatting and removed the temperature suggestion that was in v3. Both are chat-style prompts with identical variable placeholders ({{user_query}}, {{context}}). The v5 system message is 47 tokens longer, primarily due to the expanded citation rules.

Notes

Demonstrates prompt versioning and dependency resolution. Langfuse tracks every prompt edit, so you can diff changes or roll back. The MCP returns full prompt text—useful for auditing what's live in production versus what your code expects.

Use-case deep-dives

LLM eval pipeline for 3-person AI team

When Langfuse beats spreadsheets for prompt iteration

A three-person AI team ships a customer-facing chatbot and needs to track which prompt versions actually reduce hallucination rates. Langfuse wins here because the Create Score and Get Prompt tools let you version prompts, run evals against dataset items, and attach scores to specific traces—all without leaving your CI pipeline. The annotation queue tools mean your PM can flag bad outputs for review without opening a Jupyter notebook. The threshold: if you're only running evals once a week in a notebook, a spreadsheet is simpler. But if you're iterating on prompts daily and need to compare scores across versions, Langfuse keeps the feedback loop tight. Set up API key auth, point your eval script at List Dataset Run Items, and you're tracking regressions by lunch.

Support team triaging AI agent failures

How annotation queues turn support tickets into training data

A five-person support team fields complaints about an AI agent giving wrong answers. They need to triage which failures are prompt bugs versus missing knowledge. Langfuse's Get Annotation Queue and List Annotation Queues tools let support staff flag traces for engineering review without touching code. Each flagged trace becomes a dataset item that feeds back into your eval pipeline. The trade-off: if your agent only handles 20 conversations a day, manual review in Slack is faster. But once you cross 100 daily sessions, the annotation queue keeps support and engineering aligned on what "bad" looks like. Your support lead reviews queues in the morning, engineering pulls flagged traces into datasets by afternoon, and you're running experiments on fixes by end of week.

Product team A/B testing LLM features

When experiments beat gut-feel for feature launches

A four-person product team wants to ship a new summarization feature but can't tell if GPT-4 or Claude performs better for their use case. Langfuse's List Experiments and List Dataset Run Items tools let you run side-by-side comparisons on real user data, then attach scores to each model's output. The experiments view shows which variant wins on latency, cost, and quality without writing custom analytics. The boundary: if you're only testing one feature once a quarter, a manual CSV export works fine. But if you're shipping LLM features every sprint and need to justify model choices to stakeholders, Langfuse turns gut-feel into data. Run your A/B test, pull experiment results, and you've got a slide deck ready for the retro.

Frequently asked

What does the Langfuse MCP do in Switchy?

It lets AI agents read and write evaluation data in your Langfuse project. Agents can create scores on traces, pull prompts by name or version, list datasets and annotation queues, and query experiment results. Use it when you want an agent to analyse LLM performance metrics or fetch production prompts without leaving the conversation.

Do I need a Langfuse API key to connect this MCP?

Yes. The MCP uses API key authentication, so you'll need to generate a key from your Langfuse project settings. Anyone on your Switchy team with that key can connect the integration. Langfuse keys are scoped to a single project, so the agent only sees data from that project.

Can the Langfuse MCP create new traces or log LLM calls?

No. It reads existing traces and writes scores, but it doesn't create traces or observations. If you want to log new LLM calls from Switchy, instrument your application with the Langfuse SDK directly. The MCP is for evaluation and retrieval, not ingestion.

Why use this instead of querying Langfuse's API directly?

The MCP wraps Langfuse's REST API in natural language. An agent can say "show me the worst-scoring traces from yesterday" and the MCP translates that into the right API calls. You skip writing code or remembering endpoint syntax. For one-off queries during debugging, it's faster than opening the Langfuse dashboard.

Who on the team should connect the Langfuse MCP?

Whoever owns your Langfuse project and can generate API keys. Typically that's an ML engineer or the person running evals. Once connected, anyone in your Switchy workspace can ask the agent to pull Langfuse data, so limit the connection to projects you're comfortable sharing with the team.

More developer tools MCPs

See all developer tools MCPs →

Data last verified 61 hours ago.Sources aggregated hourly to weekly. See docs/architecture/model-directory.md.