Integrates with OpenAI's GPT-4 API to enable natural language processing for file management commands, allowing the AI to interpret user requests and execute appropriate filesystem operations.
ποΈ MCP Filesystem Assistant
A beautiful AI-powered file manager built with Model Context Protocol (MCP), featuring a modern web interface, OpenAI integration, and secure filesystem operations.
π― What is This?
An AI assistant that can read, write, and manage your files through natural language. Built on the Model Context Protocol (MCP), it demonstrates how to:
π€ Connect AI models to real tools
π Safely manage files in a sandboxed environment
π¨ Build beautiful interfaces with Streamlit
π οΈ Create production-ready MCP servers
Perfect for learning MCP or building your own AI-powered tools!
β¨ Features
π¬ Natural Language Interface
Ask the AI to manage files in plain English:
"List all files in the workspace"
"Read notes.txt and summarize it"
"Create a backup folder and organize my files"
"Show me details about data.json"
π¨ Beautiful Web Interface
Chat Tab - Talk to the AI assistant
File Browser - Visual workspace explorer
Quick Actions - Direct file operations without AI
π οΈ 8 Powerful Tools
Tool | What it does |
| Read file contents |
| Create or overwrite files |
| Add to existing files |
| Remove files safely |
| Browse folders |
| Make new folders |
| Rename or relocate files |
| Show file details |
π Security First
All operations sandboxed to
workspace/folderPath traversal protection
Input validation on every operation
π Project Structure
π Quick Start
1. Install
2. Configure
Create a .env file:
Get your OpenAI API key from: https://platform.openai.com/api-keys
3. Run
Terminal 1 - Start MCP Server:
You should see:
Terminal 2 - Launch Web Interface:
Browser opens at http://localhost:8501 π
π‘ Usage Examples
Example 1: List Files
You: "What files are in the workspace?"
AI: Uses
Example 2: Create File
You: "Create a file called hello.txt with 'Hello World!'"
AI: Uses
Example 3: Organize Files
You: "Create a backup folder and move old files into it"
AI: Uses
ποΈ How It Works
π§ Configuration
Basic Settings (.env)
Advanced Settings (server/config.py)
π Troubleshooting
"Server Not Connected"
Check if MCP server is running (Terminal 1)
Click "Check Connection" button in sidebar
Restart both server and Streamlit
"OpenAI API Key Error"
Make sure
.envfile existsCheck your API key is correct
Restart Streamlit after updating
.env
"Port Already in Use"
"File Not Found"
Remember: All paths are relative to workspace/
π οΈ Development
Add a New Tool
Edit server/filesystem_mcp_server.py:
Restart the server - that's it! The tool is automatically available.
π€ Contributing
Contributions welcome! Here's how:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing)Make your changes
Test everything works
Submit a pull request
π Workshop Ready
This project is designed for learning and teaching:
β Clear, commented code
β Step-by-step setup
β Real-world example
β Production patterns
β Security best practices
Perfect for:
Learning MCP architecture
Building AI tools
Teaching modern Python
Prototyping ideas
Happy building! π