Skip to content

Express Starter

An Express MCP server using xmcp's adapter

Categories
Framework
Express
Adapter
HTTP
Share
Post on X

An Express server with xmcp mounted through the Express adapter.

Features

  • Express application with MCP mounted at /mcp
  • File-based tool discovery from src/tools/
  • Adapter build via experimental.adapter: "express"
  • Type-safe tools with Zod schemas and InferSchema

Getting Started

1. Create the project

Shell

2. Install & run

Shell

Requires Node.js 22.12 or newer. pnpm install also installs @xmcp-dev/compiler, the dev dependency that runs xmcp dev and xmcp build.

The Express server starts at http://localhost:3000, and the MCP endpoint is available at /mcp.

Project Structure

Text

MCP Endpoint

The MCP server is mounted through the generated adapter. xmcp build writes it to .xmcp/adapter, and the relative import keeps the compiled dist/index.js runnable with plain Node:

TypeScript

Adding Tools

Create a new .ts file in src/tools/. The tool is automatically discovered:

TypeScript

Build

Shell

Learn More

Other templates

One framework to rule them all