Deploy xmcp servers with zero-configuration

1 min read

Vercel now supports xmcp, a framework for building and shipping MCP servers with TypeScript, with zero-configuration.

xmcp uses file-based routing to create tools for your MCP server.

my-project/
├── src/
│ ├── middleware.ts
│ └── tools/
│ ├── greet.ts
│ ├── search.ts
├── package.json
├── tsconfig.json
└── xmcp.config.ts

File-based routing using xmcp

Once you've created a file for your tool, you can use a default export in a way that feels familiar to many other file-based routing frameworks. Below, we create a "greeting" tool.

// 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"),
};
// Tool metadata
export const metadata = {
name: "greet",
description: "Greet the user",
};
export default async function greet({ name }: InferSchema<typeof schema>) {
const result = `Hello, ${name}!`;
return {
content: [{ type: "text", text: result }],
};
}

Learn more about deploying xmcp to Vercel in the documentation.