AlBaraa63 commited on
Commit
2526bcc
Β·
verified Β·
1 Parent(s): 3708893

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +406 -95
app.py CHANGED
@@ -305,67 +305,234 @@ def load_sample_json():
305
  # GRADIO INTERFACE
306
  # ============================================================================
307
 
308
- # Custom CSS
309
  custom_css = """
 
 
310
  .gradio-container {
311
- font-family: 'Arial', sans-serif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  }
313
- .tab-label {
 
 
 
 
 
 
 
 
314
  font-size: 16px !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  }
316
  """
317
 
318
  # Create Gradio interface
319
  with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, title="MissionControlMCP Demo") as demo:
320
 
321
- gr.Markdown("""
322
- # πŸš€ MissionControlMCP - Enterprise Automation Tools
323
-
324
- **Try all 8 powerful tools in your browser!** No installation needed.
325
 
326
- πŸ“Œ Built for the HuggingFace Gradio Hackathon | πŸ† Claude MCP Integration
 
 
 
 
327
  """)
328
 
329
  with gr.Tabs():
330
 
331
  # ====== TAB 1: PDF READER ======
332
  with gr.Tab("πŸ“„ PDF Reader"):
333
- gr.Markdown("### Extract text and metadata from PDF documents")
 
 
 
334
 
335
  with gr.Row():
336
- with gr.Column():
337
- pdf_input = gr.File(label="Upload PDF", file_types=[".pdf"])
338
- pdf_btn = gr.Button("πŸ” Extract Text", variant="primary")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
 
340
- with gr.Column():
341
- pdf_output = gr.Textbox(label="Results", lines=15)
 
 
 
 
342
  pdf_img = gr.Image(label="Preview", visible=False)
343
 
344
  pdf_btn.click(tool_pdf_reader, inputs=[pdf_input], outputs=[pdf_output, pdf_img])
345
 
346
- gr.Examples([["Use the file upload above to try with your own PDF!"]], inputs=[])
347
 
348
  # ====== TAB 2: TEXT EXTRACTOR ======
349
  with gr.Tab("πŸ“ Text Extractor"):
350
- gr.Markdown("### Extract keywords, generate summaries, clean text")
 
 
 
351
 
352
  with gr.Row():
353
- with gr.Column():
354
  text_input = gr.Textbox(
355
- label="Enter Text",
356
- lines=8,
357
- placeholder="Paste your text here..."
 
358
  )
359
  text_operation = gr.Radio(
360
  ["keywords", "summarize", "clean", "chunk"],
361
- label="Operation",
362
- value="keywords"
 
 
 
 
 
 
 
 
 
 
 
 
363
  )
364
- text_length = gr.Slider(100, 1000, 300, label="Max Length (for summarize/chunk)")
365
- text_btn = gr.Button("✨ Process Text", variant="primary")
366
 
367
- with gr.Column():
368
- text_output = gr.Textbox(label="Results", lines=15)
 
 
 
 
369
 
370
  text_btn.click(
371
  tool_text_extractor,
@@ -376,23 +543,43 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, title="MissionControlMCP
376
  gr.Examples([
377
  ["Artificial Intelligence is transforming businesses worldwide. Companies are leveraging AI for automation, decision-making, and customer service. Machine learning models can now process vast amounts of data and provide actionable insights.", "keywords", 300],
378
  ["Climate change is one of the most pressing challenges of our time. Rising temperatures, extreme weather events, and environmental degradation require urgent action.", "summarize", 300]
379
- ], inputs=[text_input, text_operation, text_length])
380
 
381
  # ====== TAB 3: WEB FETCHER ======
382
  with gr.Tab("🌐 Web Fetcher"):
383
- gr.Markdown("### Scrape and analyze web content")
 
 
 
384
 
385
  with gr.Row():
386
- with gr.Column():
387
  web_input = gr.Textbox(
388
- label="Website URL",
389
  placeholder="https://example.com",
390
- value="https://example.com"
 
 
 
 
 
 
 
391
  )
392
- web_btn = gr.Button("🌐 Fetch Website", variant="primary")
 
 
 
 
 
 
393
 
394
- with gr.Column():
395
- web_output = gr.Textbox(label="Results", lines=15)
 
 
 
 
396
 
397
  web_btn.click(tool_web_fetcher, inputs=[web_input], outputs=[web_output])
398
 
@@ -400,23 +587,44 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, title="MissionControlMCP
400
  ["https://example.com"],
401
  ["https://python.org"],
402
  ["https://github.com"]
403
- ], inputs=[web_input])
404
 
