Read-only analysis of Langfuse LLM traces and observations lets agents inspect trace data, debug LLM pipelines, and analyze costs and latency.
Also known as pulsemcp/mcp-servers, langfuse-observability-mcp-server
- Stars
- 81
- Tools
- 4
- Downloads, 30 days
- 788
- Latest version
- 0.1.3
- Last commit
- Oct 9, 2026
- License
- MIT
What is Langfuse MCP?
Langfuse is an MCP server. Read-only analysis of Langfuse LLM traces and observations lets agents inspect trace data, debug LLM pipelines, and analyze costs and latency. It exposes 4 tools, such as get_traces, get_trace_detail, get_observations.
Summary generated from the project's README
About Langfuse MCP server
Analyzing LLM traces and observing model performance from within an AI agent is what this server enables. Developers use it to inspect trace data, debug complex pipelines, and evaluate costs and latency. It operates in a read-only mode, ensuring that agents can examine data without any risk of modifying existing records.
To set up the connection, you must provide a LANGFUSE_PUBLIC_KEY and a LANGFUSE_SECRET_KEY via environment variables. You can also specify a custom LANGFUSE_BASE_URL if you are not using the default cloud instance. The server provides specific tools like get_traces, get_trace_detail, get_observations, and get_observation to navigate through different levels of data.
A unique feature of this implementation is how it handles large payloads. When a string field exceeds 1000 characters, the server automatically truncates the text and saves the full content to a file in the /tmp directory. This allows an agent to use grep to find specific content within large prompts or completions without overwhelming the context window.
What you can do with it
- 1Debug LLM pipelinesAsk an agent to find the specific cause of a failure by inspecting nested observations and scores within a trace.
- 2Analyze model costsRequest a summary of the usage and cost details for a specific observation to understand spending.
- 3Filter trace historyInstruct an agent to list all traces associated with a specific user or session tag.
- 4Inspect large prompt dataHave an agent search through a massive prompt that has been moved to a local temporary file.
Written from the project's README. Every use case is checked against a quote from it.
How to install Langfuse MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall Langfuse MCP in Claude Code
$ claude mcp add --env 'LANGFUSE_PUBLIC_KEY=<YOUR_LANGFUSE_PUBLIC_KEY>' --env 'LANGFUSE_SECRET_KEY=<YOUR_LANGFUSE_SECRET_KEY>' langfuse -- npx -y langfuse-observability-mcp-serverInstall Langfuse MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"langfuse": {
"command": "npx",
"args": [
"-y",
"langfuse-observability-mcp-server"
],
"env": {
"LANGFUSE_PUBLIC_KEY": "<YOUR_LANGFUSE_PUBLIC_KEY>",
"LANGFUSE_SECRET_KEY": "<YOUR_LANGFUSE_SECRET_KEY>"
}
}
}
}Install Langfuse MCP in VS Code
.vscode/mcp.json
{
"servers": {
"langfuse": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"langfuse-observability-mcp-server"
],
"env": {
"LANGFUSE_PUBLIC_KEY": "<YOUR_LANGFUSE_PUBLIC_KEY>",
"LANGFUSE_SECRET_KEY": "<YOUR_LANGFUSE_SECRET_KEY>"
}
}
}
}Install Langfuse MCP in VS Code CLI
$ code --add-mcp '{"name":"langfuse","type":"stdio","command":"npx","args":["-y","langfuse-observability-mcp-server"],"env":{"LANGFUSE_PUBLIC_KEY":"<YOUR_LANGFUSE_PUBLIC_KEY>","LANGFUSE_SECRET_KEY":"<YOUR_LANGFUSE_SECRET_KEY>"}}'Install Langfuse MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"langfuse": {
"command": "npx",
"args": [
"-y",
"langfuse-observability-mcp-server"
],
"env": {
"LANGFUSE_PUBLIC_KEY": "<YOUR_LANGFUSE_PUBLIC_KEY>",
"LANGFUSE_SECRET_KEY": "<YOUR_LANGFUSE_SECRET_KEY>"
}
}
}
}Install Langfuse MCP in Codex
$ codex mcp add langfuse --env 'LANGFUSE_PUBLIC_KEY=<YOUR_LANGFUSE_PUBLIC_KEY>' --env 'LANGFUSE_SECRET_KEY=<YOUR_LANGFUSE_SECRET_KEY>' -- npx -y langfuse-observability-mcp-serverInstall Langfuse MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.langfuse] command = "npx" args = ["-y", "langfuse-observability-mcp-server"] [mcp_servers.langfuse.env] LANGFUSE_PUBLIC_KEY = "<YOUR_LANGFUSE_PUBLIC_KEY>" LANGFUSE_SECRET_KEY = "<YOUR_LANGFUSE_SECRET_KEY>"
Install Langfuse MCP in Gemini CLI
$ gemini mcp add -s user -e 'LANGFUSE_PUBLIC_KEY=<YOUR_LANGFUSE_PUBLIC_KEY>' -e 'LANGFUSE_SECRET_KEY=<YOUR_LANGFUSE_SECRET_KEY>' langfuse npx -- -y langfuse-observability-mcp-serverInstall Langfuse MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"langfuse": {
"command": "npx",
"args": [
"-y",
"langfuse-observability-mcp-server"
],
"env": {
"LANGFUSE_PUBLIC_KEY": "<YOUR_LANGFUSE_PUBLIC_KEY>",
"LANGFUSE_SECRET_KEY": "<YOUR_LANGFUSE_SECRET_KEY>"
}
}
}
}Needs a key before it starts
Started on 16 Nov 2026 with no keys, it stopped and asked for one, so a client sees no tools until you set the variables above.
Langfuse MCP tools 4
Detected from the READMEget_tracesget_trace_detailget_observationsget_observation
Configuration
LANGFUSE_PUBLIC_KEYRequiredSecretLangfuse public key for authentication.
LANGFUSE_SECRET_KEYRequiredSecretLangfuse secret key for authentication.
LANGFUSE_BASE_URLLangfuse API base URL.
Automated checks
Ran Nov 12, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablePass
- Open source license (OSI)Pass
- Commit or release in the last yearPass
- Package name not close to a popular packagePass
- Remote endpoint uses HTTPSNot checked
- Destructive tools are labelledPass
- No hidden instructions to the modelPass
- No critical advisory in the package or its dependenciesPass
README
View on GitHubLangfuse MCP Server
MCP server for readonly analysis of Langfuse LLM traces and observations. Designed to help agents deeply inspect trace data, debug LLM pipelines, and analyze costs and latency.
Highlights
- Browse and filter traces by name, user, session, tags, timestamps, and environment
- Drill into full trace details including all nested observations and scores
- List and filter observations by type (GENERATION, SPAN, EVENT), model, level, and more
- Automatic truncation of large payloads (>1000 chars) to /tmp files with grep-friendly references
- Read-only — no write operations, safe to use without risk of data modification
Capabilities
Tools
| Tool | Description |
|---|---|
get_traces |
List traces with filtering and pagination. Returns minimal summary (no I/O fields). |
get_trace_detail |
Get full trace by ID including observations, scores, input/output, and metadata. |
get_observations |
List observations with filtering by traceId, type, level, etc. Returns minimal summary. |
get_observation |
Get full observation by ID including input, output, model parameters, usage, and cost details. |
Resources
| Resource | Description |
|---|---|
langfuse://config |
Server configuration and status (for debugging) |
Large Payload Handling
Trace and observation data often contains very large input/output fields (full prompts, completions, etc.). This server automatically:
- Truncates any string field longer than 1000 characters
- Saves the full content to a
/tmp/langfuse_*.txtfile - Includes the file path in the truncated output
Agents can then use grep to search within these files for specific content without loading the entire payload into context.
Configuration
Environment Variables
| Variable | Required | Description | Default |
|---|---|---|---|
LANGFUSE_SECRET_KEY |
Yes | Langfuse secret key (sk-lf-...) | - |
LANGFUSE_PUBLIC_KEY |
Yes | Langfuse public key (pk-lf-...) | - |
LANGFUSE_BASE_URL |
No | Langfuse API base URL | https://cloud.langfuse.com |
Claude Desktop Configuration
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"langfuse": {
"command": "npx",
"args": ["-y", "langfuse-observability-mcp-server"],
"env": {
"LANGFUSE_SECRET_KEY": "sk-lf-your-secret-key",
"LANGFUSE_PUBLIC_KEY": "pk-lf-your-public-key",
"LANGFUSE_BASE_URL": "https://us.cloud.langfuse.com"
}
}
}
}
Development
# Install dependencies
npm run install-all
# Build
npm run build
# Development mode
npm run dev
# Run functional tests
npm test
# Run integration tests
npm run test:integration
# Run manual tests (requires .env with real credentials)
npm run test:manual
License
MIT
Langfuse MCP questions
How do I add Langfuse MCP to Claude Code?
Run claude mcp add --env 'LANGFUSE_PUBLIC_KEY=<YOUR_LANGFUSE_PUBLIC_KEY>' --env 'LANGFUSE_SECRET_KEY=<YOUR_LANGFUSE_SECRET_KEY>' langfuse -- npx -y langfuse-observability-mcp-server in your terminal. Add --scope user to make it available in every project.
How do I add Langfuse MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What tools does Langfuse MCP provide?
It exposes 4 tools, including get_traces, get_trace_detail, get_observations, get_observation.
What tools does the Langfuse MCP server expose?
It exposes get_traces, get_trace_detail, get_observations, and get_observation for listing and inspecting traces and observations.
Does the Langfuse MCP server modify any data?
No, it is read-only and performs no write operations, so it is safe to use without risk of data modification.
How does the server handle very large trace payloads?
Any string field longer than 1000 characters is truncated, with the full content saved to a /tmp/langfuse_*.txt file and the path included so agents can grep it.