file-extractor-mcp
Enables file extraction, organization, and GitHub repository management through MCP tools, allowing AI agents to copy/move files, delete repositories, and automate workflows.
README
🗂️ File Extractor MCP Server
Professional MCP server for file management and GitHub repository automation - Extract, organize, and manage files between directories with AI-powered tools. Developed by Javier Gomez.
🚀 Quick Start
Installation
git clone https://github.com/lalax-systems/file-extractor-mcp.git
cd file-extractor-mcp
npm install
npm run build
Configuration (Kilo Code)
Add to mcp_settings.json:
{
"mcpServers": {
"file-extractor": {
"command": "node",
"args": ["/path/to/file-extractor-mcp/build/index.js"],
"disabled": false
}
}
}
💡 Prompt Usage Examples
Example 1: Extract Photos
I need to backup all my photos. Please use the file-extractor MCP to:
Extract all JPG and PNG files from my camera folder to a backup directory:
- sourceDir: "/home/user/photos/camera"
- targetDir: "/home/user/backup/photos"
- pattern: "*.{jpg,png}"
- recursive: true
- move: false
- conflictResolution: "rename"
Example 2: Clean GitHub Repositories
I want to delete all my GitHub repositories except "file-extractor-mcp":
Use the delete_all_github_repositories_except tool with:
- token: "github_pat_..."
- username: "lalax-systems"
- keepRepository: "file-extractor-mcp"
- confirm: true
Example 3: Organize Downloads
My downloads folder is a mess. Please organize all files by extension:
Use the organize_files tool with:
- sourceDir: "/home/user/Downloads"
- organizeBy: "extension"
🔧 Available Tools
📁 File Management Tools
1. extract_files - Smart File Extraction
Extract files with pattern matching and conflict resolution.
Parameters:
sourceDir(string): Source directory pathtargetDir(string): Target directory pathpattern(string, optional): File pattern (e.g.,*.jpg,*.{txt,md})recursive(boolean, optional): Search subdirectories (default:true)move(boolean, optional): Move instead of copy (default:false)conflictResolution(string, optional):"skip","overwrite", or"rename"(default)
2. list_files - Directory Analysis
List files with filtering and detailed information.
Parameters:
directory(string): Directory to analyzepattern(string, optional): Filter patternrecursive(boolean, optional): Recursive listing (default:false)
3. organize_files - Automated Organization
Organize files by extension, date, or size.
Parameters:
sourceDir(string): Source directorytargetDir(string, optional): Target directory (default: same as source)organizeBy(string, optional):"extension"(default),"date", or"size"
🐙 GitHub Management Tools
4. list_github_repositories - Repository Listing
List all GitHub repositories for a user.
Parameters:
token(string): GitHub Personal Access Token (withreposcope)username(string, optional): GitHub username (default: authenticated user)
5. delete_github_repository - Single Repository Deletion
Delete a specific GitHub repository.
Parameters:
token(string): GitHub Personal Access Token (withreposcope)owner(string): Repository owner (user or organization)repo(string): Repository name to deleteconfirm(boolean): Must betrueto proceed (safety measure)
6. delete_all_github_repositories_except - Bulk Repository Cleanup
Delete all repositories except one specified repository.
Parameters:
token(string): GitHub Personal Access Token (withreposcope)username(string): GitHub usernamekeepRepository(string): Repository name to keep (not delete)confirm(boolean): Must betrueto proceed (safety measure)
⚠️ Important Security Notes
GitHub Token Requirements:
- Scope:
repo(full control of private repositories) - Permissions: Delete repositories
- Safety: Tokens should be kept secure and never shared
Deletion Safety Features:
- Confirmation Required:
confirm: trueparameter is mandatory - Selective Deletion: Can keep specific repositories
- Error Handling: Detailed error messages for failed operations
- Audit Trail: Returns detailed results of all operations
📊 Real-World Use Cases
🖼️ Photo Management
# Backup vacation photos
sourceDir: "/media/camera/DCIM/2025-vacation"
targetDir: "/cloud/backup/photos"
pattern: "*.{jpg,raw,cr2}"
recursive: true
🧹 GitHub Account Cleanup
# Keep only the main project
token: "github_pat_..."
username: "lalax-systems"
keepRepository: "file-extractor-mcp"
confirm: true
📁 Project Archive
# Archive old project files
sourceDir: "/projects/old-project"
targetDir: "/archive/projects"
pattern: "*.{log,tmp,bak}"
move: true
🛠️ Technical Features
- ✅ Recursive Operations: Process nested directories automatically
- ✅ Pattern Matching: Support for glob patterns (
*.jpg,*.{txt,md}) - ✅ Conflict Resolution: Skip, overwrite, or rename duplicate files
- ✅ GitHub Integration: Full repository management via Octokit
- ✅ Cross-Platform: Works on Windows, macOS, and Linux
- ✅ MCP Standard: Compatible with any MCP client
- ✅ TypeScript: Full type safety and modern development
- ✅ Safety First: Confirmation required for destructive operations
📋 Compatibility
✅ AI Agents
- Kilo Code
- Claude Desktop
- Cursor AI
- Any MCP-compatible AI agent
✅ VSCode Forks
- Cursor
- Windsurf
- Cline
- Any editor with MCP support
🏗️ Project Structure
file-extractor-mcp/
├── src/
│ └── index.ts # Core server implementation
├── build/
│ └── index.js # Compiled production code
├── docs/
│ ├── USAGE.md # Detailed usage guide
│ └── INSTALLATION.md # Installation instructions
├── package.json # Dependencies and metadata
├── tsconfig.json # TypeScript configuration
└── README.md # This documentation
🚀 Getting Started
1. Clone & Build
git clone https://github.com/lalax-systems/file-extractor-mcp.git
cd file-extractor-mcp
npm install
npm run build
2. Configure Your Client
Kilo Code: Edit ~/.config/Kilo-Code/mcp_settings.json
Cursor: Edit ~/.cursor/mcp.json
Windsurf: Edit ~/.windsurf/mcp.json
3. Start Using
The tools will be available in your AI agent's prompt interface.
🔍 Advanced Examples
GitHub Token Creation
- Go to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
- Generate new token with
reposcope (full control) - Copy the token and use it in the tools
Bulk Repository Management
# List all repositories first
token: "github_pat_..."
username: "lalax-systems"
# Then delete all except one
token: "github_pat_..."
username: "lalax-systems"
keepRepository: "file-extractor-mcp"
confirm: true
Automated Backup Script
# Daily backup script
sourceDir: "/important/documents"
targetDir: "/backup/daily-$(date +%Y%m%d)"
pattern: "*"
recursive: true
move: false
conflictResolution: "rename"
📈 Performance
- Fast: Uses Node.js streams for efficient file operations
- Reliable: Comprehensive error handling and logging
- Scalable: Handles thousands of files efficiently
- Safe: Non-destructive operations by default
- Secure: GitHub operations require explicit confirmation
🤝 Contributing
Contributions are welcome! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
📄 License
MIT License - Copyright (c) 2026 Javier Gomez
See LICENSE for full details.
🌐 Links
- Repository: https://github.com/lalax-systems/file-extractor-mcp
- Issues: https://github.com/lalax-systems/file-extractor-mcp/issues
- MCP Documentation: https://spec.modelcontextprotocol.io/
⚠️ Warning
GitHub repository deletion is permanent and irreversible. Use the deletion tools with extreme caution. Always:
- Backup important repositories
- Double-check repository names
- Use the
confirm: trueparameter carefully - Consider archiving instead of deleting
⭐ Show Your Support
If this project helps you, please give it a star on GitHub!
Built with ❤️ by Javier Gomez
Making file and repository management smarter with AI
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。