405
  # ====== TAB 4: RAG SEARCH ======
406
  with gr.Tab("πŸ” RAG Search"):
407
- gr.Markdown("### Semantic document search with AI embeddings")
 
 
 
408
 
409
  with gr.Row():
410
- with gr.Column():
411
  rag_input = gr.Textbox(
412
- label="Search Query",
413
  placeholder="What are you looking for?",
414
- value="What is machine learning?"
 
 
 
 
 
 
 
 
415
  )
416
- rag_btn = gr.Button("πŸ” Search Documents", variant="primary")
 
 
 
 
 
 
417
 
418
- with gr.Column():
419
- rag_output = gr.Textbox(label="Search Results", lines=15)
 
 
 
 
420
 
421
  rag_btn.click(tool_rag_search, inputs=[rag_input], outputs=[rag_output])
422
 
@@ -425,56 +633,98 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, title="MissionControlMCP
425
  ["How to reduce carbon emissions?"],
426
  ["What are modern web frameworks?"],
427
  ["Digital marketing strategies"]
428
- ], inputs=[rag_input])
429
 
430
  # ====== TAB 5: DATA VISUALIZER ======
431
  with gr.Tab("πŸ“Š Data Visualizer"):
432
- gr.Markdown("### Create beautiful charts from CSV data")
 
 
 
433
 
434
  with gr.Row():
435
- with gr.Column():
436
  viz_csv = gr.Textbox(
437
- label="CSV Data",
438
- lines=8,
439
  value=load_sample_csv(),
440
- placeholder="month,revenue,costs\nJan,100000,60000"
 
441
  )
442
  viz_chart = gr.Radio(
443
  ["line", "bar", "pie", "scatter"],
444
- label="Chart Type",
445
- value="line"
 
 
 
 
 
 
 
 
 
 
446
  )
447
- viz_x = gr.Textbox(label="X Column", value="month")
448
- viz_y = gr.Textbox(label="Y Column", value="revenue")
449
- viz_title = gr.Textbox(label="Chart Title", value="Monthly Revenue")
450
- viz_btn = gr.Button("πŸ“Š Create Chart", variant="primary")
451
 
452
- with gr.Column():
453
- viz_output = gr.Textbox(label="Status", lines=5)
454
- viz_img = gr.Image(label="Chart")
 
 
 
 
455
 
456
  viz_btn.click(
457
  tool_data_visualizer,
458
  inputs=[viz_csv, viz_chart, viz_x, viz_y, viz_title],
459
  outputs=[viz_output, viz_img]
460
  )
 
 
461
 
462
  # ====== TAB 6: EMAIL CLASSIFIER ======
463
  with gr.Tab("πŸ“§ Email Classifier"):
464
- gr.Markdown("### Detect email intent with AI")
 
 
 
465
 
466
  with gr.Row():
467
- with gr.Column():
468
  email_input = gr.Textbox(
469
- label="Email Text",
470
- lines=10,
471
  value=load_sample_email(),
472
- placeholder="Paste email content here..."
 
473
  )
474
- email_btn = gr.Button("🎯 Classify Email", variant="primary")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
475
 
476
- with gr.Column():
477
- email_output = gr.Textbox(label="Classification Results", lines=15)
 
 
 
 
478
 
479
  email_btn.click(tool_email_classifier, inputs=[email_input], outputs=[email_output])
480
 
@@ -482,56 +732,117 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, title="MissionControlMCP
482
  ["I am writing to complain about the poor service I received at your store yesterday."],
483
  ["Could you please send me more information about your pricing plans?"],
484
  ["URGENT: The server is down and customers cannot access the website!"]
485
- ], inputs=[email_input])
486
 
487
  # ====== TAB 7: KPI GENERATOR ======
488
  with gr.Tab("πŸ“ˆ KPI Generator"):
489
- gr.Markdown("### Calculate business metrics and KPIs")
 
 
 
490
 
491
  with gr.Row():
492
- with gr.Column():
493
  kpi_json = gr.Textbox(
494
- label="Business Data (JSON)",
495
- lines=12,
496
  value=load_sample_json(),
497
- placeholder='{"revenue": 1000000, "costs": 600000}'
 
498
  )
499
  kpi_metrics = gr.CheckboxGroup(
500
  ["revenue", "growth", "efficiency", "customer", "operational"],
501
- label="Metrics to Calculate",
502
- value=["revenue", "growth", "efficiency"]
 
 
 
 
 
 
 
503
  )
504
- kpi_btn = gr.Button("πŸ“ˆ Generate KPIs", variant="primary")
 
 
 
 
 
 
 
 
505
 
506
- with gr.Column():
507
- kpi_output = gr.Textbox(label="KPI Report", lines=20)
 
 
 
 
508
 
509
  kpi_btn.click(
510
  tool_kpi_generator,
511
  inputs=[kpi_json, kpi_metrics],
512
  outputs=[kpi_output]
513
  )
 
 
514
 
515
  # Footer
516
- gr.Markdown("""
517
- ---
518
-
519
- ### 🎯 About MissionControlMCP
520
-
521
- 8 enterprise-grade automation tools integrated with Claude Desktop via Model Context Protocol (MCP).
522
-
523
- - **PDF Reader** - Extract text from documents
524
- - **Text Extractor** - Keywords, summaries, cleaning
525
- - **Web Fetcher** - Scrape websites
526
- - **RAG Search** - Semantic document search
527
- - **Data Visualizer** - Create charts
528
- - **File Converter** - Format conversions
529
- - **Email Classifier** - Intent detection
530
- - **KPI Generator** - Business analytics
531
-
532
- πŸ”— **GitHub:** [AlBaraa-1/CleanEye-Hackathon](https://github.com/AlBaraa-1/CleanEye-Hackathon)
533
-
534
- πŸ† Built for HuggingFace Gradio x BuildWithMCP Hackathon
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
535
  """)
536
 
537
 
 
305
  # GRADIO INTERFACE
306
  # ============================================================================
307
 
