Langfuse MCP Java logo

Langfuse MCP Java

by log-logn

Connects MCP clients to Langfuse for trace analysis, prompt management, dataset evaluation, scores, and observability administration.

Install Langfuse MCP Java

Run the project’s own setup commands, in order.

Setup steps from the project

log-logn/langfuse-mcp-java installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    mvn clean package -DskipTests
    
  2. 2. Start the server
    java -jar target/langfuse-mcp-1.0.0.jar
    
  3. 3. Install
    docker build -t langfuse-mcp:latest .
    
  4. 4. Start the server
    docker run --rm -p 8080:8080 \
      -e LANGFUSE_PUBLIC_KEY=pk-lf-... \
      -e LANGFUSE_SECRET_KEY=sk-lf-... \
      -e LANGFUSE_HOST=https://cloud.langfuse.com \
      langfuse-mcp:latest
    
  5. 5. Configure
    -e LANGFUSE_HOST=http://host.docker.internal:3000
    

Overview

The log-logn/langfuse-mcp-java MCP server exposes Langfuse observability and evaluation operations through MCP tools. It runs as a Java 21 Spring Boot application using Streamable HTTP on port 8080, with Langfuse credentials supplied through environment variables. Use it to inspect traces, exceptions, sessions, prompts, datasets, runs, scores, costs, and related project data from a compatible client. It also includes destructive write operations, so clients should handle deletion tools carefully.

Use cases

  • Investigate error-level Langfuse traces by time range or file metadata
  • Inspect sessions, nested observations, latency, and token usage
  • Manage prompt versions and environment labels
  • Create evaluation datasets and link runs to traces
  • Query Langfuse cost and usage metrics

Key features

  • Paginated trace, session, dataset, and score queries
  • Exception discovery and detailed error inspection
  • Prompt creation, version retrieval, deletion, and labeling
  • Dataset and experiment run management
  • Cost, token, latency, and usage metrics
  • Streamable HTTP MCP endpoint

Tools55

What Langfuse MCP Java lets your agent do. Expand a tool for its parameters.

Self-reported~1.4k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

24/24 checks healthy over the last 109d

Supply-chain signal

2 high-severity advisories on record for this package. Most advisories affect transitive dependencies and may not be exploitable in this server's actual usage — this is a directional signal, not a security audit.

Critical 1High 1Medium 0Low 0

Scanned 8/23/2026 via OSV.dev

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars3Stargazers on the source repository.
Last commit8mo agoMost recent push to the default branch.
Tools exposed55Callable tools this server registers over MCP.
Directory activity6 viewsConfig copies, upvotes, and views on AllMCPs.

How Langfuse MCP Java works

What log-logn/langfuse-mcp-java MCP server does

The log-logn/langfuse-mcp-java MCP server connects an MCP-compatible agent to a Langfuse project. Its tools cover trace and observation inspection, exception investigation, session browsing, prompt lifecycle management, evaluation datasets, dataset runs, scores, cost metrics, and other Langfuse project resources described by the API.

Trace tools support paginated filtering by user, trace name, session, tags, and time range. An agent can retrieve complete trace details, including nested observations, inputs and outputs, metadata, latency, and token usage. Error-focused tools find traces at the ERROR level, locate errors using file-name metadata, retrieve exception details, and count errors within a time range.

The server also exposes write operations. Agents can create prompt versions, change prompt labels, create datasets and items, link run items to traces or observations, and delete traces, prompts, dataset items, or dataset runs. Deletion operations are irreversible.

How it works

The application is built with Java 21, Spring Boot, and Spring AI. It serves the MCP endpoint at /mcp over Streamable HTTP on port 8080. Health information is available at /actuator/health, and /ping provides a simple ping endpoint.

The log-logn/langfuse-mcp-java MCP server forwards authenticated requests to the configured Langfuse host. List operations use one-based pagination; the documented default page is 1 and the default limit is 20, with limits capped at 100 where specified. Responses use an ApiResponse envelope, while paginated results include item data and page metadata.

Setup and configuration

Build the project with Maven 3.9 or later using mvn clean package -DskipTests, then start the generated Spring Boot JAR with Java. Docker can build the application without a local Maven installation and expose port 8080.

Set these required environment variables before starting the server:

  • LANGFUSE_PUBLIC_KEY: the Langfuse project public key.
  • LANGFUSE_SECRET_KEY: the Langfuse project secret key.
  • LANGFUSE_HOST: the Langfuse base URL, such as the Langfuse Cloud URL or a self-hosted instance.

LANGFUSE_TIMEOUT is optional and accepts Spring Duration values such as 30s or 1m; its documented default is 30 seconds. The host may include a trailing slash because the application normalizes it.

Configure clients with http://localhost:8080/mcp. The README provides configurations for Cursor and Claude Desktop, as well as URL and command modes for VS Code or GitHub Copilot.

Tools and capabilities

The log-logn/langfuse-mcp-java MCP server includes tools for:

  • Browsing traces, observations, sessions, users, and exceptions.
  • Reading, creating, deleting, and labeling prompt versions.
  • Managing datasets, dataset items, experiment runs, and run items.
  • Querying scores, score configurations, cost metrics, token usage, latency, and related analytics.
  • Inspecting project, schema, model, connection, annotation, comment, and evaluation resources where supported by the exposed tools.

Prompt tools support both plain text prompts and chat prompts represented as JSON message arrays. Dataset creation accepts optional descriptions, metadata, input schemas, and expected-output schemas as JSON strings.

Limitations and notes

The server requires a Langfuse account or self-hosted Langfuse instance with an API key pair. It is an HTTP-transport server; the documented MCP endpoint is /mcp, and the legacy /sse endpoint is not used. Some operations require identifiers such as traceId, sessionId, datasetName, runName, or userId. Error counting scans up to 500 traces. Deletion tools permanently remove data and should not be invoked without confirmation.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Langfuse MCP Java

Build it with Maven using `mvn clean package -DskipTests`, then run the generated Spring Boot JAR with Java. Docker can build and run it instead.

Set `LANGFUSE_PUBLIC_KEY`, `LANGFUSE_SECRET_KEY`, and `LANGFUSE_HOST`. `LANGFUSE_TIMEOUT` is optional.

Yes.

It can list and inspect traces, filter them by several fields, find error-level traces, inspect exception details, count errors, and permanently delete traces.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewLangfuse MCP Java AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/log-logn-langfuse-mcp-java?style=directory)](https://allmcps.com/mcp/log-logn-langfuse-mcp-java)
HTML Embed
<a href="https://allmcps.com/mcp/log-logn-langfuse-mcp-java"><img src="https://allmcps.com/api/badge/log-logn-langfuse-mcp-java?style=directory" alt="Langfuse MCP Java on AllMCPs" /></a>