Skip to main content

AI-powered task management system with MCP (Model Context Protocol) integration for seamless workflow automation

Project description

๐Ÿค– PyTaskAI

PyTaskAI รจ un sistema avanzato di gestione task AI-powered che combina intelligenza artificiale, ricerca attiva e interfacce moderne per la gestione progetti professionale con integrazione MCP (Model Context Protocol).

โœจ Caratteristiche Principali

  • ๐Ÿค– AI-Powered Task Generation: Genera task dettagliati da PRD usando LiteLLM multi-provider
  • ๐Ÿ” Ricerca Attiva LTS: Trova automaticamente versioni LTS e best practices aggiornate
  • ๐ŸŒ Frontend Streamlit: Interfaccia web moderna per gestione completa dei task
  • ๐Ÿ’ฐ Token & Cost Tracking: Monitoring completo usage e costi AI con controlli budget
  • ๐Ÿ”ง Claude Code Integration: Setup automatico per Claude Code con supporto MCP
  • ๐Ÿ“Š MCP Server Tools: Server FastMCP con tool completi per integrazione IDE
  • ๐Ÿš€ Workflow Agentico: Processo AI intelligente con ricerca e generazione ottimizzata

๐ŸŽฏ Workflow Intelligente

  1. ๐Ÿ“‹ PRD Analysis: Analizza Product Requirements Document
  2. ๐Ÿ” Research Phase: Ricerca attiva di versioni LTS e best practices via Perplexity
  3. ๐Ÿค– AI Generation: Genera task dettagliati integrando ricerca e context
  4. ๐Ÿ“ Task Management: Gestisce task con UI web completa e tool MCP
  5. ๐Ÿ’ธ Cost Optimization: Traccia e ottimizza costi AI con cache intelligente

๐Ÿš€ Quick Start

1. Installazione

# Clona il repository
git clone https://github.com/mak1jk/pytaskai-public.git
cd pytaskai

# Installa dipendenze
pip install -e .

# Oppure installa dalla PyPI (quando pubblicato)
pip install pytaskai

2. Configurazione API Keys

PyTaskAI supporta multiple provider AI. Configura almeno uno di questi:

# Crea file .env per API keys
cat > .env << EOF
# OpenAI (Raccomandato per iniziare)
OPENAI_API_KEY=your-openai-api-key-here

# Anthropic (Per Claude models)
ANTHROPIC_API_KEY=your-anthropic-api-key-here

# Perplexity (Per ricerca web e LTS research)
PERPLEXITY_API_KEY=your-perplexity-api-key-here

# Google AI (Opzionale)
GOOGLE_API_KEY=your-google-api-key-here

# xAI (Opzionale)
XAI_API_KEY=your-xai-api-key-here
EOF

API Key Setup:

3. Configurazione MCP (Per Claude Code)

Aggiungi PyTaskAI al tuo MCP configuration file:

{
  "servers": {
    "pytaskai": {
      "command": "python",
      "args": ["-m", "mcp_server"],
      "cwd": "/path/to/your/pytaskai-project",
      "env": {
        "OPENAI_API_KEY": "your-openai-key-here",
        "ANTHROPIC_API_KEY": "your-anthropic-key-here",
        "PERPLEXITY_API_KEY": "your-perplexity-key-here",
        "PYTASKAI_DEFAULT_MODEL": "gpt-4o-mini",
        "PYTASKAI_RESEARCH_MODEL": "perplexity/llama-3.1-sonar-small-128k-online",
        "PYTHONPATH": "/path/to/your/pytaskai-project"
      }
    }
  }
}

Oppure usa il comando Claude Code:

claude mcp add pytaskai -s user -- python -m mcp_server \
  --cwd "/path/to/your/pytaskai-project" \
  --env PYTASKAI_DEFAULT_MODEL="your-preferred-model" \
  PYTHONPATH="/path/to/your/pytaskai-project"

Vedi MCP_CONFIGURATION.md per configurazione completa.

4. Primo Task da PRD

# Crea un nuovo progetto
mkdir my-project && cd my-project

# Inizializza PyTaskAI
pytaskai init

# Crea un PRD (o usa l'esempio)
cp scripts/example_prd.txt .pytaskai/docs/prd.txt

# Genera task automaticamente dal PRD
pytaskai parse-prd --research --target-tasks 10

5. Avvia UI Streamlit

# Avvia l'interfaccia web
python3 run_streamlit.py

# Oppure direttamente con streamlit
streamlit run frontend/streamlit_app.py

Apri http://localhost:8501 per accedere alla UI!

๐Ÿ“š Utilizzo

Frontend Streamlit

Il frontend offre 4 sezioni principali:

๐Ÿ“‹ PRD Parser

  • Input PRD: Incolla testo o carica file .txt/.md
  • Configurazione AI:
    • Target task count (1-50)
    • Enable AI research (piรน lento ma dettagliato)
    • Prefer LTS dependencies (raccomandato)
    • Overwrite existing tasks
  • Generazione: Automatica con AI e validazione

