Skip to main content
Glama
MCP Server for langfuse

MCP Server for langfuse

by z9905080

langfuse 的 MCP 服务器

npm 版本

用于将 AI 助手与 Langfuse 工作区集成的模型上下文协议 (MCP) 服务器实现。

概述

此软件包提供了一个 MCP 服务器,使 AI 助手能够与 Langfuse 工作区交互。它允许 AI 模型执行以下操作:

  • 按时间范围查询 LLM 指标

Related MCP server: langfuse-mcp-extended

安装

# Install from npm
npm install shouting-mcp-langfuse

# Or install globally
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 工具运行

# Set environment variables
export LANGFUSE_DOMAIN="https://api.langfuse.com"
export LANGFUSE_PUBLIC_KEY="your-public-key"
export LANGFUSE_PRIVATE_KEY="your-private

# Run the server
mcp-server-langfuse

在代码中使用

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

// Initialize the server and client
const server = new Server({...});
const langfuseClient = new LangfuseClient(process.env.LANGFUSE_DOMAIN, process.env.LANGFUSE_PUBLIC_KEY, process.env.LANGFUSE_PRIVATE_KEY);

// Register your custom handlers
// ...

可用工具

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

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

执照

国际学习中心

作者

shouting.hsiao@gmail.com

存储库

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

Available Tools

1 tool
query_llm_metricsC

Query LLM metrics

Inputs: fromTimestamp, toTimestamp, page, limit, +4 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.8/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of confusion or overlap with other tools. The tool's purpose is clear and unambiguous.

    Naming Consistency5/5

    The single tool uses a clear snake_case naming convention. Although there are no other tools to compare, the naming is consistent within itself.

    Tool Count1/5

    A server named 'MCP Server for langfuse' with only one tool is severely undersized. Langfuse is a comprehensive LLM observability platform expecting tools for traces, scores, sessions, etc., not just metrics queries.

    Completeness1/5

    The server lacks any tools for creating, updating, or deleting resources, and does not cover common operations like managing traces or observations. It is severely incomplete for its stated domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers