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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.