Langfuse MCP Java MCP Server

A production-grade MCP server that connects any MCP-compatible AI agent to your Langfuse observability data. Query traces, debug errors, inspect

Remote serverstreamable-httpPython

What is the Langfuse MCP Java MCP server?

Langfuse MCP Java MCP server is a hosted integration for AI assistants that speak the Model Context Protocol. A production-grade MCP server that connects any MCP-compatible AI agent to your Langfuse observability data. Query traces, debug errors, inspect sessions, manage prompts, run evaluations, annotate data, and configure models — all through.

What the assistant can call

Once Langfuse MCP Java is connected, these are the calls the assistant has available:

  • fetch_traces — Paginated list of traces. Filter by userId, name, sessionId, tags, fromTimestamp, toTimestamp
  • fetch_trace — Full detail of a single trace including nested observations, input/output, metadata, latency, and token usage. Requires traceId
  • find_exceptions — Traces whose level equals ERROR. Supports time range and pagination
  • find_exceptions_in_file — Error-level traces whose metadata contains a given file name substring. Requires fileName
  • get_exception_details — Full detail of a single error trace. Requires traceId
  • get_error_count — Count of ERROR-level traces in a time range (scans up to 500 traces)
  • delete_trace — Permanently deletes a single trace by ID. Irreversible.
  • delete_traces — Permanently deletes multiple traces. Pass a comma-separated list of trace IDs. Irreversible.
  • fetch_sessions — Paginated list of sessions with optional time range filter
  • get_session_details — Full session detail including all its traces. Requires sessionId
  • get_user_sessions — All sessions for a specific user with pagination. Requires userId
  • list_prompts — Paginated list of all prompts in the project

Configuration and credentials

You will need 4 environment variables: LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_HOST, LANGFUSE_TIMEOUT. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • Java 21 or later - Maven 3.9+ (or use the Docker build — no local Maven required) - A Langfuse account with an API key pair (public-key + secret-key) ---

Setting it up

Being a remote server, there is no local install. You register the endpoint with your client, authorise it once, and the tools appear.

Choosing this one

Among the monitoring and observability options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Langfuse MCP Java's toolset — fetch_traces, fetch_trace, find_exceptions and 11 more — is a fair guide to whether it matches your workflow. It is maintained by log-logn; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Before you rely on it

  • Your data travels to the provider's service, so the usual questions apply about what you send and what they retain.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Langfuse MCP Java.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the langfuse mcp java mcp server does with a few real requests.

Available tools

ToolWhat it does
fetch_tracesPaginated list of traces. Filter by userId, name, sessionId, tags, fromTimestamp, toTimestamp.
fetch_traceFull detail of a single trace including nested observations, input/output, metadata, latency, and token usage. Requires traceId.
find_exceptionsTraces whose level equals ERROR. Supports time range and pagination.
find_exceptions_in_fileError-level traces whose metadata contains a given file name substring. Requires fileName.
get_exception_detailsFull detail of a single error trace. Requires traceId.
get_error_countCount of ERROR-level traces in a time range (scans up to 500 traces).
delete_tracePermanently deletes a single trace by ID. **Irreversible.**
delete_tracesPermanently deletes multiple traces. Pass a comma-separated list of trace IDs. **Irreversible.**
fetch_sessionsPaginated list of sessions with optional time range filter.
get_session_detailsFull session detail including all its traces. Requires sessionId.
get_user_sessionsAll sessions for a specific user with pagination. Requires userId.
list_promptsPaginated list of all prompts in the project.
get_promptFetch a prompt by name. Optionally pin to a version number or a label (e.g. production, staging).
create_promptCreate a new prompt or append a new version to an existing prompt. type is text (plain string) or chat (JSON array of {role, content} messages). Supports comma-separated labels and tags.

How to install the Langfuse MCP Java MCP server

{
  "mcpServers": {
    "langfuse-mcp-java": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/inspector"],
      "env": {
        "LANGFUSE_PUBLIC_KEY": "your-value",
        "LANGFUSE_SECRET_KEY": "your-value",
        "LANGFUSE_HOST": "your-value",
        "LANGFUSE_TIMEOUT": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • Java 21 or later - Maven 3.9+ (or use the Docker build — no local Maven required) - A Langfuse account with an API key pair (public-key + secret-key) ---
VariableDescriptionRequired
LANGFUSE_PUBLIC_KEYCredential the server authenticates with.Yes
LANGFUSE_SECRET_KEYCredential the server authenticates with.Yes
LANGFUSE_HOSTEndpoint or connection string the server talks to.Optional
LANGFUSE_TIMEOUTConfiguration value read at startup.Optional

Example prompts to try

  • Use Langfuse MCP Java to fetch traces.
  • Use Langfuse MCP Java to fetch trace.
  • Use Langfuse MCP Java to find exceptions.

Frequently asked questions

It connects Langfuse MCP Java to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (fetch_traces, fetch_trace, find_exceptions, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Langfuse MCP Java directly.