Skip to content

Commit 35ef2b8

Browse files
fix(mcp): unbreak the MCP server deploy by excluding tests from the prod build (#580)
The last three pushes to master failed `deploy-mcp.yml` at the Docker build: src/branding.test.ts(1,38): error TS2307: Cannot find module 'vitest' src/tools/flashcards.test.ts(104,91): error TS7006: Parameter 'rating' implicitly has an 'any' type. `mcp-server` declares a vitest config but not the dependency — locally the import resolves upward into the repo root's node_modules. The image copies only `mcp-server/`, so there is no root to walk up to and the type check fails. Test files also have no business in `dist`, so exclude them from the build rather than shipping vitest into the production image. Verified with a local `docker build` of mcp-server/Dockerfile: type check passes, 18 widgets built. `npx vitest run` in mcp-server still passes 66/66.
1 parent c280432 commit 35ef2b8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

mcp-server/tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@
2020
}
2121
},
2222
"include": ["index.ts", "src/**/*", "resources/**/*", "server.ts", ".mcp-use/**/*.d.ts"],
23-
"exclude": ["node_modules", "dist"]
23+
// Test files are excluded from the build: `vitest` resolves from the repo
24+
// root's node_modules here, but the Docker image copies only mcp-server/,
25+
// so compiling them fails the production build with TS2307.
26+
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.test.tsx"]
2427
}

0 commit comments

Comments
 (0)