308
+ # Custom CSS for beautiful UI
309
  custom_css = """
310
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
311
+
312
  .gradio-container {
313
+ font-family: 'Inter', sans-serif !important;
314
+ max-width: 1400px !important;
315
+ margin: 0 auto !important;
316
+ }
317
+
318
+ /* Header styling */
319
+ .gradio-container h1 {
320
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
321
+ -webkit-background-clip: text;
322
+ -webkit-text-fill-color: transparent;
323
+ background-clip: text;
324
+ font-size: 3em !important;
325
+ font-weight: 700 !important;
326
+ text-align: center;
327
+ margin-bottom: 0.5em;
328
+ }
329
+
330
+ /* Tab styling */
331
+ .tab-nav {
332
+ border-radius: 12px !important;
333
+ background: linear-gradient(to right, #f8f9fa, #e9ecef) !important;
334
+ padding: 8px !important;
335
+ margin-bottom: 20px !important;
336
+ }
337
+
338
+ button.selected {
339
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
340
+ color: white !important;
341
+ border-radius: 8px !important;
342
+ font-weight: 600 !important;
343
+ box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
344
  }
345
+
346
+ /* Button styling */
347
+ .primary-btn {
348
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
349
+ border: none !important;
350
+ color: white !important;
351
+ font-weight: 600 !important;
352
+ border-radius: 10px !important;
353
+ padding: 12px 24px !important;
354
  font-size: 16px !important;
355
+ transition: all 0.3s ease !important;
356
+ box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4) !important;
357
+ }
358
+
359
+ .primary-btn:hover {
360
+ transform: translateY(-2px) !important;
361
+ box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6) !important;
362
+ }
363
+
364
+ /* Input fields */
365
+ textarea, input[type="text"] {
366
+ border-radius: 10px !important;
367
+ border: 2px solid #e9ecef !important;
368
+ padding: 12px !important;
369
+ font-size: 15px !important;
370
+ transition: border-color 0.3s ease !important;
371
+ }
372
+
373
+ textarea:focus, input[type="text"]:focus {
374
+ border-color: #667eea !important;
375
+ box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
376
+ }
377
+
378
+ /* Output boxes */
379
+ .output-class {
380
+ background: linear-gradient(to bottom, #ffffff, #f8f9fa) !important;
381
+ border-radius: 12px !important;
382
+ padding: 20px !important;
383
+ border: 2px solid #e9ecef !important;
384
+ }
385
+
386
+ /* Cards and containers */
387
+ .gr-box {
388
+ border-radius: 12px !important;
389
+ border: 1px solid #e9ecef !important;
390
+ box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
391
+ }
392
+
393
+ /* Labels */
394
+ label {
395
+ font-weight: 600 !important;
396
+ color: #495057 !important;
397
+ font-size: 14px !important;
398
+ margin-bottom: 8px !important;
399
+ }
400
+
401
+ /* Examples */
402
+ .gr-samples-table {
403
+ border-radius: 10px !important;
404
+ overflow: hidden !important;
405
+ }
406
+
407
+ /* Footer */
408
+ .footer {
409
+ text-align: center;
410
+ padding: 30px;
411
+ background: linear-gradient(to right, #f8f9fa, #e9ecef);
412
+ border-radius: 12px;
413
+ margin-top: 30px;
414
+ }
415
+
416
+ /* Image display */
417
+ .gr-image {
418
+ border-radius: 12px !important;
419
+ border: 2px solid #e9ecef !important;
420
+ box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
421
+ }
422
+
423
+ /* Radio buttons and checkboxes */
424
+ .gr-radio, .gr-checkbox {
425
+ padding: 10px !important;
426
+ border-radius: 8px !important;
427
+ }
428
+
429
+ /* File upload */
430
+ .gr-file {
431
+ border: 2px dashed #667eea !important;
432
+ border-radius: 12px !important;
433
+ background: linear-gradient(to bottom, #ffffff, #f8f9fa) !important;
434
+ padding: 30px !important;
435
+ }
436
+
437
+ .gr-file:hover {
438
+ border-color: #764ba2 !important;
439
+ background: #f8f9fa !important;
440
  }
441
  """
442
 
443
  # Create Gradio interface
444
  with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, title="MissionControlMCP Demo") as demo:
445
 
446
+ gr.Markdown("# πŸš€ MissionControlMCP")
447
+ gr.Markdown("### Enterprise Automation Tools - Powered by AI")
 
 
448
 
449
+ gr.HTML("""
450
+ <div style="text-align: center; padding: 20px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 15px; color: white; margin-bottom: 30px;">
451
+ <h3 style="color: white; margin: 0;">✨ Try all 8 powerful tools in your browser - No installation needed! ✨</h3>
452
+ <p style="margin: 10px 0 0 0; opacity: 0.9;">Built for HuggingFace Gradio Hackathon | Claude MCP Integration</p>
453
+ </div>
454
  """)
455
 
456
  with gr.Tabs():
457
 
458
  # ====== TAB 1: PDF READER ======
459
  with gr.Tab("πŸ“„ PDF Reader"):
460
+ gr.Markdown("""
461
+ ### πŸ“„ Extract Text and Metadata from PDF Documents
462
+ Upload any PDF file to extract its content, metadata, and keywords instantly.
463
+ """)
464
 
