Back to MCP directory
publicPublicdnsLocal runtime

Langfuse

一个为Langfuse设计的MCP服务器,用于集成AI助手与Langfuse工作区。

article

README

🚀 用于Langfuse的Shouting MCP服务器

一个用于将AI助手与Langfuse工作区集成的Model Context Protocol (MCP)服务器实现,可让AI模型通过时间范围查询LLM指标。

🚀 快速开始

此包提供的MCP服务器,允许AI助手与Langfuse工作区进行交互。

✨ 主要特性

  • 支持AI模型通过时间范围查询LLM指标。

📦 安装指南

# 从npm安装
npm install shouting-mcp-langfuse

# 或者全局安装
npm install -g shouting-mcp-langfuse

您可以在npm上找到该包:shouting-mcp-langfuse

先决条件

在使用服务器之前,需要创建一个Langfuse项目并获取项目的公钥和私钥。您可以在Langfuse控制面板中找到这些密钥。具体步骤如下:

  1. 设置Langfuse项目
  2. 获取项目的公钥和私钥
  3. 设置环境变量

配置

服务器需要以下环境变量:

  • LANGFUSE_DOMAIN:Langfuse域(默认:https://api.langfuse.com
  • LANGFUSE_PUBLIC_KEY:您的Langfuse项目公钥
  • LANGFUSE_PRIVATE_KEY:您的Langfuse项目私钥

💻 使用示例

基础用法

作为CLI工具运行

# 设置环境变量
export LANGFUSE_DOMAIN="https://api.langfuse.com"
export LANGFUSE_PUBLIC_KEY="your-public-key"
export LANGFUSE_PRIVATE_KEY="your-private"

# 运行服务器
mcp-server-langfuse

在代码中使用

import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { langfuseClient } from "shouting-mcp-langfuse";

// 初始化服务器和客户端
const server = new Server({...});
const langfuseClient = new LangfuseClient(process.env.LANGFUSE_DOMAIN, process.env.LANGFUSE_PUBLIC_KEY, process.env.LANGFUSE_PRIVATE_KEY);

// 注册自定义处理程序
// ...

📚 详细文档

服务器提供了以下Langfuse集成工具:

  • getLLMMetricsByTimeRange:通过时间范围获取LLM指标

📄 许可证

ISC

👨‍💻 作者

shouting.hsiao@gmail.com

📂 仓库

https://github.com/z9905080/mcp-langfuse

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client