freshcrate
Skin:/
Home > MCP Servers > langfuse-mcp

langfuse-mcp

A Model Context Protocol (MCP) server for Langfuse, enabling AI agents to query Langfuse trace data for enhanced debugging and observability

Why this rank:Strong adoptionRelease freshnessHealthy release cadence

Description

A Model Context Protocol (MCP) server for Langfuse, enabling AI agents to query Langfuse trace data for enhanced debugging and observability

README

Langfuse MCP Server

PyPI Downloads Python 3.10–3.13 License: MIT

Model Context Protocol server for Langfuse observability. Query traces, debug errors, analyze sessions, manage prompts.

Why langfuse-mcp?

Comparison with official Langfuse MCP (as of Jan 2026):

langfuse-mcp Official
Traces & Observations Yes No
Sessions & Users Yes No
Exception Tracking Yes No
Prompt Management Yes Yes
Dataset Management Yes No
Annotation Queues Yes No
Scores (v2) Yes No
Selective Tool Loading Yes No

This project provides a full observability toolkit — traces, observations, sessions, exceptions, prompts, datasets, annotation queues, and scores — while the official MCP focuses on prompt management.

Quick Start

Requires uv (for uvx).

Get credentials from Langfuse Cloud → Settings → API Keys. If self-hosted, use your instance URL for LANGFUSE_HOST.

# Claude Code (project-scoped, shared via .mcp.json)
claude mcp add \
  -e LANGFUSE_PUBLIC_KEY=pk-... \
  -e LANGFUSE_SECRET_KEY=sk-... \
  -e LANGFUSE_HOST=https://cloud.langfuse.com \
  --scope project \
  langfuse -- uvx --python 3.11 langfuse-mcp

# Codex CLI (user-scoped, stored in ~/.codex/config.toml)
codex mcp add langfuse \
  --env LANGFUSE_PUBLIC_KEY=pk-... \
  --env LANGFUSE_SECRET_KEY=sk-... \
  --env LANGFUSE_HOST=https://cloud.langfuse.com \
  -- uvx --python 3.11 langfuse-mcp

Restart your CLI, then verify with /mcp (Claude Code) or codex mcp list (Codex).

Tools (37 total)

Category Tools
Traces fetch_traces, fetch_trace
Observations fetch_observations, fetch_observation
Sessions fetch_sessions, get_session_details, get_user_sessions
Exceptions find_exceptions, find_exceptions_in_file, get_exception_details, get_error_count
Prompts list_prompts, get_prompt, get_prompt_unresolved, create_text_prompt, create_chat_prompt, update_prompt_labels
Datasets list_datasets, get_dataset, list_dataset_items, get_dataset_item, create_dataset, create_dataset_item, delete_dataset_item
Annotation Queues list_annotation_queues, create_annotation_queue, get_annotation_queue, list_annotation_queue_items, get_annotation_queue_item, create_annotation_queue_item, update_annotation_queue_item, delete_annotation_queue_item, create_annotation_queue_assignment, delete_annotation_queue_assignment
Scores list_scores_v2, get_score_v2
Schema get_data_schema

Dataset Item Updates (Upsert)

Langfuse uses upsert for dataset items. To edit an existing item, call create_dataset_item with item_id. If the ID exists, it updates; otherwise it creates a new item.

create_dataset_item(
  dataset_name="qa-test-cases",
  item_id="item_123",
  input={"question": "What is 2+2?"},
  expected_output={"answer": "4"}
)

Skill

This project includes a skill with debugging playbooks.

Via skills (recommended):

npx skills add avivsinai/langfuse-mcp -g -y

Via skild:

npx skild install @avivsinai/langfuse -t claude -y

Manual install:

cp -r skills/langfuse ~/.claude/skills/   # Claude Code
cp -r skills/langfuse ~/.codex/skills/    # Codex CLI

Try asking: "help me debug langfuse traces"

See skills/langfuse/SKILL.md for full documentation.

Selective Tool Loading

Load only the tool groups you need to reduce token overhead:

langfuse-mcp --tools traces,prompts

Available groups: traces, observations, sessions, exceptions, prompts, datasets, annotation_queues, scores, schema

Read-Only Mode

Disable all write operations for safer read-only access:

