From 98b7e83739d1cca78529d1bfc4067a13b8f01a21 Mon Sep 17 00:00:00 2001 From: czlonkowski <56956555+czlonkowski@users.noreply.github.com> Date: Wed, 18 Jun 2025 23:37:48 +0200 Subject: [PATCH] fix: resolve TypeScript compilation errors in Docker build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The build was failing because TypeScript couldn't find module imports. Fixed by: 1. Installing minimal dependencies needed for compilation (MCP SDK, dotenv, express) 2. Excluding n8n node implementation files that aren't needed for MCP server - Removed src/n8n directory (n8n node implementation) - Removed src/utils/bridge.ts and src/utils/mcp-client.ts (n8n-specific utils) These files are only used for n8n integration, not for the MCP server runtime. Results: - Build succeeds with only 102 packages (vs 2294 before) - TypeScript compiles without errors - Faster builds and smaller image 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5f94d68..ff79372 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,13 +8,16 @@ WORKDIR /app # Copy tsconfig for TypeScript compilation COPY tsconfig.json ./ -# Create minimal package.json and install ONLY TypeScript +# Create minimal package.json and install ONLY build dependencies RUN --mount=type=cache,target=/root/.npm \ echo '{}' > package.json && \ - npm install --no-save typescript@^5.8.3 @types/node@^22.15.30 @types/express@^5.0.3 + npm install --no-save typescript@^5.8.3 @types/node@^22.15.30 @types/express@^5.0.3 \ + @modelcontextprotocol/sdk@^1.12.1 dotenv@^16.5.0 express@^5.1.0 -# Copy source and build +# Copy source and build (excluding n8n-specific files) COPY src ./src +# Remove n8n node implementation and related utils that aren't needed for MCP server +RUN rm -rf src/n8n src/utils/bridge.ts src/utils/mcp-client.ts RUN npx tsc # Stage 2: Runtime (minimal dependencies)