Langfuse MCP — Claude Code MCP server: what it does, how to install
Connects Langfuse telemetry to coding assistants to inspect traces, user sessions, and runtime errors. Useful for debugging AI workflows from your terminal.
claude mcp add --env LANGFUSE_PUBLIC_KEY=<LANGFUSE_PUBLIC_KEY> --env LANGFUSE_SECRET_KEY=<LANGFUSE_SECRET_KEY> --env LANGFUSE_HOST=<LANGFUSE_HOST> --env LANGFUSE_MCP_READ_ONLY=<LANGFUSE_MCP_READ_ONLY> --transport stdio langfuse-mcp -- uvx langfuse-mcpWhat Langfuse MCP does
The server supplies 48 tools focused on reading traces, observations, user sessions, and routing decisions. It aims at local troubleshooting rather than broad API coverage. Unlike the hosted official server, it includes route-decision analysis and compact output modes. It cannot write scores or manage comments.
Error tracking inspects observation entries with a strict level == "ERROR" filter. A text message alone will not trigger it. Results group failures by file or category, returning up to 50 groups alongside representative trace IDs.
Running this tool requires uvx and Python between 3.10 and 3.14. You must pass valid API credentials via LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY on startup.
What it helps with
- locate recent errors in execution traces grouped by file
- inspect slow user sessions and identify high latency points
- review low-confidence model routing decisions
- pull prompt definitions and dataset run items into the workspace
Example prompts for the agent
- find exceptions in the last day
- fetch trace details for this trace ID and include observations
- why was this user session slow?
How to install Langfuse MCP
Platform CLI
claude mcp add --env LANGFUSE_PUBLIC_KEY=<LANGFUSE_PUBLIC_KEY> --env LANGFUSE_SECRET_KEY=<LANGFUSE_SECRET_KEY> --env LANGFUSE_HOST=<LANGFUSE_HOST> --env LANGFUSE_MCP_READ_ONLY=<LANGFUSE_MCP_READ_ONLY> --transport stdio langfuse-mcp -- uvx langfuse-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from langfuse-mcp <command>
Platform CLI
codex mcp add langfuse-mcp --env LANGFUSE_PUBLIC_KEY=<LANGFUSE_PUBLIC_KEY> --env LANGFUSE_SECRET_KEY=<LANGFUSE_SECRET_KEY> --env LANGFUSE_HOST=<LANGFUSE_HOST> --env LANGFUSE_MCP_READ_ONLY=<LANGFUSE_MCP_READ_ONLY> -- uvx langfuse-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from langfuse-mcp <command>
Config file
{
"mcpServers": {
"langfuse-mcp": {
"command": "uvx",
"args": [
"langfuse-mcp"
],
"env": {
"LANGFUSE_PUBLIC_KEY": "<LANGFUSE_PUBLIC_KEY>",
"LANGFUSE_SECRET_KEY": "<LANGFUSE_SECRET_KEY>",
"LANGFUSE_HOST": "<LANGFUSE_HOST>",
"LANGFUSE_MCP_READ_ONLY": "<LANGFUSE_MCP_READ_ONLY>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from langfuse-mcp <command>
Config file
{
"servers": {
"langfuse-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"langfuse-mcp"
],
"env": {
"LANGFUSE_PUBLIC_KEY": "<LANGFUSE_PUBLIC_KEY>",
"LANGFUSE_SECRET_KEY": "<LANGFUSE_SECRET_KEY>",
"LANGFUSE_HOST": "<LANGFUSE_HOST>",
"LANGFUSE_MCP_READ_ONLY": "<LANGFUSE_MCP_READ_ONLY>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from langfuse-mcp <command>
Platform CLI
gemini mcp add -e LANGFUSE_PUBLIC_KEY=<LANGFUSE_PUBLIC_KEY> -e LANGFUSE_SECRET_KEY=<LANGFUSE_SECRET_KEY> -e LANGFUSE_HOST=<LANGFUSE_HOST> -e LANGFUSE_MCP_READ_ONLY=<LANGFUSE_MCP_READ_ONLY> langfuse-mcp uvx langfuse-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from langfuse-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Langfuse MCP
How to install Langfuse MCP in Claude Code?
Run claude mcp add langfuse-mcp -e LANGFUSE_PUBLIC_KEY=<LANGFUSE_PUBLIC_KEY> -e LANGFUSE_SECRET_KEY=<LANGFUSE_SECRET_KEY> -- uvx langfuse-mcp with your project credentials. Restart your CLI session and run /mcp to confirm the connection.
What does Langfuse MCP do?
It exposes 48 tools for exploring Langfuse traces, sessions, errors, and routing choices through local MCP clients. It allows your assistant to query telemetry without opening the web dashboard.
How does it differ from the official hosted Langfuse MCP?
This local server focuses on debugging execution traces, sessions, and route decisions via stdio. It does not support score writing or comments, which require the official hosted endpoint.