๐Ÿ“ Task Management

  • Lista Task: Visualizzazione completa con filtri
  • Filtri: Status (pending/in-progress/done) e Priority (high/medium/low)
  • Statistiche: Metrics real-time del progetto
  • Selezione: Click per visualizzare dettagli

๐Ÿค– AI Assistant

  • Chat Custom: Descrivi cosa vuoi accomplire
  • Configurazione: Research, LTS deps, priority
  • Generazione: Task custom via AI conversation
  • Preview: Visualizzazione dettagliata del task generato

๐Ÿ” Task Details

  • Vista Completa: Descrizione, details, test strategy
  • Dipendenze: Relazioni tra task
  • Subtask: Lista subtask con status
  • Metadata: Date, complessitร , stime ore

Tool MCP Disponibili

PyTaskAI fornisce i seguenti tool MCP per integrazione IDE:

  • list_tasks_tool: Lista tutti i task del progetto
  • get_task_tool: Ottieni dettagli task specifico
  • get_next_task_tool: Trova prossimo task da fare
  • parse_prd_tool: Genera task da PRD
  • validate_tasks_tool: Valida struttura task
  • init_claude_support_tool: Setup Claude Code integration

Command Line Interface

# Inizializza nuovo progetto
pytaskai init [directory]

# Genera task da PRD  
pytaskai parse-prd [--research] [--target-tasks N]

# Lista task
pytaskai list [--status STATUS] [--priority PRIORITY]

# Ottieni prossimo task
pytaskai next

# Valida task structure
pytaskai validate

# Setup Claude Code integration
pytaskai init-claude

๐Ÿ”ง Configurazione Avanzata

Modelli AI

Configura modelli specifici per diversi use case:

# Configurazione modelli via environment variables
export PYTASKAI_DEFAULT_MODEL="gpt-4o-mini"           # Task generation standard
export PYTASKAI_RESEARCH_MODEL="perplexity/llama-3.1-sonar-small-128k-online"  # Research web
export PYTASKAI_LTS_MODEL="anthropic/claude-3-haiku-20240307"  # LTS research
export PYTASKAI_FALLBACK_MODEL="gpt-3.5-turbo"       # Fallback model

Configurazioni Preset

Budget-Friendly Setup

export PYTASKAI_DEFAULT_MODEL="gpt-4o-mini"
export PYTASKAI_RESEARCH_MODEL="gpt-4o-mini" 
export PYTASKAI_LTS_MODEL="gpt-4o-mini"

High-Quality Setup

export PYTASKAI_DEFAULT_MODEL="gpt-4o"
export PYTASKAI_RESEARCH_MODEL="perplexity/llama-3.1-sonar-large-128k-online"
export PYTASKAI_LTS_MODEL="anthropic/claude-3-sonnet-20240229"

Claude-Focused Setup

export PYTASKAI_DEFAULT_MODEL="anthropic/claude-3-haiku-20240307"
export PYTASKAI_RESEARCH_MODEL="anthropic/claude-3-sonnet-20240229"
export PYTASKAI_LTS_MODEL="anthropic/claude-3-haiku-20240307"

๐Ÿ—๏ธ Architettura

Core Components

PyTaskAI/
โ”œโ”€โ”€ mcp_server/              # MCP Server e AI Service
โ”‚   โ”œโ”€โ”€ ai_service.py        # LiteLLM multi-provider AI
โ”‚   โ”œโ”€โ”€ task_manager.py      # FastMCP tools
โ”‚   โ”œโ”€โ”€ prompts/             # Sistema prompt centralizzati  
โ”‚   โ””โ”€โ”€ utils.py             # Utilities shared
โ”œโ”€โ”€ frontend/                # Streamlit UI
โ”‚   โ”œโ”€โ”€ streamlit_app.py     # Main UI application
โ”‚   โ””โ”€โ”€ components/          # UI components
โ”œโ”€โ”€ shared/                  # Modelli e schemas
โ”‚   โ”œโ”€โ”€ models.py            # Pydantic models
โ”‚   โ””โ”€โ”€ schemas.py           # JSON schemas
โ””โ”€โ”€ tasks/                   # Task storage
    โ””โ”€โ”€ tasks.json           # Task database

AI Service Architecture

Il sistema AI utilizza un approccio agentico sofisticato:

  1. Research Phase (Opzionale):

    • Estrae tecnologie dal prompt utente
    • Ricerca versioni LTS correnti via Perplexity
    • Identifica best practices pertinenti
  2. Generation Phase:

    • Integra research findings nel context
    • Genera task dettagliati con prompt engineering
    • Valida output con JSON schema
  3. Cost Optimization:

    • Cache intelligente per research results
    • Model selection basata su use case
    • Token usage tracking e budgeting

๐Ÿงช Testing

Test Streamlit App

# Test logica app (senza dipendenze)
python3 test_streamlit_logic.py

# Test completo (richiede dipendenze)
python3 test_streamlit_basic.py

Test MCP Tools

# Test tool MCP individuali
python3 test_task7.py

# Test integrazione completa
python3 test_task18_simple.py

Test AI Service

# Test AI service e prompts
python3 test_task5_aiservice.py

# Test modelli Pydantic
python3 tests/test_models.py

๐Ÿ› Troubleshooting

Problemi Comuni

Errore "No module named 'streamlit'":

pip install streamlit>=1.28.0

Errore "No module named 'fastmcp'":

pip install fastmcp>=0.4.0

Errore API Key:

# Verifica API keys
echo $OPENAI_API_KEY
echo $ANTHROPIC_API_KEY

# Test API key
curl -H "Authorization: Bearer $OPENAI_API_KEY" https://api.openai.com/v1/models

Tasks non si caricano:

# Verifica struttura progetto
ls -la .pytaskai/
ls -la tasks/tasks.json

# Reinizializza se necessario  
pytaskai init --force

MCP Server non risponde:

# Test connessione MCP
python -m pytaskai.mcp_server --test

# Verifica configurazione Claude Code
cat ~/.config/claude-code/mcp_settings.json

Debug Mode

Abilita logging dettagliato:

import logging
logging.basicConfig(level=logging.DEBUG)

O via environment variable:

export PYTASKAI_LOG_LEVEL=DEBUG

๐Ÿ“– Documentazione Completa

๐Ÿค Contribuire

Setup Sviluppo

# Clone e setup
git clone https://github.com/mak1jk/pytaskai-public.git
cd pytaskai

# Install in development mode
pip install -e ".[dev]"

# Setup pre-commit hooks
pre-commit install

# Run tests
pytest tests/

Linee Guida

  1. Code Style: Usa black e isort per formatting
  2. Testing: Aggiungi test per nuove funzionalitร 
  3. Documentation: Aggiorna documentazione per modifiche API
  4. Type Hints: Usa typing completo per tutto il codice
  5. MCP Tools: Nuovi tool devono seguire pattern FastMCP

Aree di Contribuzione

  • ๐Ÿงช Testing: Aggiungi test cases e edge cases
  • ๐Ÿ“š Documentation: Migliora guide e tutorials
  • ๐ŸŽจ UI/UX: Enhance Streamlit interface
  • ๐Ÿค– AI Integration: Nuovi provider AI e prompt optimization
  • ๐Ÿ”ง MCP Tools: Nuovi tool per workflow specifici
  • ๐Ÿ“Š Analytics: Metrics e monitoring avanzati

๐Ÿ“„ License

PyTaskAI is licensed under the MIT License with Commons Clause. This means you can:

โœ… Allowed:

  • Use PyTaskAI for any purpose (personal, commercial, academic)
  • Modify the code
  • Distribute copies
  • Create and sell products built using PyTaskAI

โŒ Not Allowed:

  • Sell PyTaskAI itself
  • Offer PyTaskAI as a hosted service
  • Create competing products based on PyTaskAI

See the LICENSE.md file for the complete license text and licensing details.

๐Ÿ™ Ringraziamenti

  • Anthropic per Claude AI e MCP protocol
  • OpenAI per GPT models e API
  • Perplexity per ricerca web real-time
  • Streamlit per framework UI
  • LiteLLM per multi-provider AI integration
  • FastMCP per MCP server implementation
  • Claude Task Master per l'ispirazione iniziale

Costruito con โค๏ธ per automatizzare la gestione progetti con AI

๐Ÿš€ Get Started Now | ๐Ÿ“š Frontend Guide | ๐Ÿ› Report Bug | ๐Ÿ’ฌ Discussions

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytaskai-0.2.0.tar.gz (180.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytaskai-0.2.0-py3-none-any.whl (140.9 kB view details)

Uploaded Python 3

File details

Details for the file pytaskai-0.2.0.tar.gz.

File metadata

  • Download URL: pytaskai-0.2.0.tar.gz
  • Upload date:
  • Size: 180.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pytaskai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fbc3d312c3483ae7c6424a54e6b9331483cf3a11d9a63275f481de2d1e577891
MD5 2d7f84109e092faa01e08039ee5adf16
BLAKE2b-256 f3caeeadfcf57f3fb774f8b89dbdc791f56e4ac5516b428ccda859861b8d25f5

See more details on using hashes here.

File details

Details for the file pytaskai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pytaskai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 140.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pytaskai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7ae6583bc19b1598e8d77eda0852c70f8c64120881023591c649c05abcc34ae
MD5 cbc2d2e1af97c85d11742138f03f9488
BLAKE2b-256 84d657a88673ecf8185627d2df087cd3c80193987ffded4fc4cd074f7169627a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page