Sandbox
@langfuse/langfuse-docs

Langfuse docs site with markdown and MCP support

This repo powers langfuse.com as a documentation site, not a build-time tool or library. It serves docs content, search, AI chat, markdown endpoints, PDF export, and an MCP server that can search or fetch pages. The content is organized as a Next.js app with MDX components and generated markdown assets.

240 starsβ€’296 forksβ€’MDXβ€’Updated 6d ago
Who it's for

Builders who need to read, maintain, or adapt Langfuse’s docs workflow and LLM-friendly docs delivery.

What it delivers

You can publish docs that people and agents can search, copy, and fetch as markdown or through MCP.

What it does

Markdown URL endpoints

Appends `.md` to docs URLs and serves prebuilt markdown from `public/md-src/`.

Copy as Markdown

Lets readers copy a page as markdown for pasting into ChatGPT, Claude, or Cursor.

PDF export

Uses `/api/md-to-pdf` to turn markdown pages into PDFs for legal and other pages.

MCP server

Exposes `/api/mcp` with tools for searching docs, fetching page markdown, and getting the Langfuse overview.

Docs site framework

Builds the site with Fumadocs, Next.js App Router, shadcn/ui, and Tailwind CSS.

README

hero-b

Langfuse Docs

Repo for langfuse.com. Built with Fumadocs and Next.js App Router.

πŸ§‘β€πŸ’» We're hiring

Langfuse is growing fast (we doubled the team in the last 6 months) - since January 2026 we're part of ClickHouse, we're hiring engineering hybrid across the EU. We hire engineers who love open source and great developer experiences. See open roles β†’

Local Development

Pre-requisites: Node.js 22 (22.13+), pnpm v12.3.4

To use Node 22 (e.g. with nvm): nvm install 22 then nvm use (or nvm use 22). The repo includes an .nvmrc so nvm use picks 22 automatically.

  1. Optional: Create env based on .env.template
  2. Run pnpm i to install the dependencies.
  3. Run pnpm dev to start the development server on localhost:3333

Formatting

This repo uses Prettier for formatting supported source and content files, including Markdown and MDX.

  • Run pnpm run format to format files.
  • Run pnpm run format:check to check formatting in CI mode.

Markdown prose wrapping is preserved and embedded-language formatting is disabled in .prettierrc.json so formatting does not change linebreak-sensitive Markdown rendering or fenced code snippet contents.

Python cookbooks

All Jupyter notebooks are in the cookbook/ directory. For JS/TS notebooks we use Deno, see Readme in cookbook folder for more details.

To render them within the documentation site, we convert them to markdown using jupyter nbconvert, move them to the right path in the content/guides/cookbook/ directory where they are picked up by Fumadocs.

Steps after updating notebooks:

  1. Ensure you have uv installed
  2. Run bash scripts/update_cookbook_docs.sh (uv will automatically handle dependencies)
  3. Commit the changed markdown files

Note: All .md or .mdx files that contain "source: ⚠️ Jupyter Notebook" on top in content/guides/cookbook/ are automatically generated from Jupyter notebooks. Do not edit them manually β€” they will be overwritten. Always edit the Jupyter notebooks and run the conversion script.

Media

Images

We store all images in the public/images/ directory. To use them in the markdown files, use the absolute path /images/your-image.png.

Videos / Gifs

We use a bucket on Cloudflare R2 to store all video. It is hosted on https://static.langfuse.com/docs-videos. Ping one of the maintainers to upload a video to the bucket and get the src.

To embed a video, use the Video component and set a title and fixed aspect ratio. Point src to the mp4 file in the bucket.

To embed a "gif", actually embed a video and use gifMode (<Video src="" gifMode />). This will look like a gif, but at a much smaller file size and higher quality.

Stack

Interested in stack of Q&A docs chatbot? Checkout the blog post for implementation details (all open source)

Search & AI chat

The docs site uses Inkeep for two separate embeds:

  • Search β€” Inkeep's embedded search widget.
  • Ask AI chat β€” Fumadocs' built-in Inkeep chat integration.

LLM Features

The docs site includes four interconnected features designed to make documentation accessible to LLMs and AI tools:

  1. Markdown URL endpoints (.md suffix): Append .md to any URL (e.g., /docs.md) to get raw markdown. Built at compile time via scripts/copy_md_sources.js which copies all .mdx/.md files from content/ to public/md-src/ as static .md files with inlined MDX components.

  2. Copy as Markdown button: UI button on docs pages that fetches the .md endpoint and copies to clipboard for pasting into ChatGPT/Claude/Cursor.

  3. Export as PDF links: API endpoint /api/md-to-pdf that fetches markdown from .md URLs and converts to PDF using Puppeteer. Used on legal pages (terms, privacy, DPA, etc.).

  4. MCP Server: Model Context Protocol server at /api/mcp with three tools:

    • searchLangfuseDocs: RAG search via Inkeep API
    • getLangfuseDocsPage: Fetches specific page markdown from .md URLs
    • getLangfuseOverview: Returns llms.txt overview

All three user-facing features (Copy, PDF, MCP) depend on the same foundation of pre-built static markdown files, making them fast, cacheable, and reliable. See RESEARCH-LLM-FEATURES.md for detailed implementation details.

Bundle analysis

Run pnpm run analyze to analyze the bundle size of the production build using @next/bundle-analyzer.

Files in the repo

Repository payloadβ€’48 top-level entries
  • .agents
  • .devcontainer
  • .github
  • .langfuse
  • .vscode
  • app
  • components
  • components-mdx
  • content
  • cookbook
  • data
  • lib
  • md-override
  • out
  • public
  • scripts
  • src
  • .editorconfig
  • .env.template
  • .gitignore
  • .nvmrc
  • .prettierignore
  • .prettierrc.json
  • .python-version
  • .sitemap-excludes.json
  • AGENTS.md
  • CLAUDE.md
  • components.json
  • favicon.ico
  • global.d.ts
  • LICENSE
  • mdx-components.tsx
  • next-env.d.ts
  • next-sitemap.config.js
  • next.config.mjs
  • package.json
  • pnpm-lock.yaml
  • pnpm-workspace.yaml
  • postcss.config.js
  • proxy.ts
  • pyproject.toml
  • README.md
  • source.config.ts
  • style.css
  • tailwind.config.js
  • tsconfig.json
  • uv.lock
  • vercel.json

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More other

HKUDS/
Vibe-Trading

"Vibe-Trading: Your Personal Trading Agent"

33k
tinyhumansai/
openhuman

OpenHuman is an open source personal AI for Mac, Windows and Linux β€” local-first memory, agent orchestration, and deep research.

40k

Your Personal AI Assistant; easy to install, deploy on your own machine or on the cloud; supports multiple chat apps with easily extensible capabilities.

35k

AIPOCH Open-Science is an open-source, local-first, model-agnostic AI research workbench for macOS, Windows, and Linux, with scientific agents, Python/R notebooks, data connectors, and reproducible provenance.

4k

🀯 LobeHub is your Chief Agent Operator, organizing your agents into 7Γ—24 operations by hiring, scheduling, and reporting on your entire AI team.

82k