feat: implement n8n integration improvements and protocol version negotiation

- Add intelligent protocol version negotiation (2024-11-05 for n8n, 2025-03-26 for standard clients)
- Fix memory leak potential with async cleanup and connection close handling
- Enhance error sanitization for production environments
- Add schema validation for n8n nested output workaround
- Improve Docker security with unpredictable UIDs/GIDs
- Create n8n-friendly tool descriptions to reduce schema validation errors
- Add comprehensive protocol negotiation test suite

Addresses code review feedback:
- Protocol version inconsistency resolved
- Memory management improved
- Error information leakage fixed
- Docker security enhanced

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-08-01 14:23:48 +02:00
parent 6cdb52f56f
commit 3fec6813f3
21 changed files with 2517 additions and 97 deletions

View File

@@ -29,9 +29,13 @@ RUN apk add --no-cache \
tini \
&& rm -rf /var/cache/apk/*
# Create non-root user with less common UID/GID
RUN addgroup -g 1001 n8n-mcp && \
adduser -u 1001 -G n8n-mcp -s /bin/sh -D n8n-mcp
# Create non-root user with unpredictable UID/GID
# Using a hash of the build time to generate unpredictable IDs
RUN BUILD_HASH=$(date +%s | sha256sum | head -c 8) && \
UID=$((10000 + 0x${BUILD_HASH} % 50000)) && \
GID=$((10000 + 0x${BUILD_HASH} % 50000)) && \
addgroup -g ${GID} n8n-mcp && \
adduser -u ${UID} -G n8n-mcp -s /bin/sh -D n8n-mcp
# Set working directory
WORKDIR /app