465
  with gr.Row():
466
+ with gr.Column(scale=1):
467
+ pdf_input = gr.File(
468
+ label="πŸ“Ž Upload PDF File",
469
+ file_types=[".pdf"],
470
+ elem_classes=["file-upload"]
471
+ )
472
+ pdf_btn = gr.Button(
473
+ "πŸ” Extract Text from PDF",
474
+ variant="primary",
475
+ size="lg",
476
+ elem_classes=["primary-btn"]
477
+ )
478
+ gr.Markdown("""
479
+ **πŸ’‘ Tips:**
480
+ - Supports multi-page PDFs
481
+ - Extracts metadata (author, title)
482
+ - Automatically generates keywords
483
+ """)
484
 
485
+ with gr.Column(scale=2):
486
+ pdf_output = gr.Textbox(
487
+ label="πŸ“Š Extraction Results",
488
+ lines=20,
489
+ elem_classes=["output-class"]
490
+ )
491
  pdf_img = gr.Image(label="Preview", visible=False)
492
 
493
  pdf_btn.click(tool_pdf_reader, inputs=[pdf_input], outputs=[pdf_output, pdf_img])
494
 
495
+ gr.Markdown("*πŸ’‘ Try uploading your resume, research paper, or any PDF document!*")
496
 
497
  # ====== TAB 2: TEXT EXTRACTOR ======
498
  with gr.Tab("πŸ“ Text Extractor"):
499
+ gr.Markdown("""
500
+ ### πŸ“ AI-Powered Text Analysis
501
+ Extract keywords, generate summaries, clean text, or split into chunks.
502
+ """)
503
 
504
  with gr.Row():
505
+ with gr.Column(scale=1):
506
  text_input = gr.Textbox(
507
+ label="✍️ Enter Your Text",
508
+ lines=10,
509
+ placeholder="Paste any text here - articles, reports, emails, etc...",
510
+ elem_classes=["input-field"]
511
  )
512
  text_operation = gr.Radio(
513
  ["keywords", "summarize", "clean", "chunk"],
514
+ label="πŸ› οΈ Select Operation",
515
+ value="keywords",
516
+ info="Choose what to do with your text"
517
+ )
518
+ text_length = gr.Slider(
519
+ 100, 1000, 300,
520
+ label="πŸ“ Max Length (for summarize/chunk)",
521
+ info="Adjust output length"
522
+ )
523
+ text_btn = gr.Button(
524
+ "✨ Process Text",
525
+ variant="primary",
526
+ size="lg",
527
+ elem_classes=["primary-btn"]
528
  )
 
 
529
 
530
+ with gr.Column(scale=2):
531
+ text_output = gr.Textbox(
532
+ label="πŸ“Š Processing Results",
533
+ lines=20,
534
+ elem_classes=["output-class"]
535
+ )
536
 
537
  text_btn.click(
538
  tool_text_extractor,
 
543
  gr.Examples([
544
  ["Artificial Intelligence is transforming businesses worldwide. Companies are leveraging AI for automation, decision-making, and customer service. Machine learning models can now process vast amounts of data and provide actionable insights.", "keywords", 300],
545
  ["Climate change is one of the most pressing challenges of our time. Rising temperatures, extreme weather events, and environmental degradation require urgent action.", "summarize", 300]
546
+ ], inputs=[text_input, text_operation, text_length], label="πŸ“š Try These Examples")
547
 
548
  # ====== TAB 3: WEB FETCHER ======
549
  with gr.Tab("🌐 Web Fetcher"):
550
+ gr.Markdown("""
551
+ ### 🌐 Scrape and Analyze Web Content
552
+ Fetch content from any website, extract clean text, and analyze it.
553
+ """)
554
 
555
  with gr.Row():
556
+ with gr.Column(scale=1):
557
  web_input = gr.Textbox(
558
+ label="πŸ”— Website URL",
559
  placeholder="https://example.com",
560
+ value="https://example.com",
561
+ info="Enter any public website URL"
562
+ )
563
+ web_btn = gr.Button(
564
+ "🌐 Fetch Website",
565
+ variant="primary",
566
+ size="lg",
567
+ elem_classes=["primary-btn"]
568
  )
569
+ gr.Markdown("""
570
+ **πŸ’‘ Tips:**
571
+ - Works with most public websites
572
+ - Extracts clean text (no HTML)
573
+ - Finds all page links
574
+ - Some sites block bots (e.g., LinkedIn)
575
+ """)
576
 
577
+ with gr.Column(scale=2):
578
+ web_output = gr.Textbox(
579
+ label="πŸ“Š Website Content",
580
+ lines=20,
581
+ elem_classes=["output-class"]
582
+ )
583
 
584
  web_btn.click(tool_web_fetcher, inputs=[web_input], outputs=[web_output])
585
 
 
587
  ["https://example.com"],
588
  ["https://python.org"],
589
  ["https://github.com"]
590
+ ], inputs=[web_input], label="πŸ“š Try These Examples")
591
 
