Langfuse MCP by usefulapi
v1.2.1Read traces, metrics, scores, prompts and datasets; add scores to traces in Langfuse.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
langfuse_get_project Get the connected project
Get the Langfuse project this key pair belongs to (id and name). Good first call to confirm the connection. Langfuse API: GET /api/public/projects.
langfuse_list_observations List observations (and traces)
List observations, the spans, generations and events of your LLM traces, newest first. Set is_root_observation to true to list traces (one root observation per trace). Use fields to choose response groups (default core,basic; add io, usage, model, metadata when needed). Langfuse API: GET /api/public/v2/observations.
| Parameter | Type | Description |
|---|---|---|
cursor | string | Cursor from meta.cursor of the previous page. |
environment | string | Only this environment, for example production. |
fields | string | Comma-separated field groups: core, basic, time, io, metadata, model, usage, prompt, metrics, trace_context. |
filter | string | Advanced filter: a JSON array of conditions, for example [{"type":"string","column":"name","operator":"contains","value":"rag"}]. |
from_start_time | string | Only observations that start at or after this time. |
is_root_observation | boolean | true = only root observations (one per trace). |
level | string | Only this log level. |
limit | integer | Items per page (default 50, max 100). |
name | string | Only observations with this name. |
parse_io_as_json | boolean | true = parse input and output strings as JSON. |
session_id | string | Only observations of this session id. |
to_start_time | string | Only observations that start before this time. |
trace_id | string | Only observations of this trace id. |
type | string | Observation type, for example GENERATION, SPAN, EVENT, AGENT, TOOL, CHAIN, RETRIEVER, EVALUATOR, EMBEDDING, GUARDRAIL. |
user_id | string | Only observations of this user id. |
langfuse_get_metrics Run a metrics query
Run an aggregate query for counts, token usage, cost, latency or scores over observations or scores. "query" is a JSON object with view (observations, scores-numeric, scores-boolean or scores-categorical), optional dimensions, metrics (each with measure and aggregation) and filters. Langfuse API: GET /api/public/v2/metrics.
| Parameter | Type | Description |
|---|---|---|
query * | string | JSON object, for example {"view":"observations","metrics":[{"measure":"count","aggregation":"count"}]}. |
langfuse_list_scores List scores
List scores (quality ratings from humans, the API or evaluators) on traces, observations or sessions. Filter by name, source, data type or the object scored. Langfuse API: GET /api/public/v3/scores.
| Parameter | Type | Description |
|---|---|---|
config_id | string | Only scores made with this score config id. |
cursor | string | Cursor from meta.cursor of the previous page. |
data_type | string | Only scores of this data type. |
from_timestamp | string | ISO 8601 time, for example 2026-11-01T00:00:00Z. |
limit | integer | Items per page (default 50, max 100). |
name | string | Only scores with this name. |
observation_id | string | Only scores on this observation id. |
session_id | string | Only scores on this session id. |
source | string | Only scores from this source. |
to_timestamp | string | ISO 8601 time, for example 2026-11-01T00:00:00Z. |
trace_id | string | Only scores on this trace id. |
langfuse_list_score_configs List score configs
List score configs: the named scores your project defines (data type, value range, categories). Langfuse API: GET /api/public/score-configs.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Items per page (default 50, max 100). |
page | integer | Page number (default 1). |
langfuse_list_prompts List prompts
List prompt names in the project, with their labels, tags and versions. Filter by name, label or tag. Langfuse API: GET /api/public/v2/prompts.
| Parameter | Type | Description |
|---|---|---|
from_updated_at | string | ISO 8601 time, for example 2026-11-01T00:00:00Z. |
label | string | Only prompts that carry this label, for example production. |
limit | integer | Items per page (default 50, max 100). |
name | string | Only prompts with this name. |
page | integer | Page number (default 1). |
tag | string | Only prompts with this tag. |
to_updated_at | string | ISO 8601 time, for example 2026-11-01T00:00:00Z. |
langfuse_get_prompt Get a prompt
Get one prompt version: its text or chat messages, config, labels and tags. Pick a version number or a label (default: the latest). Langfuse API: GET /api/public/v2/prompts/{promptName}.
| Parameter | Type | Description |
|---|---|---|
prompt_name * | string | The prompt name (from langfuse_list_prompts). |
label | string | Label to resolve, for example production. |
resolve | boolean | true = resolve linked prompt references in the text. |
version | integer | Version number. |
langfuse_list_datasets List datasets
List evaluation datasets in the project. Langfuse API: GET /api/public/v2/datasets.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Items per page (default 50, max 100). |
page | integer | Page number (default 1). |
langfuse_get_dataset Get a dataset
Get one dataset by name: its description, metadata and item count. Langfuse API: GET /api/public/v2/datasets/{datasetName}.
| Parameter | Type | Description |
|---|---|---|
dataset_name * | string | The dataset name (from langfuse_list_datasets). |
langfuse_list_dataset_items List dataset items
List the items (inputs and expected outputs) of datasets, filterable by dataset name or by the trace or observation they came from. Langfuse API: GET /api/public/dataset-items.
| Parameter | Type | Description |
|---|---|---|
dataset_name | string | Only items of this dataset. |
limit | integer | Items per page (default 50, max 100). |
page | integer | Page number (default 1). |
source_observation_id | string | Only items created from this observation id. |
source_trace_id | string | Only items created from this trace id. |
version | string | Only items as they were at this time (ISO 8601). |
langfuse_list_models List model definitions
List the model definitions used for cost and token tracking (name, match pattern, prices per unit). Langfuse API: GET /api/public/models.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Items per page (default 50, max 100). |
page | integer | Page number (default 1). |
langfuse_list_comments List comments
List comments that people left on traces, observations, sessions or prompts. Filter by object type, object id or author. Langfuse API: GET /api/public/comments.
| Parameter | Type | Description |
|---|---|---|
author_user_id | string | Only comments by this author user id. |
limit | integer | Items per page (default 50, max 100). |
object_id | string | Only comments on this object id. |
object_type | string | For example TRACE, OBSERVATION, SESSION or PROMPT. |
page | integer | Page number (default 1). |
langfuse_list_annotation_queues List annotation queues
List annotation queues: review queues where people score traces or observations by hand. Langfuse API: GET /api/public/annotation-queues.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Items per page (default 50, max 100). |
page | integer | Page number (default 1). |
langfuse_create_score Create a score
Add one score to a trace, observation or session, for example a quality rating from your own check. The value is a number for NUMERIC and BOOLEAN (0 or 1) scores, and text for CATEGORICAL and TEXT scores. Give trace_id, observation_id or session_id. This creates a new record each call. Langfuse API: POST /api/public/scores.
| Parameter | Type | Description |
|---|---|---|
name * | string | Score name, for example quality or hallucination. |
value * | number | string | Number for NUMERIC or BOOLEAN (0/1); text for CATEGORICAL or TEXT. |
comment | string | Free-text comment on the score. |
config_id | string | Score config id (from langfuse_list_score_configs). |
data_type | string | Data type; inferred from config_id when given. |
observation_id | string | Observation id to score. |
session_id | string | Session id to score. |
trace_id | string | Trace id to score. |