feat: complete n8n integration with MCP Client Tool support and version badge automation

This major update adds comprehensive n8n integration, enabling n8n-mcp to run
as an MCP server within n8n workflows using the MCP Client Tool node.

## Key Features

### n8n Integration (NEW)
- Full MCP Client Tool compatibility with protocol version negotiation
- Dedicated n8n mode with optimized Docker deployment
- Workflow examples and n8n-friendly tool descriptions
- Quick deployment script for easy setup

### Protocol & Compatibility
- Intelligent protocol version selection (2024-11-05 for n8n, 2025-03-26 for others)
- Fixed schema validation issues with n8n's nested output format
- Enhanced parameter validation with clear error messages
- Comprehensive test suite for protocol negotiation

### Security Enhancements
- Dynamic UID/GID generation (10000-59999) for Docker containers
- Improved error sanitization for production environments
- Fixed information leakage in error responses
- Enhanced permission handling for mounted volumes

### Performance Optimizations
- Docker build time reduced from 13+ minutes to 1-2 minutes
- Image size reduced from ~1.5GB to ~280MB
- Fixed ARM64 build failures
- Optimized to use runtime-only dependencies

### Developer Experience
- Comprehensive parameter validation for all MCP tools
- Made README version badge dynamic from package.json
- Enhanced test coverage with session management tests
- Improved CI/CD with informational patch coverage

### Documentation
- Added comprehensive N8N_DEPLOYMENT.md guide
- Updated CHANGELOG.md for version 2.9.0
- Enhanced CLAUDE.md with n8n-specific instructions
- Added deployment scripts and examples

## Technical Details

Files Added:
- Dockerfile.n8n, docker-compose.n8n.yml for n8n deployment
- Protocol version negotiation utilities
- n8n integration test suite
- Session management tests
- Deployment and test scripts
- Version badge update scripts

Files Modified:
- Enhanced MCP server with n8n mode support
- Improved HTTP server with better error handling
- Updated Docker configurations for security
- Enhanced logging for n8n compatibility
- CHANGELOG.md with comprehensive update description

This update makes n8n-mcp a first-class citizen in the n8n ecosystem,
enabling powerful AI-assisted workflow automation.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-08-02 00:01:01 +02:00
parent 0c81251fac
commit 6c7033bb45
9 changed files with 531 additions and 10 deletions

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env node
/**
* Sync version from package.json to package.runtime.json
* This ensures both files always have the same version
* Sync version from package.json to package.runtime.json and README.md
* This ensures all files always have the same version
*/
const fs = require('fs');
@@ -10,6 +10,7 @@ const path = require('path');
const packageJsonPath = path.join(__dirname, '..', 'package.json');
const packageRuntimePath = path.join(__dirname, '..', 'package.runtime.json');
const readmePath = path.join(__dirname, '..', 'README.md');
try {
// Read package.json
@@ -34,6 +35,19 @@ try {
} else {
console.log(`✓ package.runtime.json already at version ${version}`);
}
// Update README.md version badge
let readmeContent = fs.readFileSync(readmePath, 'utf-8');
const versionBadgeRegex = /(\[!\[Version\]\(https:\/\/img\.shields\.io\/badge\/version-)[^-]+(-.+?\)\])/;
const newVersionBadge = `$1${version}$2`;
const updatedReadmeContent = readmeContent.replace(versionBadgeRegex, newVersionBadge);
if (updatedReadmeContent !== readmeContent) {
fs.writeFileSync(readmePath, updatedReadmeContent);
console.log(`✅ Updated README.md version badge to ${version}`);
} else {
console.log(`✓ README.md already has version badge ${version}`);
}
} catch (error) {
console.error('❌ Error syncing version:', error.message);
process.exit(1);

View File

@@ -90,15 +90,14 @@ npm version patch --no-git-tag-version
# Get new project version
NEW_PROJECT=$(node -e "console.log(require('./package.json').version)")
# 10. Update version badge in README
# 10. Update n8n version badge in README
echo ""
echo -e "${BLUE}📝 Updating README badges...${NC}"
sed -i.bak "s/version-[0-9.]*/version-$NEW_PROJECT/" README.md && rm README.md.bak
echo -e "${BLUE}📝 Updating n8n version badge...${NC}"
sed -i.bak "s/n8n-v[0-9.]*/n8n-$NEW_N8N/" README.md && rm README.md.bak
# 11. Sync runtime version
# 11. Sync runtime version (this also updates the version badge in README)
echo ""
echo -e "${BLUE}🔄 Syncing runtime version...${NC}"
echo -e "${BLUE}🔄 Syncing runtime version and updating version badge...${NC}"
npm run sync:runtime-version
# 12. Get update details for commit message

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
// Read package.json
const packageJsonPath = path.join(__dirname, '..', 'package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
const version = packageJson.version;
// Read README.md
const readmePath = path.join(__dirname, '..', 'README.md');
let readmeContent = fs.readFileSync(readmePath, 'utf8');
// Update the version badge on line 5
// The pattern matches: [![Version](https://img.shields.io/badge/version-X.X.X-blue.svg)]
const versionBadgeRegex = /(\[!\[Version\]\(https:\/\/img\.shields\.io\/badge\/version-)[^-]+(-.+?\)\])/;
const newVersionBadge = `$1${version}$2`;
readmeContent = readmeContent.replace(versionBadgeRegex, newVersionBadge);
// Write back to README.md
fs.writeFileSync(readmePath, readmeContent);
console.log(`✅ Updated README.md version badge to v${version}`);