mcp -langfuse
Model Context Protocol (MCP) Server for Langfuse Prompt Management. This server allows you to access and manage your Langfuse prompts through the Model Context Protocol.
claude mcp add --transport stdio langfuse-mcp-server-langfuse node <absolute-path>/build/index.js \ --env LANGFUSE_BASEURL="https://cloud.langfuse.com" \ --env LANGFUSE_PUBLIC_KEY="your-public-key" \ --env LANGFUSE_SECRET_KEY="your-secret-key"
How to use
This MCP server exposes Langfuse prompts through the Model Context Protocol, allowing MCP clients to discover and retrieve prompts via MCP concepts. It implements the MCP Prompts interface for discovery (prompts/list) and retrieval (prompts/get), transforming Langfuse prompts (text and chat) into MCP prompt objects and compiling them with provided variables. For broader compatibility, the server also exposes two tooling endpoints (get-prompts and get-prompt) that replicate the same functionality so clients that don’t support the prompt capability can still enumerate and fetch prompts. To use it, run the server in a Node.js environment and configure your MCP client (e.g., Claude Desktop or Cursor) to point at the build/index.js entry, supplying your Langfuse API keys and base URL as environment variables. Once configured, you can list available prompts and fetch specific prompts by name, optionally providing arguments to be merged into the final prompt.
How to install
Prerequisites:
- Node.js (LTS version) installed on your system
- Access to Langfuse account and API keys (public key, secret key, and base URL)
Installation steps:
- Clone the MCP server repository or download the package.
- Install dependencies: npm install
- Build the server (if required by the project setup): npm run build
- Start the server (example): LANGFUSE_PUBLIC_KEY="your-public-key" LANGFUSE_SECRET_KEY="your-secret-key" LANGFUSE_BASEURL="https://cloud.langfuse.com" node <absolute-path>/build/index.js
- Verify the server is running by making a test request to the MCP endpoints or by using the MCP inspector as described in the repository README.
Additional notes
Notes and tips:
- Ensure your Langfuse API keys are kept secure and not committed to version control. Use environment variables as shown in the examples.
- The MCP prompts implementation may only expose prompts labeled as production in Langfuse, per current limitations.
- Arguments for prompts are treated as optional in this version; descriptions may be unavailable due to Langfuse prompt specifications.
- If you’re integrating with Claude Desktop or Cursor, you can configure the mcpServers section in the respective config files to point to the Node entry, including the required environment variables.
- When troubleshooting, enable verbose logs and verify that the environment variables are correctly picked up by the runtime environment.
Related MCP Servers
mcp-router
A Unified MCP Server Management App (MCP Manager).
mcp-manager
simple web ui to manage mcp (model context protocol) servers in the claude app
Remote
A type-safe solution to remote MCP communication, enabling effortless integration for centralized management of Model Context.
Matryoshka
MCP server for token-efficient large document analysis via the use of REPL state
codemesh
The Self-Improving MCP Server - Agents write code to orchestrate multiple MCP servers with intelligent TypeScript execution and auto-augmentation
mcp-agent
Lightweight, focused utilities to manage connections and execute MCP tools with minimal integration effort. Use it to directly call tools or build simple agents within your current architecture.