AI-Powered-Task-Management-System-With-MCP-Server

Burak-Akca/AI-Powered-Task-Management-System-With-MCP-Server

3.3

If you are the rightful owner of AI-Powered-Task-Management-System-With-MCP-Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Model Context Protocol (MCP) server is designed to facilitate seamless integration and interaction between AI tools and applications, providing a robust framework for task management and automation.

Tools
  1. send_email

    Sends an email using Gmail's SMTP service.

  2. add_note

    Adds a new note with a title and optional content.

  3. list_notes

    Retrieves the most recent notes from the database.

  4. start_notes_app

    Starts the Django notes app via Docker and opens it in the browser.

šŸ¤– Personal Assistant - AI-Powered Task Management System With MCP Server

A comprehensive personal assistant built with Django, FastMCP, and Docker that provides intelligent task management, note-taking, email automation, weather updates, news aggregation, and reminder functionality.


✨ Features

šŸŽÆ Core Functionality

  • Smart Note Management āœ…: Create, list, and manage notes with automatic database handling
  • Email Automation āœ…: Send emails via SMTP with Gmail integration

Service API

  • News Aggregation šŸ”„: Fetch latest news headlines by category and country (Coming Soon)
  • Reminder System šŸ”„: Set time-based reminders with background processing (Coming Soon)
  • Weather Intelligence šŸ”„: Get detailed weather forecasts and alerts using National Weather (Coming Soon)

šŸ› ļø Technical Features

  • FastMCP Integration: Model Context Protocol for seamless AI tool interaction
  • PostgreSQL Database: Robust data persistence with automatic connection retry
  • Docker Compose: Multi-service orchestration with health checks
  • Async Operations: Non-blocking operations for better performance
  • Error Handling: Comprehensive error handling with graceful fallbacks

šŸ—ļø Architecture

System Components

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│   FastMCP       │    │   Django Web    │    │   PostgreSQL    │
│   Assistant     │◄──►│   Application   │◄──►│   Database      │
│   (Tools)       │    │   (Notes UI)    │    │   (Docker)      │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
         │                       │                       │
         │                       │                       │
         ā–¼                       ā–¼                       ā–¼
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│   External      │    │   Docker        │    │     Docker      │
│   APIs          │    │   Compose       │    │     Compose     │
│   (Gmail SMTP)  │    │  (Orchestration)│    │ (Orchestration) │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Tool Ecosystem

ToolFunctionStatusDescription
notes_tool.pyNote Managementāœ… ActiveCreate, list, and manage notes with web UI
email_tool.pyEmail Sendingāœ… ActiveSend emails via SMTP with async support
weather_tool.pyWeather DatašŸ”„ Coming SoonGet forecasts and alerts from NWS API
news_tool.pyNews HeadlinesšŸ”„ Coming SoonFetch news by category and country
reminder_tool.pyRemindersšŸ”„ Coming SoonSet time-based reminders

šŸš€ Quick Start

Prerequisites

1. Clone and Setup

git clone https://github.com/Burak-Akca/AI-Powered-Task-Management-System-With-MCP-Server
cd AI-Powered-Task-Management-System-With-MCP-Server

2. Environment Configuration

Create a .env file in the project root:

# Database Configuration
POSTGRES_DB=notedb
POSTGRES_USER=noter
POSTGRES_PASSWORD=noterpass
DB_NAME=notedb
DB_USER=noter
DB_PASSWORD=noterpass
DB_HOST=db
DB_PORT=5432

# Application Settings
DEBUG=True


3. Development Setup


# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Install MCP server (required for Claude integration)
uv run mcp install assistant.py

# Run Django migrations
docker compose exec web python manage.py migrate


# Access database (optinal)
docker compose exec db psql -U noter -d notedb




# Start all services
docker compose up --build -d


4. MCP Server Installation & Configuration

After installing dependencies in your virtual environment, run the MCP server installation command:

uv run mcp install assistant.py

This command performs the following operations to run assistant.py in an MCP-compatible manner:

  • Isolated Python Environment: Uses uv to run the MCP command in an isolated Python environment
  • MCP Server Registration: Applies the mcp install assistant.py command to load or register the MCP server within assistant.py
  • Automatic Configuration: Automatically registers the MCP server to your Claude configuration file
Manual Configuration (if needed)

If you encounter errors with the default configuration, manually update your Claude Desktop config file with the following:

{
  "mcpServers": {
    "personal_assistant": {
      "command": "uv",
      "args": [
        "--directory",
        "give project root directory path here",
        "run",
        "assistant.py"
      ]
    }
  }
}

Note: Replace "give project root directory path here" with your actual project root directory path.

5. Access the Application


šŸ› ļø Tool Usage

šŸ“ Notes Management āœ… Available Now

šŸ› ļø Tool: add_note

šŸ“Œ Description: Adds a new note with a title and optional content.

šŸ’¬ Example prompt:

Create a new note with the title "Meeting Summary" and the content "Discussed project deadlines and assigned tasks to the team."
# Add a new note
add_note(title="Meeting Notes", content="Important discussion points...")
šŸ› ļø Tool: list_notes

šŸ“Œ Description: Retrieves the most recent notes from the database.

šŸ’¬ Example prompt:

