Examples & Templates

Get started quickly with these examples and templates. Each example demonstrates different features and use cases of xmcp.

Filter by Category

Next.js with Auth

A Next.js application with xmcp and authentication handler

nextjs

HTTP with Better Auth

HTTP-based xmcp server with better-auth integration

http

Next.js with Better Auth

Next.js app with xmcp and better-auth integration

nextjs

Custom Paths

Configure custom file paths for xmcp tools and prompts directories

config

Custom Webpack Config

Customize webpack configuration for xmcp builds

config

Request Headers

Access and utilize HTTP request headers in xmcp tool calls

headers

HTTP Transport

Learn how to set up an xmcp server using HTTP transport

http

mcp-ui

An xmcp application with tool syntax

API Key Middleware

Secure your xmcp server with API key authentication middleware

middleware

Middleware Array

Chain multiple middlewares together in xmcp servers

middleware

Custom Middleware

Create custom middleware functions for xmcp servers

middleware

JWT Middleware

Implement JWT token validation middleware for xmcp servers

middleware

OAuth Provider

Complete OAuth provider implementation with xmcp [experimental]

authentication

STDIO Transport

Build a command-line xmcp server using STDIO transport

stdio

Template Config

Modify the template config in the xmcp.config.ts file.

config

Express with Adapter

Build a Node.js Express server with xmcp's adapter

adapter

Next.js with Adapter & AI SDK tool registry injection

Integrate xmcp into a Next.js application using the adapter and inject the tool registry into the AI SDK

nextjs

Next.js with Adapter

Integrate xmcp into a Next.js application using the adapter

nextjs