Langfuse MCP

io.github.avivsinaiPublished by GitHub account avivsinaiv0.14.0Updated Oct 25, 2026

Langfuse MCP server for accessing and analyzing telemetry data via natural language

Overview

AI-generated overview

Local MCP server for Langfuse that lets an assistant debug traces, sessions and exceptions, query metrics, and manage prompts, datasets and annotation queues.

What you can do
  • Fetch traces, observations and sessions, and drill into individual records
  • Find and group error-level exceptions by file, type or name, with error counts and details
  • Query aggregated metrics such as cost, latency, token usage and scores, plus the metrics schema
  • List, fetch and create prompt versions and update prompt labels
  • List, create, update and delete dataset items and dataset runs
  • Manage annotation queues, items and user assignments; read scores and data schema
When to use it
Useful when you want an assistant to debug LLM application telemetry in Langfuse from a local MCP client: triaging failing traces, finding exceptions in the last day, explaining slow sessions, or doing prompt and dataset work. The README positions it for local debugging rather than hosted breadth.
Requirements
Runs locally via uvx (uv and Python 3.10+), or as a Docker image. Needs Langfuse API credentials in LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY, and optionally LANGFUSE_HOST for self-hosted instances. Network access to the Langfuse instance is required; an optional HTTP transport mode and a profiles file are available.
Before you install
Requires Langfuse API keys, which grant access to project telemetry. Write tools create, update and delete prompts, dataset items, dataset runs and annotation queues; delete_dataset_item is permanent and deleting a dataset run with delete_traces=True also removes observations and scores. Read-only mode (LANGFUSE_MCP_READ_ONLY) disables writes. In HTTP mode, credentials travel in an Authorization header and binding to all interfaces without a TLS proxy can expose the default project.

Installation

In SourceWeft

  1. Open Langfuse MCP in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

Langfuse MCP Server

[PyPI] [GitHub stars] [PyPI downloads] [Downloads] [Python 3.10–3.14] [License: MIT]

Usage: 12,518 PyPI downloads last month (pypistats, 2026-08-19). v0.10.1.

Local MCP server and skill for Langfuse. Debug traces, sessions, and exceptions from Claude Code, Codex, Cursor, or any MCP client.

Why this instead of native Langfuse MCP?

Use this for local debug: first-class traces, sessions, and exceptions; route-decision tools; compact / file-dump output; plus the included langfuse skill.

Use official Langfuse MCP for hosted, zero-install access to the broader API (score writes, comments, models, media).

As of June 2026:

langfuse-mcpNative Langfuse MCP
Primary fitLocal debug: traces, sessions, exceptionsHosted, zero-install API surface
DeploymentLocal stdio or HTTP, via the Langfuse Python SDKNative streamable HTTP at /api/public/mcp
Trace / session / exception toolsFirst-classObservation/API-oriented access
Route-decision toolsYesNo
Token & output controlCompact summaries, truncation, file-dump mode, tool-group gatingHosted tool response + client
Metrics & dataset runsYesYes
Prompt, dataset, queue & score readsYesYes
Score writes, comments, models, mediaNoYes

langfuse-mcp for local debug. Native MCP for hosted breadth.

See a failing trace in 2 minutes

Install is uvx langfuse-mcp plus Langfuse API keys — Quick Start for Claude Code, Codex, Cursor, or Docker.

After the client restarts, ask:

text
find exceptions in the last day

That maps to existing tools:

text
find_exceptions(age=1440, group_by="file")find_exceptions_in_file(filepath="<file from the grouping>", age=1440)get_exception_details(trace_id="<trace_id from the file results>")

find_exceptions returns {group, count, observation_id, trace_id} (top 50 groups) — each group carries a representative observation/trace ID, and find_exceptions_in_file also yields full error records. Then optionally:

text
fetch_trace(trace_id="<trace_id>", include_observations=true)

The exception tools detect errors by observation level == "ERROR" (strict; a non-empty status_message alone does not count). Counts describe error-level observations, not individual exception events — get_error_count.exception_count is the same error-observation total reported by find_exceptions.metadata.observation_count (including groups beyond the top 50). Exception details come from recorded metadata (exception.type / exception.message / exception.stacktrace, top-level or under metadata.attributes); absent values are null. Results are not a point-in-time snapshot.