langfuse-mcp --read-only
# Or via environment variable
LANGFUSE_MCP_READ_ONLY=true langfuse-mcp

This disables: create_text_prompt, create_chat_prompt, update_prompt_labels, create_dataset, create_dataset_item, delete_dataset_item, create_annotation_queue, create_annotation_queue_item, update_annotation_queue_item, delete_annotation_queue_item, create_annotation_queue_assignment, delete_annotation_queue_assignment

Other Clients

Cursor

Create .cursor/mcp.json in your project (or ~/.cursor/mcp.json for global):

{
  "mcpServers": {
    "langfuse": {
      "command": "uvx",
      "args": ["--python", "3.11", "langfuse-mcp"],
      "env": {
        "LANGFUSE_PUBLIC_KEY": "pk-...",
        "LANGFUSE_SECRET_KEY": "sk-...",
        "LANGFUSE_HOST": "https://cloud.langfuse.com"
      }
    }
  }
}

Docker

docker run --rm -i \
  -e LANGFUSE_PUBLIC_KEY=pk-... \
  -e LANGFUSE_SECRET_KEY=sk-... \
  -e LANGFUSE_HOST=https://cloud.langfuse.com \
  ghcr.io/avivsinai/langfuse-mcp:latest

Development

uv venv --python 3.11 .venv && source .venv/bin/activate
uv pip install -e ".[dev]"
pytest

License

MIT

Release History

