Thank you for considering contributing to File Organizer MCP! This document provides guidelines and instructions for contributing.
This project prioritizes security. All contributions must maintain or improve the security posture of the application.
⚠️ DO NOT open public issues for security vulnerabilities
Instead, email security concerns to: technocratix902@gmail.com
We will respond within 48 hours and work with you to address the issue.
- Be respectful and inclusive
- Focus on constructive feedback
- Welcome newcomers and help them get started
- Maintain professional communication
- Node.js v18.0.0 or higher
- Git
- A code editor (VSCode recommended)
# 1. Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/File-Organizer-MCP.git
cd File-Organizer-MCP
# 2. Install dependencies
npm install
# 3. Build the project
npm run build
# 4. Run tests
npm testFile-Organizer-MCP/
├── src/
│ ├── services/ # Core business logic
│ ├── tools/ # MCP tool implementations
│ ├── utils/ # Helper functions
│ ├── schemas/ # Zod validation schemas
│ └── types.ts # TypeScript type definitions
├── tests/
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ └── performance/ # Performance benchmarks
└── dist/ # Compiled output
We use ESLint and Prettier for code formatting:
# Run linter
npm run lint
# Auto-fix linting issues
npm run lint:fix
# Format code
npm run format- Use strict type checking
- Avoid
any- use proper types - Document complex types with JSDoc comments
- Use ESM imports with
.jsextensions
- Files:
kebab-case.ts(e.g.,path-validator.service.ts) - Classes:
PascalCase(e.g.,PathValidatorService) - Functions:
camelCase(e.g.,validatePath) - Constants:
SCREAMING_SNAKE_CASE(e.g.,MAX_FILE_SIZE)
All new features and bug fixes must include tests:
import { jest } from '@jest/globals';
import { YourService } from '../src/services/your-service.js';
describe('YourService', () => {
it('should do something', () => {
const service = new YourService();
expect(service.doSomething()).toBe(expected);
});
});# Run all tests
npm test
# Run specific test file
npm test tests/unit/services/your-service.test.ts
# Run tests with coverage
npm run test:coverage- ✅ Unit tests for all service methods
- ✅ Integration tests for MCP tools
- ✅ Security tests for validation logic
- ✅ Edge case coverage
Always validate and sanitize user inputs:
// ✅ Good
const result = PathSchema.safeParse(inputPath);
if (!result.success) {
throw new ValidationError('Invalid path');
}
// ❌ Bad
const filePath = userInput; // No validationUse the PathValidatorService for all path operations:
// ✅ Good
import { validateStrictPath } from './services/path-validator.service.js';
const validPath = await validateStrictPath(userPath, allowedRoots);
// ❌ Bad
const fullPath = path.join(baseDir, userPath); // UnsafeNever expose internal paths in error messages:
// ✅ Good
throw new ValidationError('Path validation failed');
// ❌ Bad
throw new Error(`Invalid path: ${internalPath}`);Before starting work, create an issue describing:
- The problem or feature request
- Proposed solution (if applicable)
- Any breaking changes
# Create a feature branch
git checkout -b feature/amazing-feature
# Or a bugfix branch
git checkout -b fix/issue-123- Write clean, documented code
- Follow existing code style
- Add tests for new features
- Update documentation
# Run all tests
npm test
# Check linting
npm run lint
# Build the project
npm run buildUse conventional commit messages:
# Features
git commit -m "feat: add new categorization rule"
# Bug fixes
git commit -m "fix: resolve path traversal issue"
# Documentation
git commit -m "docs: update API reference"
# Tests
git commit -m "test: add edge case for organizer"git push origin feature/amazing-featureCreate a Pull Request with:
- Clear description of changes
- Link to related issue(s)
- Screenshots (if UI changes)
- Test results
- 🔒 Security enhancements and audits
- 🧪 Test coverage improvements
- 📚 Documentation improvements
- 🐛 Bug fixes
- Custom categorization rules UI
- Advanced duplicate detection algorithms
- Cloud storage integration
- Batch processing improvements
- Performance optimizations
Look for issues labeled good-first-issue - these are great starting points for new contributors.
Update relevant documentation when making changes:
- README.md - User-facing documentation
- ARCHITECTURE.md - Technical architecture
- JSDoc comments - In-code documentation
- CHANGELOG.md - Version history
Before submitting your PR, ensure:
- Code follows project style guidelines
- All tests pass (
npm test) - No linting errors (
npm run lint) - New tests added for new features
- Documentation updated
- Commit messages follow conventions
- PR description is clear and complete
- No merge conflicts
- Security implications considered
- Automated Checks - CI runs tests and linting
- Code Review - Maintainers review your code
- Feedback - Address any requested changes
- Approval - Once approved, PR will be merged
- Release - Changes included in next release
- Questions: Open a discussion on GitHub
- Issues: Check existing issues or create new one
- Email: technocratix902@gmail.com
Contributors will be recognized in:
- README.md acknowledgments
- CHANGELOG.md release notes
- GitHub contributors page
Thank you for contributing to File Organizer MCP! 🎉