MCP Server to connect to langfuse for usage & cost analysis.
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
claude mcp add langfuse --env LANGFUSE_BASEURL='<LANGFUSE_BASEURL>' --env LANGFUSE_PUBLIC_KEY='<LANGFUSE_PUBLIC_KEY>' --env LANGFUSE_SECRET_KEY='<LANGFUSE_SECRET_KEY>' -- npx @therealsachin/langfuse-mcp~/.codex/config.toml
[mcp_servers.langfuse]
command = "npx"
args = ["@therealsachin/langfuse-mcp"]
env = { LANGFUSE_BASEURL = "<LANGFUSE_BASEURL>", LANGFUSE_PUBLIC_KEY = "<LANGFUSE_PUBLIC_KEY>", LANGFUSE_SECRET_KEY = "<LANGFUSE_SECRET_KEY>" }
# codex mcp add langfuse --env LANGFUSE_BASEURL='<LANGFUSE_BASEURL>' --env LANGFUSE_PUBLIC_KEY='<LANGFUSE_PUBLIC_KEY>' --env LANGFUSE_SECRET_KEY='<LANGFUSE_SECRET_KEY>' -- npx @therealsachin/langfuse-mcp~/.cursor/mcp.json
{
"mcpServers": {
"langfuse": {
"command": "npx",
"args": [
"@therealsachin/langfuse-mcp"
],
"env": {
"LANGFUSE_BASEURL": "<LANGFUSE_BASEURL>",
"LANGFUSE_PUBLIC_KEY": "<LANGFUSE_PUBLIC_KEY>",
"LANGFUSE_SECRET_KEY": "<LANGFUSE_SECRET_KEY>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"langfuse": {
"type": "stdio",
"command": "npx",
"args": [
"@therealsachin/langfuse-mcp"
],
"env": {
"LANGFUSE_BASEURL": "<LANGFUSE_BASEURL>",
"LANGFUSE_PUBLIC_KEY": "<LANGFUSE_PUBLIC_KEY>",
"LANGFUSE_SECRET_KEY": "<LANGFUSE_SECRET_KEY>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"langfuse": {
"command": "npx",
"args": [
"@therealsachin/langfuse-mcp"
],
"env": {
"LANGFUSE_BASEURL": "<LANGFUSE_BASEURL>",
"LANGFUSE_PUBLIC_KEY": "<LANGFUSE_PUBLIC_KEY>",
"LANGFUSE_SECRET_KEY": "<LANGFUSE_SECRET_KEY>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"langfuse": {
"command": "npx",
"args": [
"@therealsachin/langfuse-mcp"
],
"env": {
"LANGFUSE_BASEURL": "<LANGFUSE_BASEURL>",
"LANGFUSE_PUBLIC_KEY": "<LANGFUSE_PUBLIC_KEY>",
"LANGFUSE_SECRET_KEY": "<LANGFUSE_SECRET_KEY>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"langfuse": {
"command": "npx",
"args": [
"@therealsachin/langfuse-mcp"
],
"env": {
"LANGFUSE_BASEURL": "<LANGFUSE_BASEURL>",
"LANGFUSE_PUBLIC_KEY": "<LANGFUSE_PUBLIC_KEY>",
"LANGFUSE_SECRET_KEY": "<LANGFUSE_SECRET_KEY>"
}
}
}
}需要的环境变量
LANGFUSE_BASEURLLANGFUSE_PUBLIC_KEYLANGFUSE_SECRET_KEY
把占位值换成你自己的密钥;不要把密钥提交到代码仓库。