
A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A secure MCP server for Langfuse analytics offering readonly and readwrite modes for safe operation.
Langfuse MCP Server is cataloged as an MCP server attributed to therealsachin. A secure MCP server for Langfuse analytics offering readonly and readwrite modes for safe operation. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.
能力定义尚未审核。未核验的采集内容不会作为可信接口展示。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for Langfuse MCP Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
The default is readonly mode, which only allows read operations; readwrite mode requires explicit opt-in.
Write tools use clear write_ prefixes such as write_create_dataset.
It enforces HTTPS, sanitizes URLs in error logs, and offers pre-commit credential detection hooks.
README.md · 1d2af92c44a1 · 采集于 2026-11-13 12:22:53 UTC
保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。
当前显示最后一次成功采集的文档快照,请以来源页面为准。
Version 1.4.2 - A secure MCP server for Langfuse analytics with comprehensive security features and dual readonly/readwrite modes for safe operation.
write_* prefixes for all data modification operations🔒 Security & Mode System:
write_create_dataset, write_delete_dataset_item, etc.)🛠️ Enhanced Functionality:
langfuse-mcp✅ Production Ready:
Read-Only Mode (Safe Default):
# Only analytics and read operations - safe for most users
npx @therealsachin/langfuse-mcp
# OR explicitly use readonly binary
langfuse-mcp-ro
Read-Write Mode (Explicit Opt-in):
# ⚠️ Enables write operations - can modify your Langfuse data
LANGFUSE_MCP_MODE=readwrite npx @therealsachin/langfuse-mcp
# OR use CLI flag
langfuse-mcp --readwrite
git clone https://github.com/therealsachin/langfuse-mcp.git
cd langfuse-mcp
npm install
npm run build
# Test readonly mode
LANGFUSE_MCP_MODE=readonly node build/index.js
# Test readwrite mode
LANGFUSE_MCP_MODE=readwrite node build/index.js
Set environment variables for each Langfuse project:
LANGFUSE_PUBLIC_KEY=pk-lf-xxx
LANGFUSE_SECRET_KEY=sk-lf-xxx
LANGFUSE_BASEURL=https://us.cloud.langfuse.com
Control server operation mode using CLI flags or environment variables:
CLI Flags (Recommended for npx usage):
# Read-only mode (default, safe)
npx @therealsachin/langfuse-mcp
# Read-write mode (explicit opt-in)
npx @therealsachin/langfuse-mcp --readwrite
# Alternative explicit flag syntax
npx @therealsachin/langfuse-mcp --mode=readonly
npx @therealsachin/langfuse-mcp --mode=readwrite
Environment Variables (Legacy support):
# Readonly mode (default, safe)
LANGFUSE_MCP_MODE=readonly
# Readwrite mode (explicit opt-in)
LANGFUSE_MCP_MODE=readwrite
Read-Only Mode (Recommended for most users):
{
"mcpServers": {
"langfuse": {
"command": "npx",
"args": ["@therealsachin/langfuse-mcp"],
"env": {
"LANGFUSE_PUBLIC_KEY": "pk-lf-your-key",
"LANGFUSE_SECRET_KEY": "sk-lf-your-secret",
"LANGFUSE_BASEURL": "https://us.cloud.langfuse.com"
}
}
}
}
Read-Write Mode (Advanced users only):
{
"mcpServers": {
"langfuse": {
"command": "npx",
"args": ["@therealsachin/langfuse-mcp", "--readwrite"],
"env": {
"LANGFUSE_PUBLIC_KEY": "pk-lf-your-key",
"LANGFUSE_SECRET_KEY": "sk-lf-your-secret",
"LANGFUSE_BASEURL": "https://us.cloud.langfuse.com"
}
}
}
}
⚠️ IMPORTANT: Never commit real API credentials to version control!
This MCP server includes multiple layers of security protection:
pk-lf- and sk-lf- format keysTo enable pre-commit hooks in your development environment:
npm install husky --save-dev
npx husky install
# Hooks are automatically configured - no manual setup needed!
.env file for local development (already in .gitignore)pk-lf-your-public-key# ❌ NEVER commit real credentials like this:
LANGFUSE_PUBLIC_KEY=pk-lf-REAL-KEY-NEVER-COMMIT-THIS
LANGFUSE_SECRET_KEY=sk-lf-REAL-SECRET-NEVER-COMMIT-THIS
# ✅ Use placeholder values in committed files:
LANGFUSE_PUBLIC_KEY=pk-lf-your-actual-public-key
LANGFUSE_SECRET_KEY=sk-lf-your-actual-secret-key
# ✅ Store real credentials in .env file (never committed):
# Create a .env file in your project root with your actual credentials
Add to your claude_desktop_config.json:
{
"mcpServers": {
"langfuse-analytics": {
"command": "npx",
"args": ["@therealsachin/langfuse-mcp"],
"env": {
"LANGFUSE_PUBLIC_KEY": "pk-lf-xxx",
"LANGFUSE_SECRET_KEY": "sk-lf-xxx",
"LANGFUSE_BASEURL": "https://us.cloud.langfuse.com"
}
}
}
}
{
"mcpServers": {
"langfuse-analytics": {
"command": "node",
"args": ["/path/to/langfuse-mcp/build/index.js"],
"env": {
"LANGFUSE_PUBLIC_KEY": "pk-lf-xxx",
"LANGFUSE_SECRET_KEY": "sk-lf-xxx",
"LANGFUSE_BASEURL": "https://us.cloud.langfuse.com"
}
}
}
}
Once integrated with Claude Desktop, you can ask questions like:
# Watch mode for development
npm run watch
# Test with MCP Inspector
npm run inspector
# Test endpoints (requires .env file)
npm run test
For comprehensive testing against real Langfuse data, create a .env file in the project root:
# .env file (never commit this - it's in .gitignore)
LANGFUSE_PUBLIC_KEY=pk-lf-your-actual-public-key
LANGFUSE_SECRET_KEY=sk-lf-your-actual-secret-key
LANGFUSE_BASEURL=https://us.cloud.langfuse.com
The test suite (npm run test) will automatically load these credentials using dotenv and run 13 comprehensive tests against your actual Langfuse project:
Note: The .env file is automatically ignored by git to keep your credentials secure.
✅ Package Published! The package is available via:
# Install and run directly with npx
npx @therealsachin/langfuse-mcp
# Or install globally
npm install -g @therealsachin/langfuse-mcp
Package Information:
@therealsachin/langfuse-mcpsrc/
├── index.ts # Main server entry point
├── config.ts # Project configuration loader
├── langfuse-client.ts # Langfuse client wrapper with 18+ API methods
├── types.ts # TypeScript type definitions
└── tools/ # All 18 MCP tools
# Core Analytics Tools (6)
├── list-projects.ts
├── project-overview.ts
├── usage-by-model.ts
├── usage-by-service.ts
├── top-expensive-traces.ts
├── get-trace-detail.ts
# Extended Analytics Tools (6)
├── get-projects.ts # Alias for list-projects
├── get-metrics.ts # Aggregated metrics
├── get-traces.ts # Trace filtering
├── get-observations.ts # LLM generations
├── get-cost-analysis.ts # Cost breakdowns
├── get-daily-metrics.ts # Daily trends
# System & Management Tools (6)
├── get-observation-detail.ts # Observation details
├── get-health-status.ts # Health monitoring
├── list-models.ts # AI models listing
├── get-model-detail.ts # Model details
├── list-prompts.ts # Prompt templates
└── get-prompt-detail.ts # Prompt details
docs/ # Comprehensive documentation
├── ARCHITECTURE.md # System design and patterns
├── DEVELOPER_GUIDE.md # Development workflows
├── TECHNICAL_DIAGRAMS.md # Visual system flows
├── IMPLEMENTATION_NOTES.md # API implementation details
└── DOCUMENTATION_INDEX.md # Navigation guide
test-endpoints.js # Comprehensive test suite (13 tests)
This server integrates with multiple Langfuse public API endpoints:
/api/public/metrics - Aggregated analytics using GET with JSON query parameter/api/public/metrics/daily - Daily usage metrics and cost breakdowns/api/public/traces - Trace listing, filtering, and individual trace retrieval/api/public/observations - Detailed observation analysis and LLM generation metrics/api/public/observations/{id} - Individual observation details and metadata/api/public/health - System health status and monitoring/api/public/models - AI model listing and configuration/api/public/prompts - Prompt template management and versioningAPI Implementation Notes:
query parameterAll authentication is handled server-side using Basic Auth with your Langfuse API keys.
For detailed architecture, development guides, and technical diagrams, see the comprehensive documentation:
Previous Issue: Earlier versions encountered "405 Method Not Allowed" errors due to incorrect API usage.
Solution: This has been FIXED in the current version by using the correct Langfuse API implementation:
query parameter (correct approach)/api/public/traces endpoint with proper filtering/api/public/observations endpoint with correct parameters/api/public/metrics/daily endpointPrevious Issue: Cost analysis tools were returning zero values even when actual cost data existed.
Solution: This has been FIXED by correcting field name mapping in API response parsing:
totalCost_sum, count_count, totalTokens_sumgetDailyMetrics API for cleaner daily cost breakdownsPrevious Issues:
get_observations returning responses exceeding MCP token limits (200k+ tokens)get_traces returning 400 Bad Request errorsSolutions Applied:
includeInputOutput: false parameter (default) to exclude large prompt/response contenttruncateContent: 500 parameter to limit content size when includedorderBy fieldPrevious Issue: Cost analysis was showing zero values for total costs and model breakdowns while daily data worked correctly.
Root Cause: The Metrics API field mapping was still incorrect despite earlier fixes.
Solution: Switched to using the working Daily Metrics API data for all aggregations:
Result:
totalCost now shows correct values (sum of daily costs)byModel now populated with real model cost breakdownsbyDay continues to work perfectlybyUser includes debugging to identify any remaining field mapping issuesPrevious Issue: usage_by_model showed observation counts correctly but all costs and tokens as zero.
Root Cause: Same metrics API field mapping issue affecting cost calculations.
Solution: Applied the same daily metrics approach used in cost analysis:
getDailyMetrics API to aggregate model costs and tokens from daily usage breakdownstotalCost, totalUsage, and countObservations from daily dataResult:
totalCost values instead of 0totalTokens values instead of 0observationCount continues to work correctlyAPI Efficiency: The server now uses native Langfuse endpoints efficiently:
Make sure these environment variables are properly set:
LANGFUSE_PUBLIC_KEY=pk-lf-xxx # Your Langfuse public key
LANGFUSE_SECRET_KEY=sk-lf-xxx # Your Langfuse secret key
LANGFUSE_BASEURL=https://us.cloud.langfuse.com # Your Langfuse instance URL
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for Langfuse MCP Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/langfuse-mcp-therealsachin)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。
尚无已审核的包 / 镜像标识,暂不展示下载统计。
Alternative and complementary servers in the same category

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.