Back to MCP Catalog

Langfuse Prompt Management MCP Server

Developer ToolsTypeScript
Access and manage your Langfuse prompts through the Model Context Protocol
Available Tools

get-prompts

List available prompts from your Langfuse account with optional cursor-based pagination

cursor

get-prompt

Retrieve and compile a specific prompt from your Langfuse account

namearguments

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.

Overview

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.

Installation

Prerequisites

  • Node.js installed on your system
  • A Langfuse account with API keys
  • Prompts created in your Langfuse account (with a "production" label)

Setup Instructions

  1. Clone the repository:

    git clone https://github.com/langfuse/mcp-server-langfuse.git
    cd mcp-server-langfuse
    
  2. Install dependencies:

    npm install
    
  3. Build the server:

    npm run build
    
  4. 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
    
  5. Add the server to your AI assistant's MCP configuration.

Configuration

Claude Desktop

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"
      }
    }
  }
}

Cursor

Add a new server in Cursor with the following configuration:

  • Name: Langfuse Prompts
  • Type: command
  • 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

Usage

Once configured, you can access your Langfuse prompts directly from your AI assistant:

  1. List available prompts: The assistant can list all prompts available in your Langfuse account that have the "production" label.

  2. Use a specific prompt: You can request a specific prompt by name, and provide any required variables as arguments.

  3. Pagination: If you have many prompts, you can navigate through them using cursor-based pagination.

Limitations

  • Only prompts with a "production" label in Langfuse are returned
  • All arguments are assumed to be optional and do not include descriptions as variables do not have specifications in Langfuse
  • List operations require fetching each prompt individually in the background to extract the arguments, which works but is not efficient

Troubleshooting

If you encounter issues:

  1. Verify your Langfuse API keys are correct
  2. Ensure your prompts in Langfuse have the "production" label
  3. Check that the absolute path to the build directory is correct in your configuration
  4. Verify that Node.js is properly installed and accessible

Related MCPs

Apple Shortcuts
Developer ToolsJavaScript

Control Apple Shortcuts automations from AI assistants

Clojars Dependency Lookup
Developer ToolsJavaScript

Fetch dependency information from Clojars, the Clojure community's artifact repository

Simple Timeserver
Developer ToolsPython

Provides Claude with current time and timezone information

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.