xmcp is a TypeScript-first framework designed for building and deploying Model Context Protocol (MCP) servers. It aims to simplify the development experience for creating powerful tools within the MCP ecosystem, providing features like file system routing for automatic tool and prompt registration, hot reloading for rapid development, and a robust middleware system for authentication and custom logic. Currently at version 0.6.7, the project maintains an active development pace with frequent minor and patch releases (often weekly or bi-weekly), incorporating new features, security updates, and performance improvements. Key differentiators include its focus on developer experience, support for various deployment targets like Vercel and Cloudflare, and an 'elicit' mechanism within tool handlers for requesting structured user input.
npm install xmcpVerified import paths — ran on the pinned version, not inferred.
Initializes an xmcp project and demonstrates defining a tool that uses the `extra.elicit` function to prompt the user for structured input before proceeding with a simulated deployment.
Migrate to supported authentication plugins like `@xmcp-dev/auth0`, `@xmcp-dev/workos`, or `@xmcp-dev/clerk`, or implement custom authentication middleware.
Update your OAuth client configurations to use `audience` instead of `baseurl` when interacting with the xmcp OAuth authorization server.
Ensure your project's `package.json` explicitly lists and installs compatible versions of `react`, `react-dom`, and `zod` that satisfy xmcp's peer dependency requirements.
Upgrade to xmcp v0.6.7 or newer to benefit from improved error handling. Ensure all tool files (`src/tools/*`) are valid TypeScript/JavaScript modules with a default export.
It is strongly recommended to update to the latest stable version of xmcp immediately to incorporate all critical security patches.
Install the required peer dependencies with `npm install react react-dom zod` and ensure their versions satisfy xmcp's peer dependency ranges (e.g., `react@'>=19.0.0'`, `zod@'^3.25.76 || ^4.0.0'`).
Ensure your tool handler function is defined as `export default async function (_args, extra: ToolHandlerContext) { ... }` and that `extra` is correctly named and typed.Add `export default async function (...) { ... }` to your tool file, ensuring it exports a valid asynchronous function.This is expected behavior. When using `extra.elicit()`, always check `result.action` and `result.content` to handle user cancellations or incomplete input gracefully. Provide clear feedback to the user on why an action was not taken.