Menu

Deploy xmcp servers with zero-configuration - Vercel
πŸ“°

Deploy xmcp servers with zero-configuration - Vercel

Vercel NewsΒ·Anthony ShewΒ·5 months ago
#CPLDWY07
#vercel#greet#xmcp#name#file
Reading 0:00
15s threshold

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 } !…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.