@meltstudio/langfuse-mcp-server
v2.3.0
Published
MCP server for Langfuse prompt management - get and compile prompts directly in Cursor
Readme
Langfuse MCP Server for Cursor
Get and compile your Langfuse prompts directly in Cursor. No more copying and pasting—just chat with your prompts.
Quick Start
1. Install
npm install -g @meltstudio/langfuse-mcp-server2. Get Your Langfuse Credentials
- Go to your Langfuse project settings
- Copy your Secret Key and Public Key
3. Configure Cursor
Add this to your Cursor settings file (.cursor/mcp.json):
{
"mcpServers": {
"langfuse": {
"command": "melt-langfuse-mcp",
"env": {
"LANGFUSE_SECRET_KEY": "sk-lf-your-secret-key-here",
"LANGFUSE_PUBLIC_KEY": "pk-lf-your-public-key-here"
}
}
}
}4. Restart Cursor
5. Test Your Integration
After Cursor restarts, test that everything is working:
Test with direct prompt execution (Recommended):
- In Cursor chat, type:
Use the melt-integration-test prompt - You should see a welcome message confirming everything works
- To test with variables:
Use the melt-integration-test prompt with my_name='YourName' and task='building AI apps'
- In Cursor chat, type:
Test with MCP tools:
- Ask Cursor: "Show me all my prompts"
- Ask Cursor: "Get the melt-integration-test prompt"
- Ask Cursor: "Compile melt-integration-test with my_name='YourName' and task='building AI apps'"
If any of these work, you're all set! 🎉
Updating
To update to the latest version:
npm update -g @meltstudio/langfuse-mcp-serverOr to force reinstall:
npm install -g @meltstudio/langfuse-mcp-server@latestAfter updating, restart Cursor to use the new version.
You can check your installed version with:
melt-langfuse-mcp --versionUsage
The MCP server provides two ways to work with your Langfuse prompts:
1. Direct Prompt Integration (Recommended)
Use Cursor's prompt selector to browse and use your Langfuse prompts directly in chat:
- Open Cursor's prompt selector (usually
@in chat) - Browse your available Langfuse prompts
- Select a prompt to use it directly in your conversation
- Provide variables if the prompt requires them
2. Manual Tool Usage
You can also chat naturally with Cursor using these commands:
- "Show me all my prompts" - Lists your Langfuse prompts
- "Get the movie-critic prompt" - Fetches a specific prompt
- "Compile movie-critic with movie='Dune 2'" - Gets prompt ready for use
Example
You: "Get my movie-critic prompt and compile it for Dune 2"
Cursor: I'll fetch your movie-critic prompt and compile it for Dune 2.
[Gets the prompt from Langfuse and substitutes variables]
Here's your compiled prompt:
"You are an expert movie critic. Write a detailed review of Dune 2..."Available Commands
| What you want | Say this | |---------------|----------| | See all prompts | "List my prompts" or "Show me all prompts" | | Get a specific prompt | "Get the [prompt-name] prompt" | | Compile with variables | "Compile [prompt-name] with variable='value'" | | Get prompt details | "Tell me about the [prompt-name] prompt" |
Configuration Options
You can add these optional environment variables to your Cursor config:
{
"mcpServers": {
"langfuse": {
"command": "melt-langfuse-mcp",
"env": {
"LANGFUSE_SECRET_KEY": "sk-lf-...",
"LANGFUSE_PUBLIC_KEY": "pk-lf-...",
"LANGFUSE_HOST": "https://us.cloud.langfuse.com",
"LANGFUSE_DEFAULT_LABEL": "production"
}
}
}
}Troubleshooting
"Command not found" error
Make sure you installed globally: npm install -g @meltstudio/langfuse-mcp-server
"Authentication failed" error
Double-check your Langfuse credentials in the Cursor config.
"Prompt not found" error
- Check the prompt name is correct
- Make sure the prompt has the "production" label (or set
LANGFUSE_DEFAULT_LABELto match your label)
Langfuse Regions
US Region (default): https://us.cloud.langfuse.com
EU Region: https://cloud.langfuse.com
The server defaults to US region. For EU region or self-hosted, set your host:
"LANGFUSE_HOST": "https://cloud.langfuse.com"Or for self-hosted:
"LANGFUSE_HOST": "https://your-langfuse-instance.com"Made by Melt Studio
Questions? Open an issue or reach out to us.