592
  # ====== TAB 4: RAG SEARCH ======
593
  with gr.Tab("πŸ” RAG Search"):
594
+ gr.Markdown("""
595
+ ### πŸ” Semantic Document Search with AI
596
+ Search through documents using AI-powered semantic understanding (RAG - Retrieval Augmented Generation).
597
+ """)
598
 
599
  with gr.Row():
600
+ with gr.Column(scale=1):
601
  rag_input = gr.Textbox(
602
+ label="πŸ”Ž Search Query",
603
  placeholder="What are you looking for?",
604
+ value="What is machine learning?",
605
+ lines=3,
606
+ info="Ask questions in natural language"
607
+ )
608
+ rag_btn = gr.Button(
609
+ "πŸ” Search Documents",
610
+ variant="primary",
611
+ size="lg",
612
+ elem_classes=["primary-btn"]
613
  )
614
+ gr.Markdown("""
615
+ **πŸ’‘ How it works:**
616
+ - Uses AI embeddings (FAISS)
617
+ - Understands meaning, not just keywords
618
+ - Searches 5 sample documents
619
+ - Returns relevance scores
620
+ """)
621
 
622
+ with gr.Column(scale=2):
623
+ rag_output = gr.Textbox(
624
+ label="πŸ“Š Search Results",
625
+ lines=20,
626
+ elem_classes=["output-class"]
627
+ )
628
 
629
  rag_btn.click(tool_rag_search, inputs=[rag_input], outputs=[rag_output])
630
 
 
633
  ["How to reduce carbon emissions?"],
634
  ["What are modern web frameworks?"],
635
  ["Digital marketing strategies"]
636
+ ], inputs=[rag_input], label="πŸ“š Try These Searches")
637
 
638
  # ====== TAB 5: DATA VISUALIZER ======
639
  with gr.Tab("πŸ“Š Data Visualizer"):
640
+ gr.Markdown("""
641
+ ### πŸ“Š Create Beautiful Charts from Your Data
642
+ Transform CSV data into stunning visualizations - line charts, bar charts, pie charts, and scatter plots.
643
+ """)
644
 
645
  with gr.Row():
646
+ with gr.Column(scale=1):
647
  viz_csv = gr.Textbox(
648
+ label="πŸ“‹ CSV Data",
649
+ lines=10,
650
  value=load_sample_csv(),
651
+ placeholder="month,revenue,costs\nJan,100000,60000",
652
+ info="Paste your CSV data here"
653
  )
654
  viz_chart = gr.Radio(
655
  ["line", "bar", "pie", "scatter"],
656
+ label="πŸ“ˆ Chart Type",
657
+ value="line",
658
+ info="Select visualization style"
659
+ )
660
+ viz_x = gr.Textbox(label="πŸ“ X-Axis Column", value="month")
661
+ viz_y = gr.Textbox(label="πŸ“ Y-Axis Column", value="revenue")
662
+ viz_title = gr.Textbox(label="πŸ“ Chart Title", value="Monthly Revenue")
663
+ viz_btn = gr.Button(
664
+ "πŸ“Š Create Chart",
665
+ variant="primary",
666
+ size="lg",
667
+ elem_classes=["primary-btn"]
668
  )
 
 
 
 
