Skip to content

fix(ci): unbreak the MCP server deploy — exclude tests from the prod build - #580

Merged
guillermoscript merged 1 commit into
masterfrom
worktree-fix-mcp-deploy-test-typecheck
Jul 28, 2026
Merged

fix(ci): unbreak the MCP server deploy — exclude tests from the prod build#580
guillermoscript merged 1 commit into
masterfrom
worktree-fix-mcp-deploy-test-typecheck

Conversation

@guillermoscript

Copy link
Copy Markdown
Owner

What

The last three pushes to master (#578, #576, #575) all failed deploy-mcp.yml. The production MCP image has not been rebuilt since — prod is running a stale MCP server.

Root cause

The Docker build runs mcp-use build, which type-checks everything in the tsconfig include, test files included:

src/branding.test.ts(1,38): error TS2307: Cannot find module 'vitest' or its corresponding type declarations.
src/tools/flashcards.test.ts(104,91): error TS7006: Parameter 'rating' implicitly has an 'any' type.
src/tools/practice.test.ts(1,38): error TS2307: Cannot find module 'vitest' ...

mcp-server has its own vitest.config.ts but does not declare vitest as a dependency — locally the import resolves by walking up into the repo root's node_modules. mcp-server/Dockerfile copies only mcp-server/, so inside the image there is no root to walk up to.

It first broke in f93a762 (#572), which added the three test files.

Fix

Exclude **/*.test.ts(x) from mcp-server/tsconfig.json. Test files should not be compiled into dist regardless, and this is preferable to shipping vitest into the production image.

QA

  • docker build of mcp-server/Dockerfile locally: ✅ Type check passed!, 18 widgets built, image exported (fails on master with the errors above)
  • npx vitest run in mcp-server: ✅ 5 files, 66 tests passing — the tests still run, they are only excluded from the build

Follow-up (not in this PR)

vitest is an undeclared dependency of mcp-server; npm test there only works because of root hoisting. Worth declaring, but that means touching mcp-server/package-lock.json, which is out of scope for a deploy hotfix.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FJ4dqwXuyKUPtg11ni5BSb

…rod build

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.
@guillermoscript
guillermoscript merged commit 35ef2b8 into master Jul 28, 2026
2 checks passed
@guillermoscript
guillermoscript deleted the worktree-fix-mcp-deploy-test-typecheck branch July 28, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant