ACloudCenter commited on
Commit
4ea1b39
Β·
verified Β·
1 Parent(s): 3f8b0fb

Fix- Updated broken MCP

Browse files
Files changed (1) hide show
  1. exposuregpt_simple.py +87 -22
exposuregpt_simple.py CHANGED
@@ -587,30 +587,93 @@ def _classify_target_type(target: str) -> str:
587
 
588
 
589
  def create_interface():
590
- """Create simple Gradio interface using gr.Interface for MCP compatibility"""
591
 
592
- demo = gr.Interface(
593
- fn=intelligence_gathering,
594
- inputs=gr.Textbox(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
595
  label="🎯 Target to Analyze",
596
  placeholder="Enter anything: 'Tesla', 'that social media company', 'google.com', '8.8.8.8'",
597
  value="Tesla"
598
- ),
599
- outputs=gr.Markdown(),
600
- title="🎯 ExposureGPT - Simplified OSINT Intelligence",
601
- description="""**πŸ€– Smart OSINT analysis using LLM + Shodan + OpenAI**
602
-
603
- Enter anything - the LLM will interpret your input and ask for clarification if needed!
604
- Try: "Tesla", "that social media company", "google.com", or "8.8.8.8"
605
-
606
- **MCP Endpoint**: `https://acloudcenter-exposuregpt.hf.space/gradio_api/mcp/sse`""",
607
- examples=[
608
- ["Tesla"],
609
- ["that social media company"],
610
- ["google.com"],
611
- ["8.8.8.8"]
612
- ]
613
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
614
 
615
  return demo
616
 
@@ -641,12 +704,14 @@ def main():
641
  print(f"🌐 Interface: http://localhost:{args.port}")
642
  print(f"πŸ€– MCP Endpoint: http://localhost:{args.port}/gradio_api/mcp/sse")
643
 
 
 
 
644
  demo.launch(
645
  server_port=args.port,
646
  share=args.share,
647
  server_name="0.0.0.0",
648
- ssr_mode=False, # Fix font loading 404 errors
649
- mcp_server=True # Enable MCP server - this should work per Gradio docs!
650
  )
651
 
652
 
 
587
 
588
 
589
  def create_interface():
590
+ """Create simple Gradio interface"""
591
 
592
+ # Use proper Gradio theme with Google Fonts to avoid 404 errors
593
+ theme = gr.themes.Soft(
594
+ primary_hue=gr.themes.colors.pink,
595
+ secondary_hue=gr.themes.colors.cyan,
596
+ neutral_hue=gr.themes.colors.slate,
597
+ font=[gr.themes.GoogleFont("Inter"), "sans-serif"]
598
+ )
599
+
600
+ # Minimal CSS - just background and center content
601
+ css = """
602
+ .gradio-container {
603
+ background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
604
+ max-width: 1200px !important;
605
+ margin: 0 auto !important;
606
+ padding: 20px !important;
607
+ }
608
+ """
609
+
610
+ with gr.Blocks(
611
+ title="ExposureGPT - Simplified OSINT Intelligence",
612
+ theme=theme,
613
+ css=css
614
+ ) as demo:
615
+
616
+ gr.Markdown("""
617
+ # 🎯 ExposureGPT - Simplified OSINT Intelligence
618
+
619
+ **πŸ€– Smart OSINT analysis using LLM + Shodan + OpenAI**
620
+
621
+ Enter anything - the LLM will interpret your input and ask for clarification if needed!
622
+ Try: "Tesla", "that social media company", "google.com", or "8.8.8.8"
623
+ """)
624
+
625
+ target_input = gr.Textbox(
626
  label="🎯 Target to Analyze",
627
  placeholder="Enter anything: 'Tesla', 'that social media company', 'google.com', '8.8.8.8'",
628
  value="Tesla"
629
+ )
630
+
631
+ analyze_btn = gr.Button(
632
+ "πŸš€ Run Intelligence Gathering",
633
+ variant="primary",
634
+ size="lg"
635
+ )
636
+
637
+ output_report = gr.Markdown(
638
+ value="Enter a target above and click the button to begin analysis..."
639
+ )
640
+
641
+ analyze_btn.click(
642
+ fn=intelligence_gathering,
643
+ inputs=[target_input],
644
+ outputs=[output_report]
645
+ )
646
+
647
+ gr.Markdown("""
648
+ ### πŸ€– Model Context Protocol (MCP) Server Details
649
+
650
+ This application automatically serves as an **MCP server** that AI assistants can connect to for real-time OSINT intelligence gathering.
651
+
652
+ **πŸ”— MCP Endpoint**: `https://acloudcenter-exposuregpt.hf.space/gradio_api/mcp/sse`
653
+
654
+ **πŸ“Š Available Tool**: `intelligence_gathering(target: str)`
655
+ - **Input**: Domain name, IP address, or organization name
656
+ - **Output**: Comprehensive security intelligence report including:
657
+ - Exact IP addresses and geographic locations
658
+ - Exposed services, ports, and product versions
659
+ - CVE vulnerabilities with severity scores
660
+ - Risk assessment with actionable recommendations
661
+ - Network infrastructure and hosting details
662
+
663
+ **πŸ”§ Claude Desktop Configuration**:
664
+ ```json
665
+ {
666
+ "mcpServers": {
667
+ "exposuregpt": {
668
+ "command": "npx",
669
+ "args": ["mcp-remote", "https://acloudcenter-exposuregpt.hf.space/gradio_api/mcp/sse"]
670
+ }
671
+ }
672
+ }
673
+ ```
674
+
675
+ **⚑ Powered by**: Shodan Internet Intelligence + OpenAI GPT-4o-mini + Gradio Framework
676
+ """)
677
 
678
  return demo
679
 
 
704
  print(f"🌐 Interface: http://localhost:{args.port}")
705
  print(f"πŸ€– MCP Endpoint: http://localhost:{args.port}/gradio_api/mcp/sse")
706
 
707
+ # Enable MCP server via environment variable (alternative to mcp_server=True)
708
+ os.environ['GRADIO_MCP_SERVER'] = 'True'
709
+
710
  demo.launch(
711
  server_port=args.port,
712
  share=args.share,
713
  server_name="0.0.0.0",
714
+ ssr_mode=False # Fix font loading 404 errors
 
715
  )
716
 
717