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-mcpRequired:
LANGFUSE_PUBLIC_KEYLANGFUSE_SECRET_KEYLANGFUSE_HOST+ 1 optionalEnvironment Variables
Set these before running Langfuse MCP.
VariableDescriptionRequired
LANGFUSE_PUBLIC_KEYPublic API key for Langfuse authentication.YesLANGFUSE_SECRET_KEYSecret API key for Langfuse authentication.YesLANGFUSE_HOSTThe URL of your Langfuse instance.YesLANGFUSE_MCP_READ_ONLYSet to true to disable all write operations.NoAvailable Tools (5)
Once configured, Langfuse MCP gives your AI agent access to:
fetch_tracesRetrieve a list of traces from Langfuse.limitpagefetch_traceGet detailed information for a specific trace.trace_idfind_exceptionsSearch for exceptions within Langfuse logs.querylist_promptsList all available prompts in the Langfuse project.create_dataset_itemCreate or update an item within a dataset.dataset_nameitem_idinputexpected_outputTry 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:latestKeep 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.