669
 
670
+ with gr.Column(scale=2):
671
+ viz_output = gr.Textbox(
672
+ label="πŸ“Š Chart Status",
673
+ lines=5,
674
+ elem_classes=["output-class"]
675
+ )
676
+ viz_img = gr.Image(label="πŸ“ˆ Generated Chart", elem_classes=["chart-output"])
677
 
678
  viz_btn.click(
679
  tool_data_visualizer,
680
  inputs=[viz_csv, viz_chart, viz_x, viz_y, viz_title],
681
  outputs=[viz_output, viz_img]
682
  )
683
+
684
+ gr.Markdown("*πŸ’‘ Sample data is already loaded! Just click 'Create Chart' to see it in action.*")
685
 
686
  # ====== TAB 6: EMAIL CLASSIFIER ======
687
  with gr.Tab("πŸ“§ Email Classifier"):
688
+ gr.Markdown("""
689
+ ### πŸ“§ AI-Powered Email Intent Detection
690
+ Automatically classify email intent and detect sentiment - complaint, inquiry, urgent, etc.
691
+ """)
692
 
693
  with gr.Row():
694
+ with gr.Column(scale=1):
695
  email_input = gr.Textbox(
696
+ label="βœ‰οΈ Email Content",
697
+ lines=12,
698
  value=load_sample_email(),
699
+ placeholder="Paste email content here...",
700
+ info="Paste any email text for analysis"
701
  )
702
+ email_btn = gr.Button(
703
+ "🎯 Classify Email",
704
+ variant="primary",
705
+ size="lg",
706
+ elem_classes=["primary-btn"]
707
+ )
708
+ gr.Markdown("""
709
+ **πŸ’‘ Detects 10 intents:**
710
+ - Complaint
711
+ - Inquiry
712
+ - Request
713
+ - Feedback
714
+ - Order
715
+ - Meeting
716
+ - Urgent
717
+ - Application
718
+ - Sales
719
+ - Other
720
+ """)
721
 
722
+ with gr.Column(scale=2):
723
+ email_output = gr.Textbox(
724
+ label="πŸ“Š Classification Results",
725
+ lines=20,
726
+ elem_classes=["output-class"]
727
+ )
728
 
729
  email_btn.click(tool_email_classifier, inputs=[email_input], outputs=[email_output])
730
 
 
732
  ["I am writing to complain about the poor service I received at your store yesterday."],
733
  ["Could you please send me more information about your pricing plans?"],
734
  ["URGENT: The server is down and customers cannot access the website!"]
735
+ ], inputs=[email_input], label="πŸ“š Try These Examples")
736
 
737
  # ====== TAB 7: KPI GENERATOR ======
738
  with gr.Tab("πŸ“ˆ KPI Generator"):
739
+ gr.Markdown("""
740
+ ### πŸ“ˆ Business KPI & Analytics Dashboard
741
+ Generate comprehensive business metrics and KPIs from your data automatically.
742
+ """)
743
 
744
  with gr.Row():
745
+ with gr.Column(scale=1):
746
  kpi_json = gr.Textbox(
747
+ label="πŸ“Š Business Data (JSON Format)",
748
+ lines=14,
749
  value=load_sample_json(),
750
+ placeholder='{"revenue": 1000000, "costs": 600000}',
751
+ info="Enter your business metrics in JSON"
752
  )
753
  kpi_metrics = gr.CheckboxGroup(
754
  ["revenue", "growth", "efficiency", "customer", "operational"],
755
+ label="πŸ“‹ Metrics to Calculate",
756
+ value=["revenue", "growth", "efficiency"],
757
+ info="Select which KPI categories to generate"
758
+ )
759
+ kpi_btn = gr.Button(
760
+ "πŸ“ˆ Generate KPIs",
761
+ variant="primary",
762
+ size="lg",
763
+ elem_classes=["primary-btn"]
764
  )