Project Links

Quick Start

Requires uv (for uvx) and Python 3.10 or newer. CI verifies Python 3.10 through 3.14.

Get credentials from Langfuse Cloud → Settings → API Keys. If self-hosted, use your instance URL for LANGFUSE_HOST.

bash
# Claude Code (project-scoped, shared via .mcp.json)claude mcp add \  -e LANGFUSE_PUBLIC_KEY=pk-... \  -e LANGFUSE_SECRET_KEY=sk-... \  -e LANGFUSE_HOST=https://cloud.langfuse.com \  --scope project \  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

To pin a CI-verified interpreter explicitly, add --python 3.14 before langfuse-mcp.

Restart your CLI, then verify with /mcp (Claude Code) or codex mcp list (Codex).

Agent Skill

This repo ships a first-party langfuse skill for Claude Code and Codex. The skill gives agents concrete playbooks for trace debugging, exception triage, latency analysis, prompt management, and dataset work.

Install it when you want the agent to know when to reach for Langfuse and which MCP tools to call first.

Via skills (recommended):

bash
npx skills add avivsinai/langfuse-mcp -g -y

Via skild:

bash
npx skild install @avivsinai/langfuse -t claude -y

Manual install:

bash
cp -r skills/langfuse ~/.claude/skills/   # Claude Codecp -r skills/langfuse ~/.codex/skills/    # Codex CLI

After installing the skill, try:

text
help me debug langfuse tracesfind exceptions in the last daywhy was this user's session slow?

The MCP server provides the tools; the skill provides the agent-facing workflow. See skills/langfuse/SKILL.md, skills/langfuse/references/setup.md, and skills/langfuse/references/tool-reference.md.

Tools (48 total)

CategoryTools
Tracesfetch_traces, fetch_trace
Observationsfetch_observations, fetch_observation
Routingfind_route_decisions, get_route_decision, summarize_route_decisions, find_low_confidence_route_decisions
Sessionsfetch_sessions, get_session_details, get_user_sessions
Exceptionsfind_exceptions, find_exceptions_in_file, get_exception_details, get_error_count
Promptslist_prompts, get_prompt, get_prompt_unresolved, create_text_prompt, create_chat_prompt, update_prompt_labels
Datasetslist_datasets, get_dataset, list_dataset_items, get_dataset_item, create_dataset, create_dataset_item, delete_dataset_item, list_dataset_runs, get_dataset_run, list_dataset_run_items, create_dataset_run_item, delete_dataset_run
Annotation Queueslist_annotation_queues, create_annotation_queue, get_annotation_queue, list_annotation_queue_items, get_annotation_queue_item, create_annotation_queue_item, update_annotation_queue_item, delete_annotation_queue_item, create_annotation_queue_assignment, delete_annotation_queue_assignment
Scoreslist_scores_v2, get_score_v2
Metricsquery_metrics, get_metrics_schema
Schemaget_data_schema

On Observations API v2, traces are built from root observations. fetch_traces omits traces without a root observation, and fetch_trace cannot find traces with no observations.

Dataset-run reads use the experiments API when the installed Langfuse SDK exposes it (Python SDK 4.13.1+). The older routes remain a fallback for self-hosted servers that do not serve experiments. delete_dataset_run uses the legacy delete route while it works; after that route is removed, it deletes the run's traces only when you pass delete_traces=True. Trace deletion also removes observations and related scores. create_dataset_run_item still uses the legacy link API; when that API is gone, create experiment data through the SDK experiment runner or OTel ingestion.

Dataset Item Updates (Upsert)

Langfuse uses upsert for dataset items. To edit an existing item, call create_dataset_item with item_id. If the ID exists, it updates; otherwise it creates a new item.

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

Metrics Queries

query_metrics aggregates telemetry server-side (cost, latency, tokens, counts, score values) so agents can answer "what did inference cost?" or "what's p95 latency by model?" without pulling raw traces. Call get_metrics_schema for the full view/dimension/measure catalog.