Show me the notes.
# List recent notes
list_notes(limit=10)
šŸ› ļø Tool: start_notes_app

šŸ“Œ Description: Starts the Django notes app via Docker and opens it in the browser.

šŸ’¬ Example prompt:

Start the notes application and open it in the browser.
# Start the notes web application
start_notes_app()

šŸ“§ Email Automation āœ… Available Now

šŸ› ļø Tool: send_email

šŸ“Œ Description: Sends an email using Gmail's SMTP service.

šŸ” Required fields:

  • to_email: Recipient's email address
  • subject: Subject of the email
  • body: The body content of the message
  • from_email: Sender's Gmail address
  • password: Gmail App Password (not your regular account password)

šŸ›”ļø Important: If you are using Gmail, you must generate an App Password and use that instead of your normal account password. This is required when two-factor authentication is enabled.

šŸ’¬ Example prompt:

Send an email to example@gmail.com with the subject "Weekly Sync" and the message "Meeting starts at 10 AM sharp." Use my Gmail address example@customdomain.com and the app password I provided.
# Send an email
send_email(
    to_email="recipient@example.com",
    subject="Important Update",
    body="This is the email content...",
    from_email="your-email@gmail.com",
    password="your-app-password"
)

šŸŒ¤ļø Weather Information šŸ”„ Coming Soon

# Get weather forecast
get_forecast(latitude=40.7128, longitude=-74.0060)

# Get weather alerts
get_alerts(state="NY")

šŸ“° News Headlines šŸ”„ Coming Soon

# Get general news
get_news_headlines(category="general", country="us")

# Get technology news
get_news_headlines(category="technology", country="us")

ā° Reminder System šŸ”„ Coming Soon

# Set a reminder
set_reminder(
    date="2024-01-15 14:30",
    message="Team meeting at 2:30 PM"
)

Service Management

# View logs
docker compose logs -f

# Restart services
docker compose restart

# Stop all services
docker compose down

# Rebuild and start
docker compose up --build -d

šŸ“ Project Structure

personal_assistant/
ā”œā”€ā”€ šŸ“„ assistant.py              # Main FastMCP assistant
ā”œā”€ā”€ šŸ“„ notes_tool.py             # Note management tools
ā”œā”€ā”€ šŸ“„ email_tool.py             # Email automation
ā”œā”€ā”€ šŸ“„ compose.yaml              # Docker Compose configuration
ā”œā”€ā”€ šŸ“„ requirements.txt          # Python dependencies
ā”œā”€ā”€ šŸ“„ Dockerfile                # Container configuration
ā”œā”€ā”€ šŸ“ src/                      # Django application
│   ā”œā”€ā”€ šŸ“ NoteApp/             # Django project settings
│   ā”œā”€ā”€ šŸ“ notes/               # Notes app
│   └── šŸ“„ manage.py            # Django management
ā”œā”€ā”€ šŸ“ utils/                    # Utility modules
│   └── šŸ“„ get_connection.py    # Database connection with retry
└── šŸ“„ README.md                 # This file

šŸ”Œ API Integration

FastMCP Protocol

The assistant uses the Model Context Protocol (MCP) for seamless AI integration with Claude and other MCP-compatible clients:

from mcp.server.fastmcp import FastMCP

mcp = FastMCP("personal_assistant")

# Register active tools
mcp.tool()(send_email)
mcp.tool()(add_note)
mcp.tool()(list_notes)
mcp.tool()(start_notes_app)

# Future tools (commented out for now)
# mcp.tool()(set_reminder)
# mcp.tool()(get_forecast)
# mcp.tool()(get_alerts)
# mcp.tool()(get_news_headlines)

External APIs

  • Gmail SMTP āœ…: Email sending capabilities (Currently Active)
  • National Weather Service šŸ”„: Free weather data and alerts (Coming Soon)
  • NewsAPI šŸ”„: News headlines and articles (Coming Soon)

🐳 Docker Configuration

Services

  • web: Django application (port 8001)
  • db: PostgreSQL database (port 5432)

Health Checks

healthcheck:
  test: ["CMD-SHELL", "pg_isready -U noter -d notedb"]
  interval: 5s
  timeout: 5s
  retries: 10

Networks

  • notenet: Internal network for service communication

šŸ”’ Security & Configuration

Environment Variables

  • Database credentials
  • API keys for external services
  • Debug settings

🚨 Troubleshooting

Common Issues

  1. Database Connection Failed

    # Check if database is running
    docker compose ps
    
    # View database logs
    docker compose logs db
    
  2. Port Already in Use

    # Check what's using the port (Windows)
    netstat -ano | findstr :8001
    
    # Check what's using the port (Linux/macOS)
    sudo netstat -tuln | grep 8001
    
    # Stop conflicting services
    docker compose down
    

šŸ“„ License

This project is licensed under the MIT License. See the file for details.


šŸ™ Acknowledgments

  • FastMCP: For the Model Context Protocol implementation
  • Django: For the web framework
  • PostgreSQL: For the database system
  • Docker: For containerization

šŸ“ž Support

  • Issues: GitHub Issues
  • Documentation: This README and inline code comments
  • Community: Check our

Made with ā¤ļø for intelligent task management and productivity enhancement.