Replace npm ci command with npm run build in Dockerfile#2965
Replace npm ci command with npm run build in Dockerfile#2965bruno-t-cardoso wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
The Dockerfile was missing the build step, causing Docker images to be non-functional because the dist/ directory was never created. Changes: - Replace `npm ci --ignore-scripts --omit-dev` with `npm run build` - This ensures TypeScript is compiled to JavaScript during build - The dist/ directory is now properly created and copied to release image The build process now works correctly: 1. Install all dependencies (including devDependencies for build) 2. Run `npm run build` to compile TypeScript -> JavaScript 3. Copy built dist/ directory to release image 4. Install only production dependencies in release image Fixes the Docker installation method documented in README. Credits: Based on the fix from PR modelcontextprotocol#2965 by @bruno-t-cardoso Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Review: The Dockerfile is not broken on
|
olaservo
left a comment
There was a problem hiding this comment.
Hi @bruno-t-cardoso - I wasn't able to repro this locally and had Claude post some findings in a comment on the PR.
Description
Fixed the Dockerfile for the sequential-thinking MCP server to properly compile TypeScript code during the Docker build process.
Server Details
Motivation and Context
The original Dockerfile had a bug that prevented the TypeScript code from being compiled to JavaScript during the Docker build. Line 10 was running
npm ci --ignore-scripts --omit-dev, which skipped thepreparescript that triggers the build. This resulted in a Docker image that appeared to build successfully but was non-functional because thedistdirectory was missing.This fix ensures the TypeScript code is properly compiled by explicitly running
npm run buildafter installing dependencies.How Has This Been Tested?
docker build -t mcp/sequentialthinking -f src/sequentialthinking/Dockerfile .echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | docker run --rm -i mcp/sequentialthinkinginitializeandtools/listrequestsBreaking Changes
No breaking changes. Users with the previous broken Docker image will need to rebuild it, but the configuration remains the same.
Types of changes
Checklist
Additional context
Before: The Dockerfile ran
npm ci --ignore-scripts --omit-devwhich prevented the TypeScript compilation.After: The Dockerfile now explicitly runs
npm run buildto compile TypeScript to JavaScript, ensuring thedistdirectory is created and the Docker image is functional.This fix makes the Docker installation method documented in the README actually work as intended.