VersionChangesUrgencyDate
v0.9.1## [0.9.1] - 2026-05-06 ### Changed - Re-enabled Python 3.14 support now that the supported Langfuse SDK range includes v4, which uses Pydantic v2; CI now covers Python 3.10 through 3.14. High5/6/2026
v0.9.0## [0.9.0] - 2026-04-29 ### Changed - Allow `langfuse>=4.0.0,<5.0.0` alongside the existing `>=3.11.2,<4.0.0` range so projects can pin langfuse-mcp without blocking the v4.x SDK upgrade (closes #40). - Added a small capability-based shim (`langfuse_mcp/_compat.py`) so MCP tool calls auto-select the right SDK surface across SDK versions: - Score list/get routing now follows the `api.scores` (v4) ↔ `api.score_v_2` (v3) rename, and the v4 method rename `get` → `get_many`. Score creation tools arHigh4/29/2026
v0.7.0## [0.7.0] - 2026-04-26 ### Added - Added `--default-output-mode` and `LANGFUSE_MCP_DEFAULT_OUTPUT_MODE` so MCP tool schemas can default to `compact`, `full_json_string`, or `full_json_file` when clients omit `output_mode`. ### Fixed - Consolidated PyPI, Docker, and skill publishing into the release workflow so they no longer depend on tag-push events that `GITHUB_TOKEN` cannot trigger. - Pinned all GitHub Actions to commit SHAs across every workflow for supply-chain safety. - Added missing `peHigh4/26/2026
v0.6.5## [0.6.5] - 2026-04-02 ### Changed - Switched releases to the shared PR-based `scripts/release.sh` flow, with `CHANGELOG.md` supplying the GitHub release notes and CI creating the version tag only after the merged release commit verifies. ### Fixed - Pinned release verification and build to Python 3.12 so release automation no longer drifts onto unsupported Python 3.14 toolchains. - Ignored `dist/.gitignore` during local release artifact verification so release prep now checks the same wheel aMedium4/2/2026
v0.6.4**Full Changelog**: https://github.com/avivsinai/langfuse-mcp/compare/v0.6.3...v0.6.4Medium4/1/2026
v0.6.3**Full Changelog**: https://github.com/avivsinai/langfuse-mcp/compare/v0.6.2...v0.6.3Medium4/1/2026
v0.6.2**Full Changelog**: https://github.com/avivsinai/langfuse-mcp/compare/v0.6.1...v0.6.2Medium4/1/2026
v0.5.3## What's Changed * chore: OSS polish - templates, SECURITY.md, keywords, type checking by @avivsinai in https://github.com/avivsinai/langfuse-mcp/pull/15 **Full Changelog**: https://github.com/avivsinai/langfuse-mcp/compare/v0.5.2...v0.5.3Medium3/29/2026
v0.5.2### Fixed - **Fix `get_session_details` 500 error** (#13) — ClickHouse rejected epoch-zero (1970-01-01) as a `DateTime64(3)` filter parameter. Now omits the time filter for session/trace ID lookups. - Same fix applied to `get_exception_details` (latent bug, same pattern) - Thanks to @guys-arpeely for reporting! - **Fix operator precedence bug in exception tracking** — `obs_id` was always `None` for SDK objects (non-dict) in `_efficient_fetch_observations`, silently dropping observations frLow2/8/2026
v0.5.1### Fixed - Fixed `claude mcp add` command syntax in README (#12) - Environment variable flags (`-e`) must come before other options like `--scope` due to a CLI parser bug in Claude Code - Thanks to @BhanutejaTR for reporting! ### Technical Details When other options precede `-e`/`--env` in Claude Code's CLI, the parser incorrectly consumes the server name as an env var value. The fix moves `-e` flags to the beginning of the command.Low1/27/2026
v0.5.0## What's New ### Dataset Management Tools - `list_datasets` - List all datasets with pagination - `get_dataset` - Get dataset by name - `list_dataset_items` - List items in a dataset - `get_dataset_item` - Get a specific dataset item - `create_dataset` - Create new datasets - `upsert_dataset_item` - Create/update dataset items - `delete_dataset_item` - Remove dataset items ### Other Changes - Added `--read-only` flag for read-only mode - CI: Auto-publish skill to skild.sh on push - Docs: AdLow1/23/2026
v0.4.2## Documentation Updates ### Skill Installation - **Claude Code**: `/plugin marketplace add` + `/plugin install` commands - **Codex CLI**: `$skill-installer` with GitHub URL - Manual install fallback for both ### Client Configuration - Expanded "Other Clients" section (no longer collapsed) - Cursor: Added global config path (`~/.cursor/mcp.json`) - Docker: Unchanged **Full Changelog**: https://github.com/avivsinai/langfuse-mcp/compare/v0.4.1...v0.4.2Low1/19/2026
v0.4.1## Documentation Updates - **Claude Code**: Updated CLI syntax to latest format (options before server name) - **Codex CLI**: Clarified user-scoped config (`~/.codex/config.toml`) - Added [uv](https://docs.astral.sh/uv/) prerequisite - Added self-hosted `LANGFUSE_HOST` note - Complete tools table (all 18 tools) - Dated comparison table "as of Jan 2026" **Full Changelog**: https://github.com/avivsinai/langfuse-mcp/compare/v0.4.0...v0.4.1Low1/19/2026
v0.4.0## What's New ### Langfuse Skill for Claude Code & Codex CLI This release adds a skill that teaches Claude how to use Langfuse MCP tools effectively. The skill provides: - **Playbook-driven workflows**: "Where are errors?", "Why is it slow?", "What happened?" - **Quick reference**: One-liners for common tasks - **Setup instructions**: CLI commands for both Claude Code and Codex CLI - **Troubleshooting guide**: Auth errors, Python version issues, timeouts ### Installation The skill is automaLow1/19/2026
v0.3.4## Changed - Added prominent warning in README Quick Start for Python 3.14 users with workaround (`uvx --python 3.11`) ## Fixed - Aligned CI Python matrix with supported versions (3.10–3.13). - Restored an early Python 3.14 runtime guard and made Langfuse `timeout` param optional based on SDK support. - Made integration test teardown tolerant of connection-closed cleanup without hiding real errors.Low1/13/2026
v0.3.3### Fixed - **Python 3.14 incompatibility**: Blocked Python 3.14 in `requires-python` constraint. The Langfuse SDK uses Pydantic v1 internally which [doesn't support Python 3.14](https://github.com/langfuse/langfuse/issues/9618). Will re-enable once Langfuse migrates to Pydantic v2. ### Note If you're on Python 3.14, please use Python 3.10-3.13 until the upstream Langfuse SDK adds Python 3.14 support.Low1/13/2026
v0.3.2### Fixed - **Timeout configuration**: The Langfuse SDK defaults to an aggressive 5-second timeout which caused `ReadTimeout` errors when Langfuse cloud experiences latency. The MCP server now defaults to **30 seconds** and supports `--timeout` CLI flag and `LANGFUSE_TIMEOUT` environment variable for customization.Low1/13/2026
v0.3.1## What's Changed ### Python 3.14 Support - Removed Python 3.14 runtime block - Updated `requires-python` to `>=3.10,<4.0` - Added Python 3.14 to CI test matrix ### Documentation Overhaul - Added comparison table vs official Langfuse MCP - Added MCP client configs for Claude Code, Codex CLI, Cursor, Claude Desktop - Added `AGENTS.md` (cross-tool standard) with `CLAUDE.md` symlink - Updated Python badge to 3.10-3.14 ### CI Improvements - Simplified CI to v3-only (removed v2 matrix) - Fixed asyLow1/7/2026
v0.3.0### Added - **Prompt management tools** - get, list, create, and update Langfuse prompts: - `get_prompt`, `get_prompt_unresolved`, `list_prompts` - `create_text_prompt`, `create_chat_prompt`, `update_prompt_labels` - **Selective tool loading** via `--tools` flag or `LANGFUSE_MCP_TOOLS` env var - Load only needed tool groups (traces, observations, sessions, exceptions, prompts, schema) - Reduces token overhead when full toolset not required - Unit tests covering new prompt tools ### ChanLow1/6/2026
v0.2.1### Fixed - Added guardrails to prevent running on Python 3.14+, documenting that the current Langfuse SDK dependency only supports Python 3.10–3.13 and updating packaging metadata so uvx langfuse-mcp resolves a compatible interpreter automatically.Low10/20/2025
v0.2.0## 🚀 Major Update: Langfuse v3 Migration ### Breaking Changes - Migrated to Langfuse SDK v3.x (requires `langfuse>=3.0.0`) - Tool responses now use envelope format `{"data": ..., "metadata": {...}}` - Dropped Langfuse v2 SDK support ### New Features - đŸŗ Docker support with Dockerfile for containerized deployments - 🔐 Environment variable support for credentials via `.env` files - 📊 Enhanced logging configuration with `--log-level` and `--log-to-console` flags - 📄 Pagination metadata in Low10/2/2025
v0.1.8 ## đŸŽ¯ What's New in v0.1.8 Building on v0.1.7's Langfuse v2 pinning, this release adds comprehensive testing and CI improvements: ### ✅ Added - **Comprehensive test suite** with 10 tests covering all functionality - **Enhanced CI workflow** with improved logging and verbose output - **Complete documentation** with proper docstrings for all test files - **Regression testing** across Python 3.10/3.12 and Langfuse v2/v3 ### 🔧 Improved - **GitHub Low6/5/2025
v0.1.7 ## What's Changed - Pin Langfuse dependency to stable v2 branch (`>=2.60,<3.0.0`) - Add comprehensive test suite with 10 tests covering all functionality - Enhanced CI matrix to test both Langfuse v2 and v3 configurations - Improved repository management (removed uv.lock from tracking) - Updated documentation and changelog ## Breaking Changes None - this is a maintenance release ensuring compatibility ## Installation ```bash uv add langfuse-mcLow6/5/2025

