模型上下文协议 (MCP) 服务器用于 Langfuse 提示管理。此服务器允许您通过模型上下文协议访问和管理您的 Langfuse 提示。
快速演示 Langfuse 提示 MCP 在 Claude Desktop 中的应用(取消静音以获取语音解释):
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
# 构建当前文件
npm run build
# 在 MCP 检查器中测试
npx @modelcontextprotocol/inspector node ./build/index.js
npm install
npm run build
通过编辑 claude_desktop_config.json 配置 Claude for Desktop
{
"mcpServers": {
"langfuse": {
"command": "node",
"args": ["<绝对路径>/build/index.js"],
"env": {
"LANGFUSE_PUBLIC_KEY": "您的公钥",
"LANGFUSE_SECRET_KEY": "您的私钥",
"LANGFUSE_BASEURL": "https://cloud.langfuse.com"
}
}
}
}
确保用您的实际 Langfuse API 密钥替换环境变量。现在该服务器可以在 Claude Desktop 中使用了。
在 Cursor 中添加新服务器:
Langfuse 提示命令LANGFUSE_PUBLIC_KEY="您的公钥" LANGFUSE_SECRET_KEY="您的私钥" LANGFUSE_BASEURL="https://cloud.langfuse.com" node 绝对路径/build/index.js
MCP 服务器仍在开发中,存在一些限制:
production 标签的 Langfuse 提示欢迎贡献!如果您有任何建议或反馈,请打开一个问题或 PR(仓库)。