Commit Graph

8 Commits

Author SHA1 Message Date
czlonkowski
6e52afd5af fix: Docker container cleanup on session end (Issue #66)
- Added proper SIGTERM/SIGINT signal handlers to stdio-wrapper.ts
- Removed problematic trap commands from docker-entrypoint.sh
- Added STOPSIGNAL directive to Dockerfile for explicit signal handling
- Implemented graceful shutdown in MCP server with database cleanup
- Added stdin close detection for proper cleanup when Claude Desktop closes the pipe
- Containers now properly exit with the --rm flag, preventing accumulation
- Added --init flag to all Docker configuration examples
- Updated documentation with container lifecycle management best practices
- Bumped version to 2.7.20

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18 18:51:24 +02:00
czlonkowski
caf1e008d7 fix: respect NODE_DB_PATH environment variable in Docker (fixes #40)
- Fixed docker-entrypoint.sh to use NODE_DB_PATH instead of hardcoded paths
- Added log_message() helper to prevent stdio mode output corruption
- Fixed directory creation race condition with proper ownership
- Added path validation to ensure NODE_DB_PATH ends with .db
- Updated rebuild.ts to respect NODE_DB_PATH environment variable
- Added comprehensive documentation for custom database paths
- Bumped version to 2.7.16

The bug was caused by hardcoded /app/data/nodes.db paths in the Docker
entrypoint script that ignored the NODE_DB_PATH environment variable.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 09:49:41 +02:00
czlonkowski
87f0cfc4dc feat: enhanced authentication logging for better debugging (fixes #22, #16)
- Added specific error reasons for auth failures: no_auth_header, invalid_auth_format, invalid_token
- Fixed AUTH_TOKEN_FILE support in Docker production stacks (issue #16)
- Added AUTH_TOKEN_FILE support to single-session HTTP server for consistency
- Enhanced security by removing token lengths from logs
- Added token trimming and empty token validation
- Updated Docker entrypoint to properly support AUTH_TOKEN_FILE
- Bumped version to 2.7.10

This improves debugging for mcp-remote authentication issues and enables
proper Docker secrets usage in production environments.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-07 23:19:35 +02:00
czlonkowski
b31ad630b8 fix: enhance stdio wrapper for Docker clean JSON-RPC output
- Set environment variables BEFORE imports in stdio-wrapper
- Override ALL console methods to prevent any output
- Update docker-entrypoint.sh to use exec for proper signal handling
- Add fallback if stdio-wrapper.js is missing
- Remove background process handling in stdio mode

This ensures absolutely no log output corrupts the JSON-RPC stream
2025-06-17 09:55:14 +02:00
czlonkowski
a688ad3d14 fix: resolve Docker stdio initialization timeout issue
- Add InitializeRequestSchema handler to MCP server
- Implement stdout flushing for Docker environments
- Create stdio-wrapper for clean JSON-RPC communication
- Update docker-entrypoint.sh to prevent stdout pollution
- Fix logger to check MCP_MODE before level check

These changes ensure the MCP server responds to initialization requests
within Claude Desktop's 60-second timeout when running in Docker.
2025-06-17 09:12:01 +02:00
czlonkowski
75952f94ca fix: Docker stdio communication for Claude Desktop compatibility
Fixed the initialization timeout issue with minimal changes:

1. Added stdout flush after server connection to combat Docker buffering
2. Fixed docker-entrypoint.sh to not output to stdout in stdio mode
3. Added process.stdin.resume() to keep server alive
4. Added IS_DOCKER environment variable for future use
5. Updated README to prioritize Docker with correct -i flag configuration

The core issue was Docker's block buffering preventing immediate JSON-RPC
responses. The -i flag maintains stdin connection, and explicit flushing
ensures responses reach Claude Desktop immediately.

Also fixed "Shutting down..." message that was breaking JSON-RPC protocol
by redirecting it to stderr in stdio mode.

Docker is now the recommended installation method as originally intended.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 00:30:54 +02:00
czlonkowski
4ef03da245 fix: resolve Docker build failures in GitHub Actions
- Added ca-certificates package for proper SSL certificate validation
- Configured git to handle SSL and initialization properly
- Added --depth 1 for faster cloning and reduced network issues
- Improved error handling to continue build even if docs clone fails
- Fixed su-exec issue by using Alpine's native su command
- Redirected git clone stderr to avoid polluting build logs

These changes address the exit code 128 git errors occurring in GitHub Actions
Docker builds while maintaining backwards compatibility.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 00:54:30 +02:00
czlonkowski
12bef3d98e feat: add comprehensive Docker support with multi-stage builds and compose configurations 2025-06-13 16:12:40 +02:00