Dependencies & License Audit

Loading dependencies...

Similar Packages

claude-code-plugins-plus-skills423 plugins, 2,849 skills, 177 agents for Claude Code. Open-source marketplace at tonsofskills.com with the ccpi CLI package manager.v4.33.0
doryOne memory layer for every AI agent. Local-first, markdown source of truth, and CLI/HTTP/MCP native. Your agent forgot who you are. Again. Dory fixes that.main@2026-05-24
claude-code-configClaude Code skills, architectural principles, and alternative approaches for AI-assisted developmentmain@2026-06-06
altk-evolveSelf improving agents through iterationsv1.1.3
lad_mcp_serverLad MCP Server: Autonomous code & system design review for AI coding agents (Claude Code, Cursor, Codex, etc.). Features multi-model consensus via OpenRouter and context-aware reviews via Serena.main@2026-05-27

More in MCP Servers

PlanExeCreate a plan from a description in minutes
automagik-genieSelf-evolving AI agent orchestration framework with Model Context Protocol support
agentroveYour own Claude Code UI, sandbox, in-browser VS Code, terminal, multi-provider support (Anthropic, OpenAI, GitHub Copilot, OpenRouter), custom skills, and MCP servers.
ProxmoxMCP-PlusEnhanced Proxmox MCP server with advanced virtualization management and full OpenAPI integration.