Skip to content

langfuse/mcp-reference

Repository files navigation

Langfuse MCP Servers

Standalone Next.js site for Langfuse MCP servers. The app introspects configured MCP servers from the Next.js server runtime and serves hourly ISR-cached HTML, JSON, and Markdown references.

Local Setup

pnpm install
pnpm dev

The default runtime discovery checks every configured server and fails if any required server cannot be initialized or introspected.

For unauthenticated local work, run the app against only the public Docs MCP server:

MCP_REFERENCE_SERVER_IDS=langfuse-docs pnpm dev

Runtime Credentials

The authenticated Langfuse Cloud MCP server uses project-scoped Basic Auth during server-side discovery:

LANGFUSE_PUBLIC_KEY=pk-lf-your-public-key
LANGFUSE_SECRET_KEY=sk-lf-your-secret-key

The runtime generator constructs Authorization: Basic base64(LANGFUSE_PUBLIC_KEY:LANGFUSE_SECRET_KEY) in memory. Credential values are never written into generated artifacts, snippets, browser code, or logs.

Configuration

mcp-reference.config.json is the source of truth for public MCP servers, authentication requirements, and endpoint variants. The initial catalog includes:

  • langfuse-cloud: authenticated Langfuse Cloud MCP server, introspected from the Cloud EU endpoint and documented with EU, US, Japan, HIPAA, self-hosted, and local variants.
  • langfuse-docs: unauthenticated Langfuse Docs MCP server.

All configured top-level servers are required for the default production runtime.

Generated Output

The public reference endpoints are generated by App Router route handlers and cached with hourly ISR:

  • /: interactive HTML reference by default.
  • /: generated Markdown when the request Accept header prefers Markdown over HTML.
  • /generated/mcp-reference.json: generated machine-readable JSON catalog.
  • /generated/mcp-reference.md: generated Markdown catalog.

Vercel Deployment

Set the Langfuse Cloud credentials in the Vercel project environment, then use the default build command:

pnpm build

The build script runs next build. The deployed Node.js runtime refreshes the generated reference at most once per hour with stale-while-revalidate behavior.

Verification

pnpm test
pnpm typecheck
pnpm build

Runtime checks should confirm the generated JSON and Markdown URLs are served, root-level Markdown content negotiation works, and responses expose ISR cache behavior through x-nextjs-cache in production mode.

About

Standalone Next.js site for Langfuse MCP servers. The app introspects configured MCP servers at build time, writes static JSON and Markdown artifacts, and renders the same generated snapshot in the browser.

Resources

License

Stars

Watchers

Forks

Contributors

Languages