AI File Assistant MCP
README.md
# AI File Assistant MCP Server
An MCP (Model Context Protocol) server that provides AI-powered file operations: read, write, search, edit, and manage files.
Also includes a **Flask web app** with a full file manager, user management, and admin panel.
## Features
### MCP Server (`server.py`)
- **Read** files with line numbers
- **Write** files with automatic directory creation
- **Edit** files via exact string replacement
- **Search** file contents using regex
- **Glob** file patterns for discovery
- **List** directories
- **Move** files
- **Copy** files
- **Delete** files
- **Get** file metadata
### Web App (`app.py`)
- **File Manager** - Browse, upload, download, preview, search, and delete files via browser
- **File Preview** - View text, images, audio, and video files inline
- **Search** - Search file names and content directly from the web UI
- **User Authentication** - Register, login, profile management
- **Admin Panel** - Manage users (activate/deactivate, promote, delete)
- **Activity Dashboard** - Charts showing daily activity and action breakdown
- **File Stats** - Track file count and storage usage per user
- **Rate Limiting** - Login brute force protection
- **Drag & Drop Upload** - Upload multiple files with drag and drop
## Installation
```bash
pip install -r requirements.txt
```
## Configuration
Copy `.env` (already provided) and customize:
| Variable | Default | Description |
|----------|---------|-------------|
| `SECRET_KEY` | (auto-generated) | Flask session secret key |
| `ADMIN_PASSWORD` | `admin123` | Default admin password |
| `ADMIN_EMAIL` | `admin@fileassistant.local` | Default admin email |
| `FLASK_PORT` | `5000` | Web server port |
| `UPLOAD_FOLDER` | `./uploads` | File storage directory |
| `MAX_UPLOAD_SIZE` | `50` | Max upload size in MB |
## Usage
### MCP Server (stdio)
```bash
python server.py
```
For development mode with MCP Inspector:
```bash
python server.py dev
```
### Web App
```bash
python app.py
```
Open `http://localhost:5000` in your browser.
### MCP Client Example
```bash
python client.py
```
## Testing
```bash
python tests.py
```
## Default Admin Credentials
- **Username:** admin
- **Password:** admin123
This server cannot be deployed
Maintenance
ActivitySlowing
ResponsivenessNo issues