Langfuse Prompt Management

by langfuse

109 stars
377 downloads
Not rated
GitHub Website

About

Integrates with Langfuse to enable dynamic prompt management, version control, and retrieval for AI applications

Details

Author
langfuse
Repository
langfuse/mcp-server-langfuse
GitHub stars
109
Downloads
377
License
MIT License
Categories
Developer Tools, AI, Communication, Productivity, Design, Frontend, Other
Tags
#integration

- Implements MCP Prompts specification (prompts/list, prompts/get)
- Also provides tools (get-prompts, get-prompt) for non-prompt-capable clients
- Transforms Langfuse text and chat prompts into MCP prompt objects
- Compiles prompts with provided variables
- Supports optional cursor-based pagination for listing prompts

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Langfuse Prompt Management
    Command (node, npx, python, etc.) node
    Arguments
    • Argument 1 <absolute-path>/build/index.js
    Environment
    • LANGFUSE_BASEURL https://cloud.langfuse.com
    • LANGFUSE_PUBLIC_KEY your-public-key
    • LANGFUSE_SECRET_KEY your-secret-key

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install dependencies (npm install), build the server (npm run build), then add it to your MCP client’s configuration (e.g., claude_desktop_config.json or Cursor) with your Langfuse API keys and base URL set as environment variables. The server exposes both standard MCP prompts and equivalent tools for broader client compatibility.

get-prompts

List available prompts. Optional `cursor` parameter for pagination. Returns a list of prompts with their arguments.

get-prompt

Retrieve and compile a specific prompt. Required `name` parameter is the name of the prompt to retrieve. Optional `arguments` parameter is a JSON object with prompt variables.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "langfuse prompt management": {
            "env": {
                "LANGFUSE_BASEURL": "https://cloud.langfuse.com",
                "LANGFUSE_PUBLIC_KEY": "your-public-key",
                "LANGFUSE_SECRET_KEY": "your-secret-key"
            },
            "args": [
                "<absolute-path>/build/index.js"
            ],
            "command": "node"
        }
    }
}

Linux

{
    "env": {
        "LANGFUSE_BASEURL": "https://cloud.langfuse.com",
        "LANGFUSE_PUBLIC_KEY": "your-public-key",
        "LANGFUSE_SECRET_KEY": "your-secret-key"
    },
    "args": [
        "<absolute-path>/build/index.js"
    ],
    "command": "node"
}

Macos

{
    "env": {
        "LANGFUSE_BASEURL": "https://cloud.langfuse.com",
        "LANGFUSE_PUBLIC_KEY": "your-public-key",
        "LANGFUSE_SECRET_KEY": "your-secret-key"
    },
    "args": [
        "<absolute-path>/build/index.js"
    ],
    "command": "node"
}

Windows

{
    "env": {
        "LANGFUSE_BASEURL": "https://cloud.langfuse.com",
        "LANGFUSE_PUBLIC_KEY": "your-public-key",
        "LANGFUSE_SECRET_KEY": "your-secret-key"
    },
    "args": [
        "/c",
        "node <absolute-path>/build/index.js"
    ],
    "command": "cmd"
}

What can you do with Langfuse Prompt Management MCP?

- List production prompts— Discover all prompts labeledproductionin Langfuse viaprompts/listorget-prompts, with cursor-based pagination.
- Retrieve a compiled prompt— Fetch a specific prompt by name and compile it with provided variables usingprompts/getorget-prompt.
- Pass prompt variables as JSON— Supply a JSON object of variable values to theargumentsparameter when retrieving a prompt.

Model Context Protocol(MCP) Server forLangfuse Prompt Management. This server allows you to access and manage your Langfuse prompts through the Model Context Protocol.

Quick demo of Langfuse Prompts MCP in Claude Desktop (unmute for voice-over explanations):

https://github.com/user-attachments/assets/61da79af-07c2-4f69-b28c-ca7c6e606405

This server implements theMCP Prompts specificationfor prompt discovery and retrieval.

-

prompts/list: List all available prompts

- Optional cursor-based pagination
- Returns prompt names and their required arguments, limitation: all arguments are assumed to be optional and do not include descriptions as variables do not have specification in Langfuse
- Includes next cursor for pagination if there's more than 1 page of prompts

- Transforms Langfuse prompts (text and chat) into MCP prompt objects
- Compiles prompt with provided variables

To increase compatibility with other MCP clients that do not support the prompt capability, the server also exports tools that replicate the functionality of the MCP Prompts.

- Optionalcursorparameter for pagination
- Returns a list of prompts with their arguments

get-prompt: Retrieve and compile a specific prompt

- Requirednameparameter: Name of the prompt to retrieve
- Optionalargumentsparameter: JSON object with prompt variables

npm install # build current file npm run build # test in mcp inspector npx @modelcontextprotocol/inspector node ./build/index.js

Step 2: Add the server to your MCP servers:

Configure Claude for Desktop by editingclaude_desktop_config.json

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

Make sure to replace the environment variables with your actual Langfuse API keys. The server will now be available to use in Claude Desktop.

- 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

The MCP Server is a work in progress and has some limitations:

- Only prompts with aproductionlabel in Langfuse are returned
- All arguments are assumed to be optional and do not include descriptions as variables do not have specification in Langfuse
- List operations require fetching each prompt individually in the background to extract the arguments, this works but is not efficient

Contributions are welcome! Please open an issue or a PR (repo) if you have any suggestions or feedback.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

One shared context layer for AI agents and humans — live API specs, DB schemas, and versioned contracts across repos so every agent and teammate works from the same source of truth.

Official MCP server for Buildable AI-powered development platform. Enables AI assistants to manage tasks, track progress, get project context, and collaborate with humans on software projects.

Local-first knowledge graph for developers. Watches project files, extracts entities and relationships via LLMs, and lets you query across projects with natural language and source citations.

next-devtools-mcp is a MCP server that provides Next.js development tools and utilities for AI coding assistants like Claude and Cursor.

Word search, crossword, and sudoku generator MCP server with printable PDF worksheets, themed word banks, and verifiable LLM evals. Local-first, from the makers of puzzletide.com.

A demonstration server for ActionKit, providing access to Slack actions via Claude Desktop.

MCP server that lets Claude Code agents delegate tasks to agents in other project directories, with parallel dispatch, sessions, and async jobs.

Statistical regression testing for LLM agents: p-value, effect size, and CI on behavior change.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.