Why does xmcp build fail with "Dist directory not found"?

Loading...

seeing this error in my builds:

forums:build: ❌ Failed to create Vercel output structure: Error: ❌ Dist directory not found. Run build first.
forums:build:     at i8 (/vercel/path0/node_modules/.bun/xmcp@0.6.0+a88674b23d48476e/node_modules/xmcp/dist/cli.js:249:426)
forums:build:     at onBuild (/vercel/path0/node_modules/.bun/xmcp@0.6.0+a88674b23d48476e/node_modules/xmcp/dist/cli.js:249:2580)
forums:build:     at /vercel/path0/node_modules/.bun/xmcp@0.6.0+a88674b23d48476e/node_modules/xmcp/dist/cli.js:119:9711
forums:build:     at /vercel/path0/node_modules/.bun/@rspack+core@1.7.3+4cb091f5c2bf0ada/node_modules/@rspack/core/dist/index.js:10170:21
forums:build:     at /vercel/path0/node_modules/.bun/@rspack+core@1.7.3+4cb091f5c2bf0ada/node_modules/@rspack/core/dist/index.js:10921:46
forums:build:     at /vercel/path0/node_modules/.bun/@rspack+core@1.7.3+4cb091f5c2bf0ada/node_modules/@rspack/core/dist/index.js:7095:113
forums:build:     at done (/vercel/path0/node_modules/.bun/@rspack+lite-tapable@1.1.0/node_modules/@rspack/lite-tapable/dist/index.cjs:373:13)
forums:build:     at AsyncParallelHook.callAsyncStageRange (/vercel/path0/node_modules/.bun/@rspack+lite-tapable@1.1.0/node_modules/@rspack/lite-tapable/dist/index.cjs:379:46)
forums:build:     at AsyncParallelHook.callAsync (/vercel/path0/node_modules/.bun/@rspack+lite-tapable@1.1.0/node_modules/@rspack/lite-tapable/dist/index.cjs:101:21)
forums:build:     at Cache.shutdown (/vercel/path0/node_modules/.bun/@rspack+core@1.7.3+4cb091f5c2bf0ada/node_modules/@rspack/core/dist/index.js:7148:33)

my build script is "build": "xmcp build && next build", as per the docs recommends

Avatar of julianbenegas
Julian Benegas
commented

there are no error log lines before this one. this is a monorepo indeed. here's my xmcp.config.ts:

import type { XmcpConfig } from "xmcp"

const config: XmcpConfig = {
  http: true,
  experimental: {
    adapter: "nextjs",
  },
  paths: {
    tools: "app/mcp/tools",
    prompts: false,
    resources: false,
  },
  typescript: {
    skipTypeCheck: true,
  },
}

export default config
Avatar of julianbenegas
Julian Benegas
commented

let's create a PR with the fix, if it's an easy one


END OF POST

Why does xmcp build fail with "Dist directory not found"? — basementstudio/xmcp