Langfuse MCP server
Langfuse's official hosted MCP server: manage prompts, query traces and observations, run evals, and inspect LLM metrics from your agent.
The Langfuse MCP server is Langfuse's official integration for its open-source LLM engineering platform. Langfuse is where teams version prompts, trace LLM application runs, score outputs, and analyze cost and latency. This server exposes that whole surface to a coding agent so it can fetch and compile a production prompt, list and search observations to debug a failing trace, manage datasets and evaluation runs, create scores, and query usage and cost metrics — all inside its tool-calling loop instead of through the web UI.
The canonical deployment is the hosted server built directly into Langfuse at /api/public/mcp, using the streamable HTTP transport with no build step. The endpoint is region-specific — https://cloud.langfuse.com/api/public/mcp for the EU data region, https://us.cloud.langfuse.com/api/public/mcp for the US region, or your own domain when self-hosting. Authentication uses your project-scoped public and secret API keys sent as HTTP Basic Auth in the Authorization header, so each connection is scoped to a single Langfuse project. Both read and write tools are enabled by default, covering prompt management, observations, annotation queues, comments, datasets, scores and score configs, analytics, model definitions, and utility health and media tools.
Quick install
Copy-paste configs are provided for all 8 supported clients. Pick your client below.
Add to ~/.claude.json
{
"mcpServers": {
"langfuse": {
"type": "http",
"url": "https://cloud.langfuse.com/api/public/mcp",
"headers": {
"Authorization": "Bearer <LANGFUSE_AUTH_HEADER>"
}
}
}
}claude mcp add --transport http langfuse https://cloud.langfuse.com/api/public/mcpAvailable tools
| Tool | Description |
|---|---|
| getPrompt | Retrieve a prompt by name, with an optional label or version, compiled and ready to use. |
| getPromptUnresolved | Fetch a prompt without resolving dependencies, returning its raw template. |
| listPrompts | List and filter prompts with their metadata. |
| createTextPrompt | Create a new text prompt version. |
| createChatPrompt | Create a new chat prompt version with OpenAI-style messages. |
| updatePromptLabels | Update the labels for a prompt version. |
| listObservations | Find observations such as generations, spans, and events with filtering. |
| getObservation | Retrieve a single observation by ID. |
| getObservationFieldSchema | Show the available fields on an observation. |
| getObservationFilterSchema | Show the filterable fields and the operators available for filtering observations. |
| getObservationFilterValues | List the available values for a given observation filter field. |
| listAnnotationQueues | List the annotation worklists in the project. |
| createAnnotationQueue | Create a new annotation queue. |
| getAnnotationQueue | Retrieve an annotation queue by ID. |
| listAnnotationQueueItems | List the items in an annotation queue with their status. |
| getAnnotationQueueItem | Get a single annotation queue item. |
| createAnnotationQueueItem | Add an item to an annotation queue. |
| updateAnnotationQueueItem | Update an annotation queue item's review status. |
| deleteAnnotationQueueItem | Remove an item from an annotation queue. |
| createAnnotationQueueAssignment | Assign a user to an annotation queue. |
| deleteAnnotationQueueAssignment | Unassign a user from an annotation queue. |
| createComment | Create a comment on a trace, observation, session, or prompt. |
| listComments | List comments with optional filters. |
| getComment | Retrieve a comment by ID. |
| upsertDataset | Create or update a dataset. |
| listDatasets | List datasets with pagination. |
| getDataset | Retrieve a dataset by ID. |
| upsertDatasetItem | Create or update a dataset example item. |
| listDatasetItems | List the items in a dataset. |
| getDatasetItem | Retrieve a dataset item by ID. |
| deleteDatasetItem | Delete a dataset item and its run items. |
| createDatasetRunItem | Link a dataset item to a trace or observation within a run. |
| listDatasetRunItems | List the run items (results) of a dataset run. |
| listDatasetRuns | List the experiment and evaluation runs for a dataset. |
| getDatasetRun | Retrieve a dataset run and its items. |
| deleteDatasetRun | Delete a dataset run and enqueue deletion of its run items. |
| listScores | Find quality and feedback scores. |
| getScore | Retrieve a score by ID. |
| createScore | Create a score (with eventual consistency). |
| listScoreConfigs | List score configuration templates. |
| getScoreConfig | Retrieve a score config by ID. |
| createScoreConfig | Create a numeric, categorical, boolean, or text score config. |
| updateScoreConfig | Modify a score config's settings. |
| deleteScoreConfig | Archive a score config. |
| queryMetrics | Analyze usage, costs, latency, and scores aggregated by dimensions. |
| getMetricsSchema | Discover the queryable metrics and aggregations available. |
| listModels | List the model definitions used for cost and token accounting. |
| createModel | Create a custom model definition for cost and tokenization. |
| getModel | Retrieve a model definition by ID. |
| deleteModel | Remove a custom model definition. |
| getHealth | Check the API health and database availability. |
| getMedia | Fetch a media asset's metadata and download URL. |
Required configuration
- LANGFUSE_AUTH_HEADERRequired
HTTP Basic Auth header value 'Basic <base64(publicKey:secretKey)>' built from your project-scoped Langfuse public and secret keys. Required.
What you can do with it
Manage prompts without leaving the editor
The agent fetches the production version of a prompt with getPrompt, iterates on it, and ships a new version via createTextPrompt or createChatPrompt — keeping prompt history versioned in Langfuse while you stay in your coding tool.
Debug traces and analyze cost
When an LLM feature misbehaves, the agent uses listObservations and getObservation to inspect generations and spans, creates a score on the bad output, and runs queryMetrics to see how cost and latency trend across the project.
FAQ
- Is it free?
- Langfuse is open source (MIT) and free to self-host, and Langfuse Cloud has a free tier; the MCP server is built into Langfuse at no extra cost. You authenticate with your existing project API keys, and any paid usage follows your Langfuse plan.
- Does it support remote/OAuth?
- It is a hosted remote server over streamable HTTP at /api/public/mcp on your region's Langfuse host (EU, US, or self-hosted). Authentication is HTTP Basic Auth using your project's public and secret keys in the Authorization header rather than OAuth, which scopes each connection to one project.