Langfuse MCP Server
Langfuse includes a native Model Context Protocol (MCP) server that enables AI assistants and agents to interact with your Langfuse data programmatically.
Currently, the MCP server is available for Prompt Management and will be extended to the rest of the Langfuse data platform in the future. If you have feedback or ideas for new tools, please share them on GitHub.
This is the authenticated MCP server for the Langfuse data platform. There is also a public MCP server for the Langfuse documentation (docs).
Alternatively you can also work with the Langfuse Agent Skill. Many use cases that aren't supported by the MCP server can be achieved using the skill.
Configuration
The Langfuse MCP server uses a stateless architecture where each API key is scoped to a specific project. Use the following configuration to connect to the MCP server:
- Endpoint:
https://cloud.langfuse.com/api/public/mcp - Transport:
streamableHttp - Authentication: Basic Auth via authorization header
- Endpoint:
https://us.cloud.langfuse.com/api/public/mcp - Transport:
streamableHttp - Authentication: Basic Auth via authorization header
- Endpoint:
https://jp.cloud.langfuse.com/api/public/mcp - Transport:
streamableHttp - Authentication: Basic Auth via authorization header
- Endpoint:
https://hipaa.cloud.langfuse.com/api/public/mcp - Transport:
streamableHttp - Authentication: Basic Auth via authorization header
- Endpoint:
https://your-domain.com/api/public/mcp - Transport:
streamableHttp - Authentication: Basic Auth via authorization header
MCP Reference
The MCP Reference is the canonical source for current Langfuse MCP servers, setup snippets, tools, input schemas, and generated request examples.
Both read and write tools are available by default. If you only want to
use read-only tools, configure your MCP client with an allowlist to restrict
access to write operations (createTextPrompt, createChatPrompt,
updatePromptLabels).
Set up
Get Authentication Header
- Navigate to your project settings and create or copy a project-scoped API key:
- Public Key:
pk-lf-... - Secret Key:
sk-lf-...
- Public Key:
- Encode the credentials to base64 format:
echo -n "pk-lf-your-public-key:sk-lf-your-secret-key" | base64
Client Setup
-
Register the Langfuse MCP server with a single command, replace
{your-base64-token}with your encoded credentials:# Langfuse Cloud (EU) claude mcp add --transport http langfuse https://cloud.langfuse.com/api/public/mcp \ --header "Authorization: Basic {your-base64-token}" # Langfuse Cloud (US) claude mcp add --transport http langfuse https://us.cloud.langfuse.com/api/public/mcp \ --header "Authorization: Basic {your-base64-token}" # Langfuse Cloud (Japan) claude mcp add --transport http langfuse https://jp.cloud.langfuse.com/api/public/mcp \ --header "Authorization: Basic {your-base64-token}" # Langfuse Cloud (HIPAA) claude mcp add --transport http langfuse https://hipaa.cloud.langfuse.com/api/public/mcp \ --header "Authorization: Basic {your-base64-token}" # Self-Hosted (HTTPS required) claude mcp add --transport http langfuse https://your-domain.com/api/public/mcp \ --header "Authorization: Basic {your-base64-token}" # Local Development claude mcp add --transport http langfuse http://localhost:3000/api/public/mcp \ --header "Authorization: Basic {your-base64-token}" -
Verify the connection by asking Claude Code to
list all prompts in the project. Claude Code should use thelistPromptstool to return the list of prompts.
- Open Cursor Settings (
Cmd/Ctrl + Shift + J) - Navigate to Tools & Integrations tab
- Click "Add Custom MCP"
- Add your Langfuse MCP server configuration, replace
{your-base64-token}with your encoded credentials:
{
"mcp": {
"servers": {
"langfuse": {
"url": "https://cloud.langfuse.com/api/public/mcp",
"headers": {
"Authorization": "Basic {your-base64-token}"
}
}
}
}
}{
"mcp": {
"servers": {
"langfuse": {
"url": "https://us.cloud.langfuse.com/api/public/mcp",
"headers": {
"Authorization": "Basic {your-base64-token}"
}
}
}
}
}{
"mcp": {
"servers": {
"langfuse": {
"url": "https://jp.cloud.langfuse.com/api/public/mcp",
"headers": {
"Authorization": "Basic {your-base64-token}"
}
}
}
}
}{
"mcp": {
"servers": {
"langfuse": {
"url": "https://hipaa.cloud.langfuse.com/api/public/mcp",
"headers": {
"Authorization": "Basic {your-base64-token}"
}
}
}
}
}{
"mcp": {
"servers": {
"langfuse": {
"url": "https://your-domain.com/api/public/mcp",
"headers": {
"Authorization": "Basic {your-base64-token}"
}
}
}
}
}- Save the file and restart Cursor
- The server should appear in the MCP settings with a green dot indicating it's active
- Endpoint:
/api/public/mcp- EU:
https://cloud.langfuse.com/api/public/mcp - US:
https://us.cloud.langfuse.com/api/public/mcp - Japan:
https://jp.cloud.langfuse.com/api/public/mcp - HIPAA:
https://hipaa.cloud.langfuse.com/api/public/mcp - Self-Hosted:
https://your-domain.com/api/public/mcp
- EU:
- Transport:
streamableHttp - Authentication: Basic Auth via authorization header
Authorization: Basic {your-base64-token}
Use Cases
The MCP server enables powerful workflows for AI-assisted prompt management:
- Prompt Creation: "Create a new chat prompt for customer support with system instructions and example messages"
- Version Management: "Update the staging label to point to version 3 of the email-generation prompt"
- Prompt Discovery: "List all prompts tagged with 'production' and show their latest versions"
- Iterative Development: "Create a new version of the code-review prompt with improved instructions"
Feedback
We'd love to hear about your experience with the Langfuse MCP server. Share your feedback, ideas, and use cases in our GitHub Discussion.
Related Documentation
- MCP Reference - Reference for MCP servers, setup snippets, tools, schemas, and requests
- Prompt Management with MCP - Prompt-specific workflows and examples
- Prompt Management Overview - Learn about Langfuse prompt management
- Public API - REST API for programmatic access
Last edited