Frequently asked questions
Everything you need to know about building and shipping MCP servers with xmcp. For the full reference, head to the documentation.
What is xmcp?
xmcp is an open-source TypeScript framework for building and deploying MCP (Model Context Protocol) servers. It simplifies MCP development by automatically discovering tools, resources, and prompts from your project's file system, reducing boilerplate and manual configuration.
How do I create a new xmcp project?
Create a new xmcp project by running npx create-xmcp-app@latest. The CLI scaffolds a ready-to-use MCP server and lets you choose your package manager, transport (HTTP or STDIO), and project components. To add xmcp to an existing application — Next.js, Express, Fastify, or NestJS — run npx init-xmcp@latest.
What are tools, resources, and prompts in xmcp?
In xmcp, tools are functions that an LLM or AI agent can call to perform actions. Resources are read-only data sources that provide context to the model. Prompts are reusable, parameterized instruction templates. xmcp automatically discovers tools, resources, and prompts from your project's file system, so they do not need to be registered manually.
How do I define a tool in xmcp?
To create an MCP tool with xmcp, add a file inside src/tools. A tool can export a Zod schema for input validation, metadata such as its name and description, and a default async function that executes the tool. Clear, descriptive metadata helps LLMs understand when and how to use the tool.
What transport options does xmcp support?
xmcp supports both HTTP and STDIO transports for MCP servers. HTTP is stateless and designed for remote, cloud, and serverless deployments. STDIO runs locally on the user's machine and is commonly used by MCP clients such as Claude Desktop and Cursor.
Is xmcp's HTTP transport stateful or stateless?
HTTP is stateless: the server does not retain per-client session memory between requests. Any client metadata a tool needs after initialization must be repeated on the current request, for example via headers such as x-mcp-client-name and x-mcp-client-version.
Which frameworks can I integrate xmcp with?
xmcp provides adapters for Next.js, Express, Fastify, and NestJS. These adapters let developers add an MCP server to an existing TypeScript application instead of creating and maintaining a separate service.
How do I add authentication to an xmcp server?
xmcp supports authentication through middleware for API keys and JWTs. The Next.js adapter also supports OAuth through withAuth. xmcp includes integrations with authentication providers such as Auth0, Better Auth, Clerk, Scalekit, and WorkOS.
Where can I deploy an xmcp server?
xmcp can be deployed to Vercel with zero configuration and also supports platforms including Cloudflare, Replit, and ALPIC. Because xmcp can build to a standard Node.js server, MCP servers using the HTTP transport can also run on other Node.js-compatible hosting providers.
Can I charge for MCP tools built with xmcp?
Yes. xmcp supports monetization for MCP tools through Polar and x402. Polar enables license-key-based access, while x402 enables pay-per-call payments using USDC on Base, allowing AI agents to programmatically pay for access to MCP tools.
How do I make my xmcp server discoverable to LLMs and registries?
The xmcp docs site exposes /llms.txt (a markdown index) and /llms-full.txt (full documentation) for LLM consumption, and xmcp servers can be published to the Smithery registry for distribution.
Is xmcp open source?
Yes. xmcp is an open-source TypeScript framework. Its source code, documentation, examples, issues, and contribution guidelines are available in the xmcp GitHub repository at github.com/basementstudio/xmcp.
What is the Model Context Protocol (MCP)?
The Model Context Protocol (MCP) is an open protocol for connecting AI applications and agents to external tools, data sources, and services. xmcp provides a TypeScript framework for implementing MCP servers without manually handling much of the underlying server infrastructure.
Why use xmcp instead of building an MCP server from scratch?
xmcp reduces the boilerplate required to build a TypeScript MCP server. It provides file-system routing, automatic discovery of tools, resources, and prompts, framework adapters, authentication, middleware, deployment support, and monetization integrations in a single framework.