Spaces:
Sleeping
Sleeping
Fix- Updated broken MCP
Browse files- 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
|
| 591 |
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
|
| 609 |
-
|
| 610 |
-
|
| 611 |
-
|
| 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
|
| 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 |
|