Smart File Organizer MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Smart File Organizer MCP ServerOrganize my Downloads folder, dry run first."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Day 3 — Smart File Organizer (MCP Tool Server)
Welcome to Day 3 of your 7-Day Project! Today, you are building a Smart File Organizer and wrapping it as a Model Context Protocol (MCP) Server.
This document explains what MCP is, how your organizer works, and how to test and run it as an AI-callable tool.
💡 What is MCP (Model Context Protocol)?
Traditionally, AI models (like Claude, ChatGPT, or Gemini) are locked inside their chat boxes. They cannot access your local files or run scripts on your computer unless the application hosting them specifically builds a custom feature.
Model Context Protocol (MCP) is an open standard created by Anthropic. It acts like a USB port for AI:
MCP Client: The AI chat application (e.g., Claude Desktop, Cursor IDE).
MCP Server: A background program (written in Python, Node.js, etc.) that exposes local resources, prompts, or executable Tools.
Protocol: The AI can query the server to ask "What tools do you have?" and then "Call tool
organize_directorywith parameterdirectory_path."
Today, you are building an MCP Server that exposes your file organizer as a tool, allowing an AI assistant to manage your directories for you!
Related MCP server: File Manage MCP Server
📁 Project Structure
Here is what we have built in this directory:
organizer.py: The core script that does the file sorting. It can be run by itself from the command line.server.py: The MCP server code that wrapsorganizer.pyusingFastMCP.test_env_setup.py: A helper script that creates a safetest_downloads/folder full of dummy files so you can test without touching your real files.requirements.txt: The dependencies (mcp,fastmcp) needed to run the server.
🚀 How to Run and Test
Follow these steps to learn and run the project:
Step 1: Set up the environment
Make sure you have created your virtual environment and installed the dependencies:
# Create a virtual environment
python -m venv .venv
# Activate it (Windows PowerShell)
.venv\Scripts\Activate.ps1
# Install requirements
pip install -r requirements.txtStep 2: Generate mock files for testing
Before organizing your actual files, run the generator script. This creates a folder named test_downloads/ with dummy files (.jpg, .pdf, .mp4, etc.):
python test_env_setup.pyStep 3: Run the organizer manually (CLI)
You can run the organizer directly. Let's start with a Dry Run (simulation) so it won't actually move anything:
python organizer.py test_downloads --dry-runOnce you verify that it lists the correct folders and destinations, run it for real:
python organizer.py test_downloadsCheck your test_downloads/ folder. You will see that subfolders like Images, Documents, and Videos have been created, and files have been successfully sorted into them!
🔍 Testing the MCP Server (The AI Interface)
MCP servers communicate over standard input/output (stdio) using JSON-RPC, so running python server.py directly in the terminal will look like it's frozen.
To test it visually, we use the MCP Inspector, an official web UI wrapper:
# Run this inside your Day 3 directory
npx @modelcontextprotocol/inspector .venv\Scripts\python.exe server.pyWhat happens: This command starts your server and launches a web browser window (usually at
http://localhost:5173or similar).What to look for:
Click the Tools tab. You should see
analyze_directoryandorganize_directorylisted!Select
analyze_directoryand enter the path of yourtest_downloadsfolder (e.g.,C:/Users/user/Desktop/7 day project/Day 3/test_downloads). Click Run.You will see the AI-friendly textual response summarizing the files.
Now try
organize_directorywithdry_run = TrueorFalse. Watch the directory tidy up!
🤖 Connecting to Your AI Clients
Once your server works, you can add it to your daily AI editors so they can call it.
1. Claude Desktop
Open your Claude Desktop configuration file (typically at %APPDATA%\Claude\claude_desktop_config.json) and add your server:
{
"mcpServers": {
"smart-file-organizer": {
"command": "C:/Users/user/Desktop/7 day project/Day 3/.venv/Scripts/python.exe",
"args": [
"C:/Users/user/Desktop/7 day project/Day 3/server.py"
]
}
}
}(Make sure to replace the paths above with the actual absolute paths on your computer!)
Restart Claude Desktop, and you will see an organizer tool icon. You can now type: "Organize my downloads folder"!
2. Cursor IDE
Open Cursor Settings -> Features -> MCP.
Click + Add New MCP Server.
Fill in the fields:
Name: Smart File Organizer
Type:
commandCommand:
C:/Users/user/Desktop/7 day project/Day 3/.venv/Scripts/python.exe "C:/Users/user/Desktop/7 day project/Day 3/server.py"
Save and click Refresh. Your Cursor AI agent can now use this tool during chat!
🎯 What You Learned Today
Separation of Concerns: Keeping your core logic (
organizer.py) separate from your communication logic (server.py).Model Context Protocol (MCP): How to let LLMs access local capabilities via stdio JSON-RPC.
Safe CLI Design: Using dry-runs and safe file naming to prevent data loss.
Log redirection: Why outputting logs to
sys.stderris critical when standard output (stdout) is used for data transmission.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/chenjunwei1230-dotcom/smart-file-organizer-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server