Project structure

Overview

A basic project structure is as follows:

Top-level files

There are the three top-level files that are required for your project:

  • package.json: Contains your project's dependencies and scripts.
  • tsconfig.json: Contains your project's TypeScript configuration.
  • xmcp.config.ts: Contains your project's xmcp configuration.

Source directory

The src/ directory houses your project's implementation. xmcp follows a declarative, file-system based approach—simply create a file in the appropriate directory, and it will be automatically discovered and registered.

The optional middleware.ts file at the root of src/ processes HTTP requests and responses. You can customize the location of tools/, prompts/, and resources/ directories in your xmcp.config.ts file. See the custom directories documentation for details.

On this page

One framework to rule them all

    Project structure | xmcp Documentation