python
query_metrics(    view="observations",    metrics=[{"measure": "totalCost", "aggregation": "sum"}, {"measure": "latency", "aggregation": "p95"}],    dimensions=["providedModelName"],    age=1440,  # last 24h; or pass from_timestamp / to_timestamp)

High-cardinality fields (id, traceId, userId, sessionId) must be used in filters, not dimensions. The v2 metrics endpoint is Langfuse Cloud-only; self-hosted instances may return 404.

Selective Tool Loading

Load only the tool groups you need to reduce token overhead:

bash
langfuse-mcp --tools traces,prompts

Available groups: traces, observations, routing, sessions, exceptions, prompts, datasets, annotation_queues, scores, metrics, schema

The routing group is router-neutral. It reads Langfuse span observations with metadata.schema_version: "mcp.route_decision.v1" and filters on route-decision fields stored in observation metadata, such as decision_id, router_name, provider, and capability_id.

Read-Only Mode

Disable all write operations for safer read-only access:

bash
langfuse-mcp --read-only# Or via environment variableLANGFUSE_MCP_READ_ONLY=true langfuse-mcp

This disables: create_text_prompt, create_chat_prompt, update_prompt_labels, create_dataset, create_dataset_item, delete_dataset_item, create_dataset_run_item, delete_dataset_run, create_annotation_queue, create_annotation_queue_item, update_annotation_queue_item, delete_annotation_queue_item, create_annotation_queue_assignment, delete_annotation_queue_assignment

Default Output Mode

Set the MCP-exposed default output_mode so clients that omit the parameter automatically use your preferred mode:

bash
langfuse-mcp --default-output-mode full_json_file# Or via environment variableLANGFUSE_MCP_DEFAULT_OUTPUT_MODE=full_json_file langfuse-mcp

Supported values: compact, full_json_string, full_json_file

This updates the default shown in MCP tool schemas. Clients can still override it per call by passing output_mode explicitly.

Other Clients

Cursor

Create .cursor/mcp.json in your project (or ~/.cursor/mcp.json for global):

json
{  "mcpServers": {    "langfuse": {      "command": "uvx",      "args": ["langfuse-mcp"],      "env": {        "LANGFUSE_PUBLIC_KEY": "pk-...",        "LANGFUSE_SECRET_KEY": "sk-...",        "LANGFUSE_HOST": "https://cloud.langfuse.com",        "LANGFUSE_MCP_DEFAULT_OUTPUT_MODE": "full_json_file"      }    }  }}

Docker (single project)

bash
docker run --rm -i \  -e LANGFUSE_PUBLIC_KEY=pk-... \  -e LANGFUSE_SECRET_KEY=sk-... \  -e LANGFUSE_HOST=https://cloud.langfuse.com \  ghcr.io/avivsinai/langfuse-mcp:latest

Multiple projects with profiles (stdio)

For local clients (Claude Code, Codex, Cursor), keep the credentials of each Langfuse project in a profiles file and register one MCP server per project. Each server starts with --profile <name>.

The file is TOML at $XDG_CONFIG_HOME/langfuse-mcp/profiles.toml (or ~/.config/langfuse-mcp/profiles.toml when XDG_CONFIG_HOME is not set). Use --profiles-file PATH or LANGFUSE_MCP_PROFILES_FILE to read a different file.

toml
[profiles.prod]host = "https://cloud.langfuse.com"public_key = "pk-lf-..."secret_key_env = "LANGFUSE_PROD_SECRET_KEY"   # read the secret from this env var
[profiles.staging]host = "https://langfuse.staging.example.com"public_key = "pk-lf-..."secret_key = "sk-lf-..."                       # or give the value directly

Each of public_key, secret_key and host takes a literal value, or a <field>_env key that names the environment variable that holds the value. host defaults to https://cloud.langfuse.com.

bash
claude mcp add langfuse-prod -- uvx langfuse-mcp --profile prodclaude mcp add langfuse-staging -- uvx langfuse-mcp --profile staging
json
{  "mcpServers": {    "langfuse-prod": {      "command": "uvx",      "args": ["langfuse-mcp", "--profile", "prod"]    },    "langfuse-staging": {      "command": "uvx",      "args": ["langfuse-mcp", "--profile", "staging"]    }  }}

Precedence is CLI flags (--public-key, --secret-key, --host) > environment variables (LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_HOST) > the selected profile > defaults. When an environment variable overrides a profile value, the server logs a warning. An unknown profile name or a missing profiles file stops the server with an error that names the file and the available profiles. LANGFUSE_MCP_PROFILE selects a profile when --profile is not given.

HTTP transport — shared server for multiple projects

Run one persistent server instance and route each MCP client to its own Langfuse project by passing credentials in the Authorization header.

bash
# Start a shared server (binds to localhost by default)docker run -d -p 127.0.0.1:8000:8000 \  -e LANGFUSE_HOST=https://cloud.langfuse.com \  ghcr.io/avivsinai/langfuse-mcp:latest \  --transport streamable-http --bind-host 0.0.0.0

Security note: --bind-host 0.0.0.0 exposes the port on all interfaces. In production, place the server behind a TLS-terminating reverse proxy (nginx, Caddy, Cloudflare Tunnel) that enforces HTTPS. The Authorization header containing your keys is transmitted in plaintext over plain HTTP. If startup credentials are set, the proxy must enforce authentication; otherwise unauthenticated callers without an Authorization header can use the default project. For shared public HTTP deployments, omit default LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY credentials unless the fronting proxy authenticates every request.

Register each project separately in your MCP client, passing its credentials as a Basic auth header (base64(public_key:secret_key)):

bash
# Generate the header value for each project:echo -n "pk-lf-YOURKEY:sk-lf-YOURSECRET" | base64# cGstbGYtWU9VUktFWTpzay1sZi1ZT1VSU0VDUkVU
# Register in Claude Code (one entry per project):claude mcp add langfuse-audit \  --transport http http://localhost:8000/mcp \  -H "Authorization: Basic cGstbGYtWU9VUktFWTpzay1sZi1ZT1VSU0VDUkVU"
claude mcp add langfuse-staging \  --transport http http://localhost:8000/mcp \  -H "Authorization: Basic <base64 for staging project>"

Auth semantics: Basic here carries Langfuse API keys, not user passwords. An absent header falls back to startup env credentials (LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY). Any malformed header is rejected outright — there is no silent fallback to a different project.

Optional environment variables

VariableDefaultDescription
LANGFUSE_MAX_AGE_DAYS7Caps the lookback window for time-based tools (fetch_traces, fetch_observations, etc.). Set to match your Langfuse instance's data retention — e.g. 30 if your retention is 30 days.
LANGFUSE_MCP_PROFILEunsetProfile to load from the profiles file; same as --profile. See Multiple projects with profiles.
LANGFUSE_MCP_PROFILES_FILE$XDG_CONFIG_HOME/langfuse-mcp/profiles.tomlPath of the profiles file; same as --profiles-file.
LANGFUSE_MCP_TRACE_TIMEOUT_SECONDS120Per-request read timeout (seconds) for single-trace fetches (fetch_trace). Raise it if large traces with include_observations=True time out. Must be a positive integer.

Development

bash
uv venv --python 3.14 .venv && source .venv/bin/activateuv pip install -e ".[dev]"pytest

License

MIT

Source: README.md at commit 82608a2

Tools

48

list_annotation_queues

List annotation queues with pagination.

Parameterspagelimit

create_annotation_queue

Create an annotation queue.

Parametersnamerequireddescriptionscore_config_ids

get_annotation_queue

Get a single annotation queue by ID.

Parametersqueue_idrequired

list_annotation_queue_items

List items in an annotation queue.

Parameterspagelimitqueue_idrequired

get_annotation_queue_item

Get a specific annotation queue item by queue and item ID.

Parametersitem_idrequiredqueue_idrequired

create_annotation_queue_item

Create an annotation queue item.

Parametersstatusqueue_idrequiredobject_idrequiredobject_typerequired

update_annotation_queue_item

Update the status of an annotation queue item.

Parametersstatusrequireditem_idrequiredqueue_idrequired

delete_annotation_queue_item

Delete an annotation queue item.

Parametersitem_idrequiredqueue_idrequired

create_annotation_queue_assignment

Assign a user to an annotation queue.

Parametersuser_idrequiredqueue_idrequired

delete_annotation_queue_assignment

Unassign a user from an annotation queue.

Parametersuser_idrequiredqueue_idrequired

list_datasets

List all datasets in the project with pagination. Returns metadata about datasets including name, description, item count, and timestamps. Args: ctx: Context object containing lifespan context with Langfuse client page: Page number for pagination (starts at 1) limit: Maximum items per page (max 100) Returns: A dictionary containing: - data: List of dataset metadata objects - metadata: Pagination info (page, limit, total)

Parameterspagelimit

get_dataset

Get a specific dataset by name. Retrieves dataset details including metadata and item count. Args: ctx: Context object containing lifespan context with Langfuse client name: The name of the dataset to fetch Returns: A dictionary containing dataset details: - id: Unique dataset identifier - name: Dataset name - description: Dataset description - metadata: Custom metadata - items: List of dataset items (if included by the API) - runs: List of dataset runs (if included by the API)

Parametersnamerequired

list_dataset_items

List items in a dataset with pagination and optional filtering. Returns dataset items with their input, expected output, and metadata. Args: ctx: Context object containing lifespan context with Langfuse client dataset_name: The name of the dataset to list items from source_trace_id: Optional filter by source trace ID source_observation_id: Optional filter by source observation ID page: Page number for pagination (starts at 1) limit: Maximum items per page (max 100) output_mode: How to format the response data Returns: A dictionary containing: - data: List of dataset item objects - metadata: Pagination info (page, limit, total, dataset_name)

Parameterspagelimitoutput_modedataset_namerequiredsource_trace_idsource_observation_id

get_dataset_item

Get a specific dataset item by ID. Retrieves the full dataset item including input, expected output, metadata, and linked traces. Args: ctx: Context object containing lifespan context with Langfuse client item_id: The ID of the dataset item to fetch output_mode: How to format the response data Returns: A dictionary containing the dataset item details: - id: Unique item identifier - datasetId: Parent dataset ID - input: Input data for the item - expectedOutput: Expected output data - metadata: Custom metadata - sourceTraceId: Linked trace ID (if any) - sourceObservationId: Linked observation ID (if any) - status: Item status (ACTIVE or ARCHIVED)

Parametersitem_idrequiredoutput_mode

create_dataset

Create a new dataset in the project. Datasets are used to store evaluation test cases with input/expected output pairs. Args: ctx: Context object containing lifespan context with Langfuse client name: Name for the new dataset (must be unique) description: Optional description metadata: Optional custom metadata Returns: A dictionary containing the created dataset details: - id: Unique dataset identifier - name: Dataset name - description: Dataset description - metadata: Custom metadata - createdAt: Creation timestamp

Parametersnamerequiredmetadatadescription

create_dataset_item

Create a new item in a dataset, or update if item_id already exists. Dataset items store input/expected output pairs for evaluation. If item_id is provided and already exists, the item will be updated (upsert behavior). Args: ctx: Context object containing lifespan context with Langfuse client dataset_name: Name of the target dataset input: Input data for the item expected_output: Expected output for evaluation metadata: Optional custom metadata source_trace_id: Optional linked trace ID source_observation_id: Optional linked observation ID item_id: Optional custom ID (enables upsert) status: Item status (ACTIVE or ARCHIVED) Returns: A dictionary containing the created/updated item details

Parametersinputstatusitem_idmetadatadataset_namerequiredexpected_outputsource_trace_idsource_observation_id

delete_dataset_item

Delete a dataset item by ID. This is a permanent deletion and cannot be undone. Args: ctx: Context object containing lifespan context with Langfuse client item_id: The ID of the dataset item to delete Returns: A dictionary confirming the deletion

Parametersitem_idrequired

list_dataset_runs

List runs for a dataset by dataset name.

Parameterspagelimitdataset_namerequired

get_dataset_run

Get a dataset run, including any run items returned by the SDK.

Parametersrun_namerequiredoutput_modedataset_namerequired

list_dataset_run_items

List dataset run items by dataset ID and run name.

Parameterspagelimitrun_namerequireddataset_idrequiredoutput_mode

create_dataset_run_item

Create a dataset run item and flush the ingestion write. If this legacy API is gone, use the SDK experiment runner or OTel ingestion; neither can link an existing trace through this API.

Parametersmetadatarun_namerequiredtrace_idobservation_iddataset_item_idrequiredrun_description

delete_dataset_run

Delete a run through the legacy route, or explicitly delete its traces after removal. Trace deletion also removes observations and related scores. Set delete_traces=True to allow this broader replacement.

Parametersrun_namerequireddataset_namerequireddelete_traces

find_exceptions

Get error-level observations grouped by file path, function, type, name, or observation type. Args: ctx: Context object containing lifespan context with Langfuse client age: Number of minutes to look back; capped by the configured maximum group_by: How to group errors - "file" groups by recorded code.filepath, "function" by code.function, "type" by recorded exception.type, "name" by observation name, or "observation_type" by observation type Returns: List of error-observation counts grouped by the specified category. A group entry carries a representative observation_id and trace_id. Counts describe error-level observations, NOT individual exception events (which the standard observation listing does not expose).

Parametersagerequiredgroup_by

find_exceptions_in_file

Get detailed error info for a specific file (recorded code.filepath match). Args: ctx: Context object containing lifespan context with Langfuse client filepath: Path to the file as recorded in Langfuse metadata (code.filepath) age: Number of minutes to look back; capped by the configured maximum output_mode: Controls the output format and detail level Returns: Based on output_mode: - compact: List of summarized error records (top 10 newest after the full scan) - full_json_string: String containing the full JSON response - full_json_file: List of summarized error records with file save info

Parametersagerequiredfilepathrequiredoutput_mode

get_exception_details

Get detailed error info for a trace/observation. Args: ctx: Context object containing lifespan context with Langfuse client trace_id: The ID of the trace to analyze for errors (unique identifier string) span_id: Optional observation ID to filter by (applies across all observation types) output_mode: Controls the output format and detail level Returns: Based on output_mode: - compact: List of summarized error records - full_json_string: String containing the full JSON response - full_json_file: List of summarized error records with file save info

Parametersspan_idtrace_idrequiredoutput_mode

get_error_count

Get number of traces with error-level observations in last N minutes. Args: ctx: Context object containing lifespan context with Langfuse client age: Number of minutes to look back; capped by the configured maximum Returns: Dictionary with error statistics: trace_count (distinct traces), observation_count (error-level observations), and exception_count (the same error-observation total as find_exceptions, not a count of individual exception events; see metadata.note).

Parametersagerequired

query_metrics

Query aggregated metrics (cost, latency, token usage, counts, score values) from Langfuse. Wraps the Langfuse v2 metrics endpoint. Use this for analytics questions — "what did inference cost in the last 24h grouped by model", "p95 latency per prompt", "score distribution by name" — instead of pulling raw observations and aggregating client-side. Per-parameter contracts live in the Field descriptions above. Notes: - The v2 metrics endpoint is Langfuse Cloud-only; self-hosted instances may return 404. - Recently-ingested data can lag (OTEL ingestion delay up to ~10 minutes). - High-cardinality fields (id, traceId, userId, sessionId) must be filters, not dimensions.

Parametersageviewrequiredfiltersmetricsrequiredorder_bydimensionsoutput_modeto_timestampfrom_timestamptime_granularity

get_metrics_schema

Get the query schema for the metrics API (views, dimensions, measures, aggregations). Companion to query_metrics: describes which views exist, the dimensions and measures available on each, the supported aggregations/operators, and the query-object shape. ``dummy`` is unused and exists only for MCP API compatibility.

Parametersdummy

fetch_observations

Get observations filtered by type and other criteria. Args: ctx: Context object containing lifespan context with Langfuse client type: The observation type to filter by (SPAN, GENERATION, EVENT, AGENT, TOOL, CHAIN, RETRIEVER, EVALUATOR, EMBEDDING or GUARDRAIL) age: Minutes ago to start looking (e.g., 1440 for 24 hours) name: Optional name filter (string pattern to match) user_id: Optional user ID filter (exact match) trace_id: Optional trace ID filter (exact match) parent_observation_id: Optional parent observation ID filter (exact match) page: Page number for pagination (starts at 1) limit: Maximum number of observations to return per page output_mode: Controls the output format and detail level Returns: Based on output_mode: - compact: List of summarized observation objects - full_json_string: String containing the full JSON response - full_json_file: List of summarized observation objects with file save info

Parametersagerequirednamepagetypelimituser_idtrace_idoutput_modeparent_observation_id

fetch_observation

Get a single observation by ID. Args: ctx: Context object containing lifespan context with Langfuse client observation_id: The ID of the observation to fetch (unique identifier string) output_mode: Controls the output format and detail level Returns: Based on output_mode: - compact: Summarized observation object - full_json_string: String containing the full JSON response - full_json_file: Summarized observation object with file save info

Parametersoutput_modeobservation_idrequired

get_prompt

Fetch a specific prompt by name with resolved dependencies. Retrieves a prompt from Langfuse with all dependency tags resolved. Uses the SDK's built-in caching for optimal performance. Args: ctx: Context object containing lifespan context with Langfuse client name: The name of the prompt to fetch label: Optional label to fetch (e.g., 'production'). Cannot be used with version. version: Optional specific version number. Cannot be used with label. Returns: A dictionary containing the prompt details: - id: Unique prompt identifier - name: Prompt name - version: Version number - type: 'text' or 'chat' - prompt: The prompt content (string for text, list for chat) - labels: List of labels assigned to this version - tags: List of tags - config: Model configuration (temperature, model, etc.) Raises: ValueError: If both label and version are specified LookupError: If prompt not found

Parametersnamerequiredlabelversion

get_prompt_unresolved

Fetch a specific prompt by name WITHOUT resolving dependencies. Returns raw prompt content with dependency tags intact (e.g., @@@langfusePrompt:name=xxx@@@) when the SDK supports resolve=false. Otherwise returns the resolved prompt and marks metadata.resolved=True. Useful for analyzing prompt composition and debugging dependency chains. Args: ctx: Context object containing lifespan context with Langfuse client name: The name of the prompt to fetch label: Optional label to fetch. Cannot be used with version. version: Optional specific version number. Cannot be used with label. Returns: A dictionary containing the raw prompt details with dependency tags preserved. Raises: ValueError: If both label and version are specified LookupError: If prompt not found

Parametersnamerequiredlabelversion

list_prompts

List and filter prompts in the project. Returns metadata about prompts including versions, labels, tags, and last updated time. Args: ctx: Context object containing lifespan context with Langfuse client name: Optional filter by exact prompt name label: Optional filter by label on any version tag: Optional filter by tag page: Page number for pagination (starts at 1) limit: Maximum items per page (max 100) Returns: A dictionary containing: - data: List of prompt metadata objects - metadata: Pagination info (page, limit, total)

Parameterstagnamepagelabellimit

create_text_prompt

Create a new text prompt version in Langfuse. Prompts are immutable; creating a new version is the only way to update prompt content. Labels are unique across versions - assigning a label here will move it from other versions.

Parametersnamerequiredtagsconfiglabelspromptrequiredcommit_message

create_chat_prompt

Create a new chat prompt version in Langfuse. Chat prompts are arrays of role/content messages. Prompts are immutable; create a new version to update content. Labels are unique across versions.

Parametersnamerequiredtagsconfiglabelspromptrequiredcommit_message

update_prompt_labels

Update labels for a specific prompt version. This is the only supported mutation for existing prompts. Provided labels are added to the version (existing labels are preserved). Labels are unique across versions, and the 'latest' label is managed by Langfuse.

Parametersnamerequiredlabelsrequiredversionrequired

find_route_decisions

Find generic agent route decisions emitted as Langfuse SPAN observations. This tool is router-neutral. It only treats observations with metadata.schema_version == "mcp.route_decision.v1" as route decisions, and it filters on fields inside observation metadata rather than display output.

Parametersagepagelimitprovidertrace_idsession_iddecision_idoutput_moderouter_namecapability_id

get_route_decision

Fetch one route decision by metadata decision_id.

Parametersagedecision_idrequiredoutput_mode

summarize_route_decisions

Summarize generic route decisions for a trace, session, router, provider, or capability.

Parametersagepagelimitprovidertrace_idsession_idrouter_namecapability_idmax_confidence

find_low_confidence_route_decisions

Find route decisions that are low-confidence or explicitly uncallable.

Parametersagepagelimitprovidertrace_idsession_idoutput_moderouter_namecapability_idmax_confidenceinclude_uncallable

get_data_schema

Get schema of trace, span and event objects. Args: ctx: Context object containing lifespan context with Langfuse client dummy: Unused parameter for API compatibility (can be left empty) Returns: String containing the detailed schema definitions for traces, spans, events, and other core Langfuse data structures

Parametersdummy

list_scores_v2

List scores via Scores API v3 with optional filters (GET /v2/scores where v3 is not served). With operator ``=`` and a value, v3 defaults an omitted data_type to NUMERIC; pass BOOLEAN for boolean scores. Strict ``>``/``<`` can return fewer than limit rows on a page after boundary rows are dropped; next_page shows whether more rows exist.

Parametersnamepagelimitvaluesourceuser_idoperatorqueue_idtrace_idconfig_iddata_typescore_ids+5 more

get_score_v2

Get a score by ID from Scores API v3 (the v2 route where v3 is not served).

Parametersscore_idrequired

fetch_sessions

Get a list of sessions in the current project. Args: ctx: Context object containing lifespan context with Langfuse client age: Minutes ago to start looking (e.g., 1440 for 24 hours) page: Page number for pagination (starts at 1) limit: Maximum number of sessions to return per page output_mode: Controls the output format and detail level Returns: Based on output_mode: - compact: List of summarized session objects - full_json_string: String containing the full JSON response - full_json_file: List of summarized session objects with file save info

Parametersagerequiredpagelimitoutput_mode

get_session_details

Get detailed information about a specific session. Args: ctx: Context object containing lifespan context with Langfuse client session_id: The ID of the session to retrieve (unique identifier string) include_observations: If True, fetch and include the full observation objects instead of just IDs. Use this when you need access to system prompts, model parameters, or other details stored within observations. Significantly increases response time but provides complete data. output_mode: Controls the output format and detail level Returns: Based on output_mode: - compact: Summarized session details object - full_json_string: String containing the full JSON response - full_json_file: Summarized session details object with file save info Usage Tips: - For quick browsing: use include_observations=False with output_mode="compact" - For full data but viewable in responses: use include_observations=True with output_mode="compact" - For complete data dumps: use include_observations=True with output_mode="full_json_file"

Parameterssession_idrequiredoutput_modeinclude_observations

get_user_sessions

Get sessions for a user within a time range. Args: ctx: Context object containing lifespan context with Langfuse client user_id: The ID of the user to retrieve sessions for (unique identifier string) age: Minutes ago to start looking (e.g., 1440 for 24 hours) include_observations: If True, fetch and include the full observation objects instead of just IDs. Use this when you need access to system prompts, model parameters, or other details stored within observations. Significantly increases response time but provides complete data. output_mode: Controls the output format and detail level Returns: Based on output_mode: - compact: List of summarized session objects - full_json_string: String containing the full JSON response - full_json_file: List of summarized session objects with file save info Usage Tips: - For quick browsing: use include_observations=False with output_mode="compact" - For full data but viewable in responses: use include_observations=True with output_mode="compact" - For complete data dumps: use include_observations=True with output_mode="full_json_file"

Parametersagerequireduser_idrequiredoutput_modeinclude_observations

fetch_traces

Find traces based on filters. All filter parameters are optional. On Observations API v2, each trace is built from its root observation; traces without a root observation do not appear.

Parametersagerequirednamepagetagslimituser_idmetadatasession_idoutput_modeinclude_observations

fetch_trace

Get a single trace by ID with full details. On Observations API v2, a trace is built from its root observation; a trace with no observations is not found. Args: ctx: Context object containing lifespan context with Langfuse client trace_id: The ID of the trace to fetch (unique identifier string) include_observations: If True, fetch and include the full observation objects. If False, the observations field group is dropped entirely to avoid expensive per-observation IO. Use True when you need access to system prompts, model parameters, or other details stored within observations. Significantly increases response time but provides complete data. output_mode: Controls the output format and detail level Returns: One of the following based on output_mode: - For 'compact' and 'full_json_file': A response dictionary with the structure: { "data": Single trace object, "metadata": { "file_path": Path to saved file (only for full_json_file mode), "file_info": File save details (only for full_json_file mode) } } - For 'full_json_string': A string containing the full JSON response Usage Tips: - For quick browsing: use include_observations=False with output_mode="compact" - For full data but viewable in responses: use include_observations=True with output_mode="compact" - For complete data dumps: use include_observations=True with output_mode="full_json_file"

Parameterstrace_idrequiredoutput_modeinclude_observations

Version history

3
  1. v0.14.0LatestOct 25, 2026
  2. v0.13.0Oct 11, 2026
  3. v0.12.1Sep 25, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts
  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts