← Back to Langfuse MCP

Install Langfuse MCP

Pick your client, copy the command, done.

1

Add it to Claude Code

claude mcp add -e "LANGFUSE_PUBLIC_KEY=${LANGFUSE_PUBLIC_KEY}" -e "LANGFUSE_SECRET_KEY=${LANGFUSE_SECRET_KEY}" -e "LANGFUSE_HOST=${LANGFUSE_HOST}" langfuse-mcp -- uvx --python 3.11 langfuse-mcp
Required:LANGFUSE_PUBLIC_KEYLANGFUSE_SECRET_KEYLANGFUSE_HOST+ 1 optional

Environment Variables

Set these before running Langfuse MCP.

VariableDescriptionRequired
LANGFUSE_PUBLIC_KEYPublic API key for Langfuse authentication.Yes
LANGFUSE_SECRET_KEYSecret API key for Langfuse authentication.Yes
LANGFUSE_HOSTThe URL of your Langfuse instance.Yes
LANGFUSE_MCP_READ_ONLYSet to true to disable all write operations.No

Available Tools (5)

Once configured, Langfuse MCP gives your AI agent access to:

fetch_tracesRetrieve a list of traces from Langfuse.
limitpage
fetch_traceGet detailed information for a specific trace.
trace_id
find_exceptionsSearch for exceptions within Langfuse logs.
query
list_promptsList all available prompts in the Langfuse project.
create_dataset_itemCreate or update an item within a dataset.
dataset_nameitem_idinputexpected_output

Try It Out

After setup, try these prompts with your AI agent:

Fetch the latest traces and identify any recent exceptions.
List all prompts currently managed in Langfuse.
Get details for the session with ID 'session_123'.
Create a new dataset item in the 'qa-test-cases' dataset with the provided input and expected output.
Help me debug the latest errors found in my LLM application traces.
Prerequisites & system requirements
  • An MCP-compatible client (Claude Code, Cursor, Windsurf, Claude Desktop, or Codex)
  • Python 3.8+ with pip installed
  • Docker installed and running
  • LANGFUSE_PUBLIC_KEY — Public API key for Langfuse authentication.
  • LANGFUSE_SECRET_KEY — Secret API key for Langfuse authentication.
  • LANGFUSE_HOST — The URL of your Langfuse instance.
Alternative installation methods

Docker

docker run --rm -i -e LANGFUSE_PUBLIC_KEY=... -e LANGFUSE_SECRET_KEY=... -e LANGFUSE_HOST=... ghcr.io/avivsinai/langfuse-mcp:latest

Keep this setup from going cold

Save the docs, env vars, and workflow around Langfuse MCP in Conare so Claude Code, Codex, and Cursor remember it next time.

Remember this setup