Major features implemented: - SQLite storage service with FTS5 for fast node search - Database rebuild mechanism for bulk node extraction - MCP tools: search_nodes, extract_all_nodes, get_node_statistics - Production Docker deployment with persistent storage - Management scripts for database operations - Comprehensive test suite for all functionality Database capabilities: - Stores node source code and metadata - Full-text search by node name or content - No versioning (stores latest only as per requirements) - Supports complete database rebuilds - ~4.5MB database with 500+ nodes indexed Production features: - Automated deployment script - Docker Compose production configuration - Database initialization on first run - Volume persistence for data - Management utilities for operations Documentation: - Updated README with complete instructions - Production deployment guide - Clear troubleshooting section - API reference for all new tools 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
54 lines
1.2 KiB
Docker
54 lines
1.2 KiB
Docker
# Production stage
|
|
FROM node:18-alpine
|
|
|
|
# Install SQLite (for database management)
|
|
RUN apk add --no-cache sqlite
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install production dependencies only
|
|
RUN npm ci --only=production
|
|
|
|
# Copy built files
|
|
COPY dist ./dist
|
|
COPY tests ./tests
|
|
|
|
# Create data directory for SQLite database
|
|
RUN mkdir -p /app/data
|
|
|
|
# Create a non-root user
|
|
RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
|
|
|
|
# Change ownership (including data directory)
|
|
RUN chown -R nodejs:nodejs /app
|
|
|
|
# Switch to non-root user
|
|
USER nodejs
|
|
|
|
# Set environment variable for database location
|
|
ENV NODE_DB_PATH=/app/data/nodes.db
|
|
|
|
# Create a startup script
|
|
RUN printf '#!/bin/sh\n\
|
|
echo "🚀 Starting n8n-MCP server..."\n\
|
|
\n\
|
|
# Initialize database if it does not exist\n\
|
|
if [ ! -f "$NODE_DB_PATH" ]; then\n\
|
|
echo "📦 Initializing database..."\n\
|
|
node dist/scripts/rebuild-database.js\n\
|
|
fi\n\
|
|
\n\
|
|
echo "🎯 Database ready, starting MCP server..."\n\
|
|
exec node dist/index.js\n' > /app/start.sh && chmod +x /app/start.sh
|
|
|
|
# Expose the MCP server port (if using HTTP transport)
|
|
EXPOSE 3000
|
|
|
|
# Volume for persistent database storage
|
|
VOLUME ["/app/data"]
|
|
|
|
# Start the MCP server with database initialization
|
|
CMD ["/bin/sh", "/app/start.sh"] |