Skip to main content

Langfuse MCP server for accessing and analyzing telemetry data via natural language

Project description

Langfuse MCP Server

PyPI 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
Selective Tool Loading Yes No

This project provides a full observability toolkit — traces, observations, sessions, exceptions, and prompts — 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 \
  --scope project \
  --env LANGFUSE_PUBLIC_KEY=pk-... \
  --env LANGFUSE_SECRET_KEY=sk-... \
  --env LANGFUSE_HOST=https://cloud.langfuse.com \
  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 (18 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
Schema get_data_schema

Skill

This project includes a skill with debugging playbooks.

Claude Code:

/plugin marketplace add avivsinai/skills-marketplace
/plugin install langfuse@avivsinai-marketplace

Codex CLI:

$skill-installer install https://github.com/avivsinai/langfuse-mcp/tree/main/skills/langfuse

Then restart Codex.

Manual install (both):

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, schema

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langfuse_mcp-0.4.2.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langfuse_mcp-0.4.2-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file langfuse_mcp-0.4.2.tar.gz.

File metadata

  • Download URL: langfuse_mcp-0.4.2.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for langfuse_mcp-0.4.2.tar.gz
Algorithm Hash digest
SHA256 6a7f22bcf3229bc8c5f6649b8faceee37bbbf6779ae1bfcd7d3bd97f8123d2d0
MD5 cc388340c039ee8cdfbf2558caade192
BLAKE2b-256 e4972fb65646259a9900f016a29fd24b645e5438afef86a5dacc2a4b6daed2cf

See more details on using hashes here.

File details

Details for the file langfuse_mcp-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: langfuse_mcp-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for langfuse_mcp-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d94bc1b68e52ffd88b42ce5889c70296484f4dffe99ca0fb3270fb1268722a34
MD5 5c64f42f1f4bb7dcc6c3c006798800c7
BLAKE2b-256 442add7baea7bec1c8e8ad54906e4e99402b24eb74a7190e5e1c418615723274

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page