langfuse-mcp-extended
This server provides comprehensive access to Langfuse observability data, enabling AI assistants to manage and query traces, observations, scores, datasets, and sessions. It includes 24 tools for listing, retrieving, creating, updating, and deleting these entities, with filtering, sorting, and pagination. Key features include the ability to control large input/output payloads via the includeIO parameter, support for both Langfuse Cloud (US/EU) and self-hosted instances, and compatibility with the Langfuse prompts MCP server. You can analyze multi-turn sessions, manage evaluation datasets with run linking, create score configurations, and track costs and usage metrics across generations and spans.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@langfuse-mcp-extended list the last 10 traces from today"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Langfuse MCP Server (Extended)
A comprehensive Model Context Protocol (MCP) server for Langfuse, providing AI assistants with full access to traces, observations, scores, datasets, and sessions.
Prompt Management: This server focuses on observability data. For prompt management, Langfuse provides a built-in MCP server (GitHub). We're working on integrating both - see Contributing.
Features
24 tools for complete Langfuse observability access
Traces: List, get, and delete traces with filtering and pagination
Observations: Query generations, spans, and events with usage metrics
Scores: Full CRUD operations for evaluation scores (numeric, categorical, boolean)
Score Configs: Manage score configuration templates
Datasets: Complete dataset management including items and evaluation runs
Sessions: Access session data with associated traces
Cloud & Self-hosted: Works with Langfuse Cloud (US/EU) and self-hosted instances
Related MCP server: langfuse-mcp
Quick Start
One-liner Installation (Claude Code)
claude mcp add langfuse -e LANGFUSE_PUBLIC_KEY=pk-lf-xxx -e LANGFUSE_SECRET_KEY=sk-lf-xxx -- npx -y langfuse-mcp-extendedFor EU Cloud or self-hosted, add the base URL:
claude mcp add langfuse -e LANGFUSE_PUBLIC_KEY=pk-lf-xxx -e LANGFUSE_SECRET_KEY=sk-lf-xxx -e LANGFUSE_BASE_URL=https://eu.cloud.langfuse.com -- npx -y langfuse-mcp-extendedInstallation by Client
Add to your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"langfuse": {
"command": "npx",
"args": ["-y", "langfuse-mcp-extended"],
"env": {
"LANGFUSE_PUBLIC_KEY": "pk-lf-...",
"LANGFUSE_SECRET_KEY": "sk-lf-..."
}
}
}
}For EU Cloud or self-hosted, add LANGFUSE_BASE_URL:
{
"mcpServers": {
"langfuse": {
"command": "npx",
"args": ["-y", "langfuse-mcp-extended"],
"env": {
"LANGFUSE_PUBLIC_KEY": "pk-lf-...",
"LANGFUSE_SECRET_KEY": "sk-lf-...",
"LANGFUSE_BASE_URL": "https://eu.cloud.langfuse.com"
}
}
}
}Option 1: One-liner with environment variables
claude mcp add langfuse -e LANGFUSE_PUBLIC_KEY=pk-lf-xxx -e LANGFUSE_SECRET_KEY=sk-lf-xxx -- npx -y langfuse-mcp-extendedOption 2: Add to project's .mcp.json
{
"mcpServers": {
"langfuse": {
"command": "npx",
"args": ["-y", "langfuse-mcp-extended"],
"env": {
"LANGFUSE_PUBLIC_KEY": "pk-lf-...",
"LANGFUSE_SECRET_KEY": "sk-lf-..."
}
}
}
}Option 3: Use shell environment variables
claude mcp add langfuse -- npx -y langfuse-mcp-extendedThen set in your shell profile (.bashrc, .zshrc, etc.):
export LANGFUSE_PUBLIC_KEY="pk-lf-..."
export LANGFUSE_SECRET_KEY="sk-lf-..."Add to your Cursor MCP configuration:
Project-specific:
.cursor/mcp.jsonin your project directoryGlobal:
~/.cursor/mcp.jsonin your home directory
{
"mcpServers": {
"langfuse": {
"command": "npx",
"args": ["-y", "langfuse-mcp-extended"],
"env": {
"LANGFUSE_PUBLIC_KEY": "pk-lf-...",
"LANGFUSE_SECRET_KEY": "sk-lf-..."
}
}
}
}Or add via UI: File → Preferences → Cursor Settings → MCP
Add to .vscode/mcp.json in your workspace:
{
"mcpServers": {
"langfuse": {
"command": "npx",
"args": ["-y", "langfuse-mcp-extended"],
"env": {
"LANGFUSE_PUBLIC_KEY": "pk-lf-...",
"LANGFUSE_SECRET_KEY": "sk-lf-..."
}
}
}
}npm install -g langfuse-mcp-extendedThen use langfuse-mcp-extended as the command instead of npx -y langfuse-mcp-extended.
Configuration
Required Environment Variables
Variable | Description |
| Your Langfuse public key ( |
| Your Langfuse secret key ( |
Optional Environment Variables
Variable | Default | Description |
|
| Langfuse instance URL |
|
| Logging level: |
Langfuse Instance URLs
Instance | URL |
US Cloud |
|
EU Cloud |
|
Self-hosted | Your instance URL (e.g., |
API Reference
Pagination
All list operations use page-based pagination with a default limit of 10 items per page:
page(number, optional): Page number, 1-indexed. Default: 1limit(number, optional): Items per page, max 100. Default: 10
Response Size Control
Get operations (getTrace, getSession, getObservation) support an includeIO parameter:
includeIO(boolean, optional): Include input/output fields. Default:false
When includeIO is false (default), large input and output fields are stripped from responses to prevent exceeding LLM context limits. Set to true when you need the full payload.
listTraces
List traces with filtering and pagination.
Inputs:
page(number, optional): Page numberlimit(number, optional): Items per pagename(string, optional): Filter by trace nameuserId(string, optional): Filter by user IDsessionId(string, optional): Filter by session IDtags(string[], optional): Filter by tags (AND logic)fromTimestamp(string, optional): Start of time range (ISO 8601)toTimestamp(string, optional): End of time range (ISO 8601)environment(string, optional): Filter by environmentorderBy(string, optional): Sort bytimestamp,latency, ortotalCost
getTrace
Get a specific trace with full details.
Inputs:
traceId(string, required): The trace IDincludeIO(boolean, optional): Include input/output fields. Default:false
Returns: Trace with observations and scores.
deleteTrace
Delete a trace.
Inputs:
traceId(string, required): The trace ID to delete
listObservations
List observations (generations, spans, events) with cursor-based pagination.
Inputs:
cursor(string, optional): Pagination cursorlimit(number, optional): Items per pagetraceId(string, optional): Filter by trace IDname(string, optional): Filter by observation nametype(string, optional): Filter by type:GENERATION,SPAN,EVENTparentObservationId(string, optional): Filter by parentfromStartTime(string, optional): Start of time range (ISO 8601)toStartTime(string, optional): End of time range (ISO 8601)userId(string, optional): Filter by user IDversion(string, optional): Filter by version
getObservation
Get a specific observation with all details.
Inputs:
observationId(string, required): The observation IDincludeIO(boolean, optional): Include input/output fields. Default:false
Returns: Observation with usage, costs, and timing.
createScore
Create a score for a trace or observation.
Inputs:
traceId(string, required): ID of the trace to scorename(string, required): Score name (e.g.,accuracy,relevance)value(number | string, required): Score valueobservationId(string, optional): ID of specific observation to scoredataType(string, optional):NUMERIC,CATEGORICAL, orBOOLEANcomment(string, optional): Explanation of the scoreconfigId(string, optional): Score config ID for validationid(string, optional): Custom ID for idempotency
listScores
List scores with filtering.
Inputs:
page,limit(pagination)traceId(string, optional): Filter by trace IDobservationId(string, optional): Filter by observation IDname(string, optional): Filter by score namesource(string, optional): Filter by source:API,ANNOTATION,EVALdataType(string, optional): Filter by data typeconfigId(string, optional): Filter by config IDfromTimestamp,toTimestamp(string, optional): Time rangeuserId(string, optional): Filter by user IDoperator(string, optional): Comparison operator:<,>,<=,>=,!=,=value(number, optional): Value to compare (requires operator)
getScore
Get a specific score.
Inputs:
scoreId(string, required): The score ID
deleteScore
Delete a score.
Inputs:
scoreId(string, required): The score ID to delete
createScoreConfig
Create a score configuration template.
Inputs:
name(string, required): Unique config namedataType(string, required):NUMERIC,CATEGORICAL, orBOOLEANminValue(number, optional): Minimum value (NUMERIC only)maxValue(number, optional): Maximum value (NUMERIC only)categories(array, optional): Category definitions (CATEGORICAL only)description(string, optional): Description
listScoreConfigs
List all score configurations.
Inputs:
page,limit(pagination)
getScoreConfig
Get a specific score configuration.
Inputs:
configId(string, required): The config ID
createDataset
Create a new dataset.
Inputs:
name(string, required): Dataset namedescription(string, optional): Descriptionmetadata(object, optional): Additional metadata
listDatasets
List all datasets.
Inputs:
page,limit(pagination)
getDataset
Get a dataset by name.
Inputs:
datasetName(string, required): The dataset name
createDatasetItem
Create or update a dataset item.
Inputs:
datasetName(string, required): Target dataset nameinput(any, required): Item input dataexpectedOutput(any, optional): Expected outputmetadata(object, optional): Item metadatasourceTraceId(string, optional): Source trace IDsourceObservationId(string, optional): Source observation IDid(string, optional): Custom ID for upsert
listDatasetItems
List items in a dataset.
Inputs:
datasetName(string, required): Dataset namepage,limit(pagination)sourceTraceId(string, optional): Filter by source tracesourceObservationId(string, optional): Filter by source observation
getDatasetItem
Get a specific dataset item.
Inputs:
datasetItemId(string, required): The item ID
deleteDatasetItem
Delete a dataset item.
Inputs:
datasetItemId(string, required): The item ID to delete
createDatasetRunItem
Link a trace/observation to a dataset item for evaluation.
Inputs:
runName(string, required): Name of the dataset rundatasetItemId(string, required): Dataset item IDtraceId(string, required): Trace IDrunDescription(string, optional): Run descriptionobservationId(string, optional): Observation IDmetadata(object, optional): Run item metadata
listDatasetRuns
List runs for a dataset.
Inputs:
datasetName(string, required): Dataset namepage,limit(pagination)
getDatasetRun
Get a specific dataset run.
Inputs:
datasetName(string, required): Dataset namerunName(string, required): Run name
listSessions
List all sessions.
Inputs:
page,limit(pagination)fromTimestamp(string, optional): Start of time range (ISO 8601)toTimestamp(string, optional): End of time range (ISO 8601)
getSession
Get a specific session with its traces.
Inputs:
sessionId(string, required): The session IDincludeIO(boolean, optional): Include input/output in traces. Default:false
Returns: Session with associated traces.
Using with Official Langfuse MCP (Prompts)
This server provides observability tools (traces, scores, datasets). For prompt management, Langfuse provides a built-in MCP server that requires no installation.
Built-in Langfuse MCP (Recommended)
The Langfuse MCP server is built directly into Langfuse at /api/public/mcp. See the official documentation for setup instructions.
Using Both Servers Together
To use Langfuse observability (this server) alongside the official prompts MCP:
{
"mcpServers": {
"langfuse-observability": {
"command": "npx",
"args": ["-y", "langfuse-mcp-extended"],
"env": {
"LANGFUSE_PUBLIC_KEY": "pk-lf-...",
"LANGFUSE_SECRET_KEY": "sk-lf-..."
}
}
}
}Then configure the built-in Langfuse prompts MCP following the official guide.
Note: We're actively working with the Langfuse team to potentially integrate both servers. See Contributing for details.
Development
# Install dependencies
npm install
# Build
npm run build
# Run in development mode
npm run dev
# Run tests
npm test # Unit tests (59 tests)
npm run test:integration # Integration tests (18 tests)
npm run test:all # All tests
# Quality checks
npm run lint
npm run typecheckContributing
Contributions are welcome! This project aims to be integrated into the official Langfuse ecosystem.
Active discussions:
langfuse/langfuse#5646 - Integration discussion
langfuse/mcp-server-langfuse#14 - Feature request
How to contribute:
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
Author
Built by Javier Aguilar - AI Agent Architect specializing in multi-agent orchestration and MCP development.
License
MIT License - see LICENSE for details.
Related
Langfuse - Open source LLM observability
Langfuse MCP Server (Prompts) - Built-in prompt management MCP
Model Context Protocol - MCP specification
MCP Servers Registry - Official MCP servers
Available Tools
24 toolscreateDatasetB
Create a new dataset for evaluation. Datasets contain items with expected inputs/outputs for testing LLM applications.
Inputs: name (required), description, metadata.
createDatasetItemB
Create or upsert a dataset item. Use id parameter for idempotent updates.
Inputs: datasetName (required), input, expectedOutput, metadata, +4 more.
createDatasetRunItemA
Create a dataset run item linking a trace/observation to a dataset item for evaluation.
Inputs: runName (required), datasetItemId (required), traceId (required), runDescription, +2 more.
createScoreA
Create a score for a trace or observation. Supports numeric, boolean, and categorical score types.
Inputs: traceId (required), name (required), value (required), observationId, +4 more.
createScoreConfigC
Create a score configuration that defines validation rules for scores. Supports numeric ranges, categorical values, and boolean types.
Inputs: name (required), dataType (required), minValue, maxValue, +2 more.
deleteDatasetItemA
Delete a specific dataset item. This action is irreversible.
Inputs: datasetItemId (required).
deleteScoreB
Delete a specific score. This action is irreversible.
Inputs: scoreId (required).
deleteTraceA
Delete a specific trace. This action is irreversible.
Inputs: traceId (required).
getDatasetA
Get a dataset by name including its items and run names.
Inputs: datasetName (required).
getDatasetItemA
Get a specific dataset item by ID.
Inputs: datasetItemId (required).
getDatasetRunA
Get a specific dataset run by name including its run items.
Inputs: datasetName (required), runName (required).
getObservationA
Get a specific observation with all details including input/output, usage, costs, and timing.
Inputs: observationId (required), includeIO.
getScoreB
Get a specific score by ID.
Inputs: scoreId (required).
getScoreConfigA
Get a specific score configuration by ID.
Inputs: configId (required).
getSessionA
Get a specific session by ID including its traces.
Inputs: sessionId (required), includeIO.
getTraceA
Get a specific trace with full details including all observations and scores.
Inputs: traceId (required), includeIO.
listDatasetItemsC
List items in a dataset with optional filtering.
Inputs: datasetName (required), page, limit, sourceTraceId, +1 more.
listDatasetRunsB
List all runs for a specific dataset.
Inputs: datasetName (required), page, limit.
listDatasetsC
List all datasets in the project.
Inputs: page, limit.
listObservationsA
List observations (generations, spans, events) with cursor-based pagination. Includes usage metrics, costs, and latency.
Inputs: cursor, limit, traceId, name, +6 more.
listScoreConfigsB
List all score configurations in the project.
Inputs: page, limit.
listScoresB
List scores with filtering. Supports both trace and observation scores.
Inputs: page, limit, traceId, observationId, +9 more.
listSessionsC
List all sessions. Sessions group multiple traces from the same user interaction.
Inputs: page, limit, fromTimestamp, toTimestamp.
listTracesA
List traces with filtering and pagination. Returns trace metadata including latency, cost, and observation/score counts.
Inputs: page, limit, name, userId, +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
Each tool targets a distinct resource-action pair (e.g., createDataset vs. createScore, listTraces vs. listScores). There is no ambiguity as resource types are clearly separated and operations are specific.
All tools follow a strict verb+noun pattern (e.g., createDataset, getDatasetItem, listObservations) using snake_case consistently. No mixing of styles or vague verbs.
24 tools cover the major resources (datasets, scores, traces, observations, sessions) with predictable CRUD operations. The count is well-scoped for a comprehensive observability server without being excessive.
The tool set lacks create endpoints for traces and observations, which are fundamental to the platform. While dataset items support upsert, the absence of trace and observation creation is a notable gap for a complete evaluation workflow.
Maintenance
Related MCP Connectors
MCP server for Sentry - error monitoring, issue tracking, and debugging for AI assistants
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
Related MCP Servers
- AlicenseCqualityDmaintenanceAn MCP server implementation that integrates AI assistants with Langfuse workspaces, allowing models to query LLM metrics by time range.110 npm3Apache 2.0
- AlicenseCqualityAmaintenanceMCP server for Langfuse observability. Query traces, debug exceptions, analyze sessions, and manage prompts and datasets for your LLM applications.483,201 PyPI112MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server for comprehensive monitoring and observability of systems using Langfuse.1MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for Langfuse providing 50 tools for prompt management, observability, instance/organization management, and metrics tracking via natural language.16 npmMIT