BX

basementstudio/xmcp

Security testingOfficial
1.3K stars 95 forks Quality 71 Trend 44MIT

The TypeScript MCP framework

Overview

xmcp is a framework for building and shipping MCP servers with TypeScript. Designed with DX in mind, it streamlines development and lowers the barrier to entry for anyone looking to create and deploy powerful tools on top of the Model Context Protocol ecosystem. Bootstrap your first xmcp application with: or initialize xmcp on an existing Next.js or Express project with: ⊹ - Tools and prompts are auto-registered from a tools and prompts directory\ ⊹ - Instant development feedback\ ⊹ - Toolkit for shipping authentication and custom middlewares\ ⊹ - Customizable configuration for your MCP server\ ⊹ - Flexible deployment across any platform\ ⊹ - Zero-configuration deployment with Vercel ⊹ Visit xmcp.dev to learn more about the project.\ ⊹ Visit xmcp.dev/docs to view the full documentation. If you believe you have found a security vulnerability, we encourage you to let us know right away. We will investigate all legitimate reports and do our best to quickly fix the problem.

README

The TypeScript MCP framework

Build and ship MCP servers with the code you already know. Give AI applications access to your tools, data, and workflows. Write TypeScript functions; xmcp handles the protocol, validation, and transport.

Getting started

Create a new xmcp app:

npx create-xmcp-app@latest

Or add xmcp to an existing project:

npx init-xmcp@latest

A tool is a file. Export a schema, metadata, and a function, and xmcp registers it:

// src/tools/greet.ts
import { z } from "zod";
import { type InferSchema } from "xmcp";

export const schema = {
  name: z.string().describe("The name of the user to greet"),
};

export const metadata = {
  name: "greet",
  description: "Greet the user",
};

export default async function greet({ name }: InferSchema) {
  return `Hello, ${name}!`;
}

Features

⊹ File system routing - Tools, prompts, and resources register automatically from their directories, with zero configuration
⊹ Middlewares - Add authentication, logging, rate limits, or custom logic to every request
⊹ Transports - Serve over HTTP or STDIO from the same code
⊹ Integrations - Authentication with Better Auth, Clerk, Auth0, WorkOS, Descope, Scalekit and Supabase; monetization with Polar, Commet and x402
⊹ Adapters - Run inside Next.js, Express, NestJS, Fastify, Hono, TanStack Start, Nuxt, SvelteKit, React Router or Astro
⊹ MCP Apps - Ship interactive React widgets alongside your tools
⊹ Deploy anywhere - Vercel, Cloudflare, Alpic, Replit, Railway, Render, or any Node.js host
⊹ Hot reloading - Instant feedback while you develop

Learn more

⊹ Visit xmcp.dev to learn more about the project.
⊹ Read the documentation for guides and API reference.
⊹ Start from a template.

Security

If you believe you have found a security vulnerability, we encourage you to let us know right away.

We will investigate all legitimate reports and do our best to quickly fix the problem.

Please report any vulnerabilities in our open source repositories to [email protected].

View the full README on GitHub

Install

npx create-xmcp-app@latest
New to MCP? Start with the mcpskill.org guide →