The Langfuse Prompt Management MCP Server enables access to and management of your Langfuse prompts through the Model Context Protocol. It acts as a bridge between your Langfuse prompt library and MCP-compatible tools like Claude Desktop and Cursor.
This server implements the MCP Prompts specification with key capabilities:
npm install
npm run build
You'll need your Langfuse API keys for the server to function properly. The server requires these environment variables:
LANGFUSE_PUBLIC_KEY
LANGFUSE_SECRET_KEY
LANGFUSE_BASEURL
(typically "https://cloud.langfuse.com")To add the server to Claude Desktop, edit your claude_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"
}
}
}
}
Be sure to replace <absolute-path>
with the actual path to your built server and add your actual Langfuse credentials.
To add the server to Cursor:
Add a new server with these settings:
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
Replace absolute-path
with your actual server path and insert your Langfuse credentials.
Once configured, the MCP server provides these main capabilities:
The server makes available two primary MCP methods:
prompts/list
: View all available prompts in your Langfuse account
prompts/get
: Retrieve and use a specific prompt
For MCP clients that don't support the prompt capability directly, these tools are available:
get-prompts
: Lists all available prompts (with pagination support)get-prompt
: Retrieves and compiles a specific promptCurrently, the server:
production
label in LangfuseTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "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"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"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"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"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"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect