1. Conduid
  2. Developer Tools
  3. Fastmcp Langfuse
MCP server · Developer Tools

Fastmcp Langfuse

Langfuse observability integration for FastMCP v3 servers — one-line setup

Unclaimed MIT last commit 6 months ago devtools
52Fair

Scored yesterday · breakdown

About Fastmcp Langfuse

Fastmcp Langfuse is an MCP server published by sahilsasane in the Developer Tools category: langfuse observability integration for FastMCP v3 servers — one-line setup. It has been installed 0 times through Conduid.

Six months or more without a commit doesn't mean the server is broken, but check the open issues (0) before depending on it in production.

Install

Install
npx fastmcp-langfuse

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

Ask AI about Fastmcp Langfuse

Powered by Claude · Grounded in docs

I know everything about Fastmcp Langfuse. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ·README presentNot checked yet.
  • ·License declaredNot checked yet.
  • ·Tests presentNot checked yet.
  • ·Dependencies pinnedNot checked yet.
  • ·No dynamic code executionNot checked yet.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

v0.1.1v0.1.1 - Bug fix · 16 Feb 2026

README

fastmcp-langfuse

Plug Langfuse observability into any FastMCP v3 server. One function call, zero boilerplate.

from langfuse import get_client
get_client()

from fastmcp import FastMCP
from fastmcp_langfuse import instrument

mcp = FastMCP("My Server")
instrument(mcp)

@mcp.tool()
def anything(x: str) -> str:   # fully traced, just like that
    return "hello"

Three imports, one instrument() call. Vibecode the rest -- every tool, resource, and prompt gets session tracking, I/O capture, environment tags, and trace URLs automatically.

Install

pip install fastmcp-langfuse
# or
uv add fastmcp-langfuse

You'll also need langfuse in your project -- this library sets the right OTel span attributes that the Langfuse SDK picks up, but doesn't import it directly.

What you get for free

Once you call instrument(mcp), every handler registered after it gets:

  • Input/output -- function args serialised as input, return value as output
  • Session & user tracking -- session_id and client_id from FastMCP context
  • Environment & release tags -- tag your traces with production, staging, etc.
  • Trace URLs -- clickable Langfuse links printed to your console

No decorators on every handler. No manual span enrichment. Just works.

Configure it

Pass kwargs directly or use a config object -- whatever feels right:

# kwargs
instrument(mcp, environment="production", release="v1.2.3", trace_urls=False)

# or config object
from fastmcp_langfuse import LangfuseConfig

instrument(mcp, config=LangfuseConfig(environment="production"))
Field Type Default What it does
environment str "" Tags langfuse.environment on every span
release str "" Tags langfuse.release on every span
session_tracking bool True Sets session/user IDs from FastMCP context
trace_urls bool True Prints Langfuse trace URLs to console
base_url str https://cloud.langfuse.com Your Langfuse instance URL

Need more control?

Use @langfuse_trace on individual handlers instead of (or alongside) instrument():

from fastmcp_langfuse import langfuse_trace

@mcp.tool()
@langfuse_trace
def special_tool(x: str) -> str:
    return "traced with the decorator"

Same enrichment, just explicit.

How it works under the hood

FastMCP auto-creates OTel spans for every tool/resource/prompt call. This library wraps your handlers to enrich those spans with Langfuse-specific attributes (langfuse.session.id, langfuse.trace.input, etc.) that the Langfuse SDK recognises when exporting.

The library only depends on opentelemetry-api and fastmcp. Lightweight, no opinions about your config management.

Examples

Check out examples/ for a full working demo with tools, resources, prompts, cost tracking, user feedback, and distributed tracing. It uses pydantic-settings to bridge env vars to LangfuseConfig -- but that's just one way to do it, bring your own config however you want.

cd examples && cp .env.example .env
# add your LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY

uv run python examples/server.py   # terminal 1
uv run python examples/client.py   # terminal 2

License

MIT

README mirrored from the source repository yesterday. The original is authoritative.

Questions

About Fastmcp Langfuse

How do I install Fastmcp Langfuse?

Run npx fastmcp-langfuse, then add the server to your MCP client's configuration. Conduid has recorded 0 installs, so the command is known to work with current clients.

Is Fastmcp Langfuse safe to use with an AI agent?

Its trust score is 52 out of 100 (fair). It passes 0 of 1 static security checks; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Fastmcp Langfuse still maintained?

The last commit was 6 months ago, with 0 open issues. That's long enough that you should check whether the maintainer is responding to issues before depending on it.