Langfuse MCP Server
Published · Updated
At a glance
- Category
- Observability
- GitHub repository
- langfuse/langfuse
- Watch out for
- Write tools are on by default; allowlist read-only tools in your client if you need that.
Langfuse now ships an MCP server inside Langfuse itself, so there is nothing separate to install. Every Langfuse Cloud region and every self-hosted instance exposes it at /api/public/mcp, and its code lives in the main langfuse/langfuse repository under web/src/features/mcp. It replaces the earlier standalone langfuse/mcp-server-langfuse project, which only handled prompts and has not been updated since February 2025.
The built-in server uses streamable HTTP and is stateless: each request is authenticated on its own with a project-scoped API key pair, so an assistant connected with one key only sees that project. Organisation-level keys are not supported. The tool set is much wider than the old server's. Besides listing, fetching and creating prompts, the source includes tools for reading observations from your traces, managing datasets and dataset items, reading and adding comments, and creating scores. Langfuse publishes the current list and schemas at mcp.reference.langfuse.com.
Two points from Langfuse's own documentation are worth knowing before you connect it. Read and write tools are both enabled by default, so restrict tools in your client if you want read-only access; tools carry read-only and destructive hints that clients can use for approval prompts. And the repository README warns that tools and schemas may change over time, so clients should read the tool list dynamically rather than hard-code it.
How it connects
Your AI app
An assistant or agent that supports MCP
Langfuse MCP Server
Runs as
- Remote (HTTP)
Gives the agent
- Prompts
- Observations
- Datasets
- Comments and scores
- Project-scoped, stateless access
- Tool hints
Langfuse
Signs in with
- API key
What it can do
- Prompts
- listPrompts, getPrompt, createTextPrompt, createChatPrompt and updatePromptLabels work with prompt versions and their labels.
- Observations
- listObservations, getObservation and getObservationFilterValues read trace data, with filters such as isRootObservation.
- Datasets
- Tools such as listDatasets, getDataset, upsertDatasetItem and listDatasetRuns manage evaluation datasets and their runs.
- Comments and scores
- listComments and createComment annotate objects, and createScore records a score.
- Project-scoped, stateless access
- Each request is authenticated with a project API key, and no session state is kept between requests.
- Tool hints
- Tools are marked with readOnlyHint or destructiveHint so clients can auto-approve reads and ask before destructive changes.
Setting it up
Create a project API key in your project settings, then base64-encode publickey:secretkey, for example echo -n "pk-lf-...:sk-lf-..." | base64. In Claude Code, run claude mcp add --transport http langfuse https://cloud.langfuse.com/api/public/mcp --header "Authorization: Basic <token>", using us.cloud.langfuse.com, jp.cloud.langfuse.com or your own host as needed. For Codex, add a [mcp_servers.langfuse] block to ~/.codex/config.toml with the url and an Authorization header; Cursor takes the same URL and header under Add Custom MCP. For self-hosted instances, Langfuse's Claude Code example uses an HTTPS URL, and reverse proxies must keep the public Host header or you must list extra hosts in LANGFUSE_MCP_ALLOWED_HOSTS.
Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)
Where it helps
- Pulling the current production version of a prompt into your code
- Inspecting recent traces of an LLM feature to debug a bad answer
- Adding failing examples from traces to an evaluation dataset
- Leaving comments or scores on observations during a review
Limitations and things to watch
- Write tools are on by default; allowlist read-only tools in your client if you need that.
- Tools and schemas may change, so do not rely on a fixed tool list.
- Each API key covers one project, and organisation-level keys are not supported.
- Langfuse suggests its agent skill rather than MCP for agents that can run CLI commands.
Sources
Written from the project's own documentation, checked November 2026.
- langfuse.com /docs/api-and-data-platform/features/mcp-server
- github.com /langfuse/langfuse/tree/main/web/src/features/mcp
- mcp.reference.langfuse.com
- github.com /langfuse/mcp-server-langfuse
How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.