765
+ gr.Markdown("""
766
+ **πŸ’‘ Generates:**
767
+ - Revenue metrics
768
+ - Growth rates
769
+ - Efficiency ratios
770
+ - Customer metrics
771
+ - Operational KPIs
772
+ - Executive summary
773
+ """)
774
 
775
+ with gr.Column(scale=2):
776
+ kpi_output = gr.Textbox(
777
+ label="πŸ“Š KPI Report",
778
+ lines=25,
779
+ elem_classes=["output-class"]
780
+ )
781
 
782
  kpi_btn.click(
783
  tool_kpi_generator,
784
  inputs=[kpi_json, kpi_metrics],
785
  outputs=[kpi_output]
786
  )
787
+
788
+ gr.Markdown("*πŸ’‘ Sample business data is already loaded! Just click 'Generate KPIs' to see results.*")
789
 
790
  # Footer
791
+ gr.HTML("""
792
+ <div class="footer">
793
+ <h2 style="margin-bottom: 20px;">🎯 About MissionControlMCP</h2>
794
+
795
+ <p style="font-size: 18px; margin-bottom: 20px;">
796
+ <strong>8 enterprise-grade automation tools</strong> integrated with Claude Desktop via Model Context Protocol (MCP)
797
+ </p>
798
+
799
+ <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin: 30px 0;">
800
+ <div style="padding: 15px; background: white; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
801
+ <strong>πŸ“„ PDF Reader</strong><br/>
802
+ <small>Extract text from documents</small>
803
+ </div>
804
+ <div style="padding: 15px; background: white; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
805
+ <strong>πŸ“ Text Extractor</strong><br/>
806
+ <small>Keywords & summaries</small>
807
+ </div>
808
+ <div style="padding: 15px; background: white; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
809
+ <strong>🌐 Web Fetcher</strong><br/>
810
+ <small>Scrape websites</small>
811
+ </div>
812
+ <div style="padding: 15px; background: white; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
813
+ <strong>πŸ” RAG Search</strong><br/>
814
+ <small>Semantic search</small>
815
+ </div>
816
+ <div style="padding: 15px; background: white; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
817
+ <strong>πŸ“Š Data Visualizer</strong><br/>
818
+ <small>Create charts</small>
819
+ </div>
820
+ <div style="padding: 15px; background: white; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
821
+ <strong>πŸ”„ File Converter</strong><br/>
822
+ <small>Format conversions</small>
823
+ </div>
824
+ <div style="padding: 15px; background: white; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
825
+ <strong>πŸ“§ Email Classifier</strong><br/>
826
+ <small>Intent detection</small>
827
+ </div>
828
+ <div style="padding: 15px; background: white; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
829
+ <strong>πŸ“ˆ KPI Generator</strong><br/>
830
+ <small>Business analytics</small>
831
+ </div>
832
+ </div>
833
+
834
+ <div style="margin-top: 30px; padding-top: 20px; border-top: 2px solid #e9ecef;">
835
+ <p style="font-size: 16px; margin: 10px 0;">
836
+ πŸ”— <a href="https://github.com/AlBaraa-1/CleanEye-Hackathon" target="_blank" style="color: #667eea; text-decoration: none; font-weight: 600;">View on GitHub</a>
837
+ </p>
838
+ <p style="margin: 10px 0; color: #6c757d;">
839
+ πŸ† Built for HuggingFace Gradio x BuildWithMCP Hackathon
840
+ </p>
841
+ <p style="margin: 10px 0; color: #6c757d;">
842
+ Made with ❀️ using Python, Gradio, Claude MCP, FAISS, and Sentence Transformers
843
+ </p>
844
+ </div>
845
+ </div>
846
  """)
847
 
848