mcpField
L
langfuse

langfuse

Local
github.com/pulsemcpData & Analytics81Updated 8w ago

About langfuse

langfuse is a read-only MCP server for inspecting Langfuse traces and observations. It supports filtering and detailed analysis of nested trace data, including model usage, costs, and latency; large fields are saved to temporary files with searchable references.

Key features

  1. 01Filter traces by metadata
  2. 02Inspect nested traces and scores
  3. 03Filter observations by type and model
  4. 04Retrieve observation inputs and outputs
  5. 05Save oversized fields to temporary files
  6. 06Read-only access

Use cases

  1. 01Debug LLM pipelines using trace details
  2. 02Analyze model costs and latency
  3. 03Search large prompts and completions

MCP support

It exposes tools for listing and inspecting Langfuse traces and observations, plus a `langfuse://config` resource. MCP clients can use the read-only interface to analyze trace data.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"com-pulsemcp-langfuse": {
"command": "npx",
"args": [
"-y",
"langfuse-observability-mcp-server"
],
"env": {
"LANGFUSE_SECRET_KEY": "<LANGFUSE_SECRET_KEY>",
"LANGFUSE_PUBLIC_KEY": "<LANGFUSE_PUBLIC_KEY>",
"LANGFUSE_BASE_URL": "<LANGFUSE_BASE_URL>"
}
}
}
}
Run commandnpx -y langfuse-observability-mcp-server
Environment variables to set
LANGFUSE_SECRET_KEYSecretLangfuse secret key for authentication.
LANGFUSE_PUBLIC_KEYSecretLangfuse public key for authentication.
LANGFUSE_BASE_URLLangfuse API base URL.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmlangfuse-observability-mcp-server0.1.3

Tools

4

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
namestringNoFilter by trace name (exact match).
pagenumberNoPage number (starts at 1). Default: 1.
tagsarrayNoFilter to traces containing ALL specified tags. Example: ["production", "important"].
limitnumberNoNumber of traces per page (1-100). Default: 10. Use smaller values to reduce response size.
userIdstringNoFilter by user ID associated with traces.
orderBystringNoSort order as "field.direction". Fields: id, timestamp, name, userId, release, version, public, bookmarked, sessionId. Direction: asc, desc. Example: "timestamp.desc".
releasestringNoFilter by release version string.
versionstringNoFilter by trace version string.
sessionIdstringNoFilter by session ID.
environmentarrayNoFilter by environment(s). Example: ["production", "staging"].
toTimestampstringNoOnly include traces created before this ISO 8601 datetime. Example: "2025-02-01T00:00:00Z".
fromTimestampstringNoOnly include traces created on or after this ISO 8601 datetime. Example: "2025-01-01T00:00:00Z".

Details

From the project README

Langfuse 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
ToolDescription
get_tracesList traces with filtering and pagination. Returns minimal summary (no I/O fields).
get_trace_detailGet full trace by ID including observations, scores, input/output, and metadata.
get_observationsList observations with filtering by traceId, type, level, etc. Returns minimal summary.
get_observationGet full observation by ID including input, output, model parameters, usage, and cost details.
Resources
ResourceDescription
langfuse://configServer 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:

  1. Truncates any string field longer than 1000 characters
  2. Saves the full content to a /tmp/langfuse_*.txt file
  3. 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
VariableRequiredDescriptionDefault
LANGFUSE_SECRET_KEYYesLangfuse secret key (sk-lf-...)-
LANGFUSE_PUBLIC_KEYYesLangfuse public key (pk-lf-...)-
LANGFUSE_BASE_URLNoLangfuse API base URLhttps://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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.