langfuse-mcp
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 list my recent traces"
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
MCP server for Langfuse — lets Claude Code create projects, manage API keys, and query traces without touching the web UI.
Designed to work with langfuse-kickstart, a self-hosted Langfuse v3 stack running locally via Docker Compose.
Tools
Tool | Description |
| List all projects accessible with the current API key |
| List all organizations |
| Create a new project inside an organization |
| Create a new pk/sk pair for a project |
| List API keys for a project |
| Delete an API key by ID |
| List traces with optional filters |
| Get full trace details including observations |
| List sessions |
| List scores with optional filters |
| Create a score on a trace or observation |
| List spans, generations, and events |
| List datasets |
| Get a dataset and its items |
| List prompts in the prompt library |
| Get a prompt by name, version, or label |
Related MCP server: paperclip-mcp
Requirements
Python 3.11+
A running Langfuse instance (see langfuse-kickstart)
Setup
git clone https://github.com/dominic-righthere/langfuse-mcp
cd langfuse-mcp
cp .env.example .envEdit .env:
LANGFUSE_HOST=http://langfuse.localhost
LANGFUSE_PUBLIC_KEY=pk-lf-kickstart
LANGFUSE_SECRET_KEY=sk-lf-kickstart
LANGFUSE_DATABASE_URL=postgresql://langfuse:YOUR_POSTGRES_PASSWORD@localhost:5432/langfuseLANGFUSE_DATABASE_URL is needed for admin tools (create_project, create_api_key, etc.) that write directly to Postgres. With langfuse-kickstart, Postgres is exposed on 127.0.0.1:5432 — use the POSTGRES_PASSWORD from your kickstart .env.
Claude Code integration
Add to your .mcp.json (project-level) or claude_desktop_config.json:
{
"mcpServers": {
"langfuse": {
"command": "uv",
"args": ["run", "--project", "/path/to/langfuse-mcp", "langfuse-mcp"],
"env": {
"LANGFUSE_HOST": "http://langfuse.localhost",
"LANGFUSE_PUBLIC_KEY": "pk-lf-kickstart",
"LANGFUSE_SECRET_KEY": "sk-lf-kickstart",
"LANGFUSE_DATABASE_URL": "postgresql://langfuse:YOUR_POSTGRES_PASSWORD@localhost:5432/langfuse"
}
}
}
}Replace /path/to/langfuse-mcp with the actual path to the cloned repo.
Alternatively, if you use a .env file in the repo root, you can omit the env block and let the server load it automatically.
Notes
create_api_keyreturns the secret key only at creation time — store it immediately.Admin tools (
create_project,create_api_key,delete_api_key,list_organizations) connect directly to Postgres. If Langfuse changes its schema in a major version these tools may need updating.The REST API tools (
list_traces,get_trace, etc.) use the public Langfuse API and are schema-stable.
License
MIT
Available Tools
20 toolscreate_api_keyA
Create a new API key pair (pk/sk) for a project.
Returns the secret key — store it immediately, it is not shown again.
Args: project_id: The project ID to create the key for. note: Optional label for the key.
Inputs: project_id (required), note.
create_projectA
Create a new project inside an organization.
Args: name: Display name for the project. org_id: The organization ID to create the project in (get from list_organizations).
Inputs: name (required), org_id (required).
create_scoreA
Create a score on a trace or observation.
Args: trace_id: The trace to score. name: Score name (e.g. "quality", "faithfulness"). value: Numeric value (or 0/1 for BOOLEAN, category index for CATEGORICAL). observation_id: Optionally attach score to a specific observation. comment: Optional comment. data_type: NUMERIC | BOOLEAN | CATEGORICAL.
Inputs: name (required), value (required), trace_id (required), comment, +2 more.
delete_api_keyA
Delete an API key by its ID.
Args: key_id: The API key ID to delete (get from list_api_keys).
Inputs: key_id (required).
get_datasetC
Get a dataset and its items.
Args: dataset_name: The dataset name.
Inputs: dataset_name (required).
get_or_create_projectA
Find a project by name or create it if it doesn't exist.
Args: name: Project name to find or create. org_id: Organization ID to create in if not found (get from list_organizations).
Inputs: name (required), org_id (required).
get_promptA
Get a prompt by name, optionally pinned to a version or label.
Args: prompt_name: The prompt name. version: Specific version number. label: Label (e.g. "production", "latest").
Inputs: prompt_name (required), label, version.
get_traceC
Get full details of a trace including observations.
Args: trace_id: The trace ID.
Inputs: trace_id (required).
list_api_keysB
List API keys for a project.
Args: project_id: The project ID.
Inputs: project_id (required). Returns: result
list_datasetsC
List datasets.
Args: limit: Number of results. page: Page number.
Inputs: page, limit.
list_observationsA
List observations (spans, generations, events).
Args: trace_id: Filter by trace ID. limit: Number of results (max 100). page: Page number (1-based). obs_type: Filter by type: SPAN | GENERATION | EVENT.
Inputs: page, limit, obs_type, trace_id.
list_organizationsC
List all organizations.
Inputs: no named parameters. Returns: result
list_project_mappingsA
List all local repo → Langfuse project mappings.
Inputs: no named parameters.
list_projectsA
List all Langfuse projects accessible with the current API key.
Inputs: no named parameters. Returns: result
list_promptsB
List prompts in the prompt library.
Args: limit: Number of results. page: Page number. name: Filter by name.
Inputs: name, page, limit.
list_scoresB
List scores with optional filters.
Args: limit: Number of results (max 100). page: Page number (1-based). trace_id: Filter by trace ID. user_id: Filter by user ID. name: Filter by score name.
Inputs: name, page, limit, user_id, +1 more.
list_sessionsB
List sessions.
Args: limit: Number of results (max 100). page: Page number (1-based).
Inputs: page, limit.
list_tracesA
List traces with optional filters.
Args: limit: Number of results (max 100). page: Page number (1-based). user_id: Filter by user ID. session_id: Filter by session ID. name: Filter by trace name. tags: Filter by tags.
Inputs: name, page, tags, limit, +2 more.
lookup_projectA
Look up which Langfuse project a local repo/path is mapped to. Walks up the directory tree to find the nearest match.
Args: path: Absolute path to look up (usually the current working directory).
Inputs: path (required).
map_projectA
Record that a local repo/path uses a specific Langfuse project.
Args: path: Absolute path to the local project/repo. project_id: Langfuse project ID to associate with this path. project_name: Optional human-readable project name for reference.
Inputs: path (required), project_id (required), project_name.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Each tool targets a distinct resource and action (e.g., create_api_key vs. delete_api_key, list_traces vs. list_sessions). No overlap in purpose; descriptions are clear.
All tool names follow a consistent verb_noun pattern (create_*, delete_*, get_*, list_*, lookup_*, map_*) using snake_case with no mixing of conventions.
20 tools is slightly above the typical 3-15 range but well-justified by the diverse resources (projects, keys, prompts, traces, etc.). No tool is redundant.
Several resource types lack CRUD coverage: no create/update for prompts, traces, observations, datasets, sessions; only list/get operations. API keys missing update. Major gaps for agent workflows.
Related MCP Connectors
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Related MCP Servers
- AlicenseCqualityAmaintenanceMCP server for Langfuse observability. Query traces, debug exceptions, analyze sessions, and manage prompts and datasets for your LLM applications.483,543 PyPI112MIT
- AlicenseAqualityDmaintenanceMCP server that exposes the Paperclip control plane API as tools for Claude Code agents — manage issues, coordinate agents, post comments, and orchestrate work without direct API calls.10025 npm2MIT
- AlicenseAqualityCmaintenanceComprehensive MCP server for Langfuse, enabling AI assistants to access and manage traces, observations, scores, datasets, and sessions for observability.2418 npm2MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Dify Console API that enables managing apps, workflows, knowledge bases, models, plugins, and MCP servers programmatically from Claude Code or any MCP client.8MIT