Anonymous View

Project structure

Explore the file-system based architecture with auto-discovery for tools, prompts, and resources, plus configuration options for custom directory layouts

For the complete documentation index, see llms.txt. Markdown variants of every page are available by appending .md to the URL.

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