List available prompts from your Langfuse account with optional cursor-based pagination
Retrieve and compile a specific prompt from your Langfuse account
Langfuse Prompt Management provides seamless integration between Langfuse's prompt management system and AI assistants through the Model Context Protocol (MCP). This integration allows you to discover, retrieve, and use prompts stored in your Langfuse account directly within AI assistants like Claude Desktop and Cursor. With this MCP server, you can access all your production-ready prompts from Langfuse, complete with their variables and arguments. The server transforms both text and chat prompts from Langfuse into MCP prompt objects, making them readily available for your AI workflows without leaving your assistant interface.
The Langfuse Prompt Management MCP server connects your AI assistants to prompts stored in Langfuse, allowing you to access and use your managed prompts directly within your AI workflows.
Clone the repository:
git clone https://github.com/langfuse/mcp-server-langfuse.git
cd mcp-server-langfuse
Install dependencies:
npm install
Build the server:
npm run build
Configure your environment variables:
Create a .env
file based on the .env.example
with your Langfuse credentials:
LANGFUSE_PUBLIC_KEY=your-public-key
LANGFUSE_SECRET_KEY=your-secret-key
LANGFUSE_BASEURL=https://cloud.langfuse.com
Add the server to your AI assistant's MCP configuration.
Edit your claude_desktop_config.json
file to include the Langfuse MCP server:
{
"mcpServers": {
"langfuse": {
"command": "node",
"args": ["<absolute-path>/build/index.js"],
"env": {
"LANGFUSE_PUBLIC_KEY": "your-public-key",
"LANGFUSE_SECRET_KEY": "your-secret-key",
"LANGFUSE_BASEURL": "https://cloud.langfuse.com"
}
}
}
}
Add a new server in Cursor with the following configuration:
Langfuse Prompts
command
LANGFUSE_PUBLIC_KEY="your-public-key" LANGFUSE_SECRET_KEY="your-secret-key" LANGFUSE_BASEURL="https://cloud.langfuse.com" node <absolute-path>/build/index.js
Once configured, you can access your Langfuse prompts directly from your AI assistant:
List available prompts: The assistant can list all prompts available in your Langfuse account that have the "production" label.
Use a specific prompt: You can request a specific prompt by name, and provide any required variables as arguments.
Pagination: If you have many prompts, you can navigate through them using cursor-based pagination.
If you encounter issues: