模型上下文协议 (MCP) 服务器用于 Langfuse 提示管理。此服务器允许您通过模型上下文协议访问和管理您的 Langfuse 提示。
在 Claude 桌面版中快速演示 Langfuse 提示 MCP (取消静音以听取语音说明):
https://github.com/user-attachments/assets/61da79af-07c2-4f69-b28c-ca7c6e606405
该服务器实现了MCP 提示规范,用于提示的发现和检索。
prompts/list
: 列出所有可用的提示
prompts/get
: 获取特定提示
为了增加与其他不支持提示功能的 MCP 客户端的兼容性,该服务器还导出了工具,这些工具复制了 MCP 提示的功能。
get-prompts
: 列出可用提示
cursor
参数用于分页get-prompt
: 检索并编译特定提示
name
参数:要检索的提示名称arguments
参数:带有提示变量的 JSON 对象npm install
# build current file
npm run build
# test in mcp inspector
npx @modelcontextprotocol/inspector node ./build/index.js

npm install npm run build
通过编辑 claude_desktop_config.json
配置 Claude 桌面版
{
"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"
}
}
}
}

确保用您的实际 Langfuse API 密钥替换环境变量。现在可以在 Claude 桌面版中使用该服务器了。
向 Cursor 添加新服务器:
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

MCP 服务器正在开发中,存在一些限制:
production
标签的提示欢迎贡献!如果您有任何建议或反馈,请打开一个 issue 或 PR (仓库)。