PromptShieldPOC

devmanager1981/PromptShieldPOC

3.1

If you are the rightful owner of PromptShieldPOC and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Model Context Protocol (MCP) server is a secure and efficient system designed to process and summarize documents while ensuring content safety and user authentication.

🔐 PromptShieldPOC

Created by Sachin Gupta with ❤️ + Copilot Last updated: October 11, 2025

Secure Document Summarizer powered by Model Context Protocol (MCP) — a robust AI-driven system that processes TXT and PDF files, filters unsafe content, and generates summaries with enterprise-grade security and identity protection.

🚀 Features

  • Upload and summarize TXT or PDF documents using Azure OpenAI
  • Filters unsafe prompts using Azure Content Safety
  • Routes context securely via Model Context Protocol (MCP)
  • Authenticates users via Azure Entra ID
  • Displays real-time alerts via Prompt Shield
  • Logs all activity for audit and debugging
  • Interactive dashboard built with Streamlit
  • FastAPI backend handles all secure processing and MCP orchestration

🧱 Tech Stack

  • Python (FastAPI backend)
  • Azure OpenAI (GPT-3.5 Turbo summarization)
  • Azure Content Safety (toxicity & jailbreak detection)
  • Azure Entra ID (OAuth2 authentication via MSAL)
  • MCP (Model Context Protocol) for secure context routing
  • Streamlit (UI dashboard)

🔄 Backend Interaction

  • app.py (Streamlit) sends requests to server.py (FastAPI)
  • FastAPI handles:
    • Token verification
    • Content safety scanning
    • Prompt Shield filtering
    • Summarization via Azure OpenAI
  • Responses are returned to the UI for display and download

📊 Architecture Overview

See the full diagram in the dashboard sidebar under "📊 View MCP Architecture Diagram".


Created by Sachin Gupta with ❤️ + Copilot

📂 Project Structure

project structure is presented as a diagram: ├── config/ ├── docs/ │ └── architecture.md # Diagrams, flowcharts, design decisions ├── src/ │ ├── api/ │ │ └── server.py # FastAPI MCP server │ ├── auth/ │ │ └── entra_auth.py # Azure Entra ID integration │ ├── ingestion/ │ │ ├── email_loader.py # Enron email parser │ │ └── pdf_loader.py # GovInfo PDF parser │ ├── shield/ │ │ ├── content_safety.py # Azure Content Safety integration │ │ └── prompt_filter.py # Prompt Shield logic │ ├── summarizer/ │ │ ├── chunker.py # Token-aware chunking │ │ └── summarize.py # Azure OpenAI summarization logic │ └── config_loader.py ├── tests/ │ ├── generate_test_files.py │ ├── mock_scan.py │ ├── test_chunker.py │ ├── test_content_safety.py │ ├── test_email_loader.py │ ├── test_ingestion.py │ ├── test_pdf_loader.py │ ├── test_prompt_filter.py │ ├── test_server.py │ ├── test_shield.py │ └── test_summarizer.py ├── ui/ │ ├── dashboard/ │ │ ├── .streamlit/ │ │ │ └── config.toml │ │ ├── components/ │ │ │ ├── shield_alert.py # UI component: prompt shield alerts │ │ │ ├── summarizer.py # UI component: summarizer display │ │ │ └── uploader.py # UI component: file uploader │ │ ├── services/ │ │ │ └── api.py # UI service: API client │ │ └── app.py │ ├── extension/ │ └── extension copy/ ├── .gitignore ├── PromptShieldPOC.code-workspace ├── README.MD ├── exclude.txt ├── generate_project_structure.py ├── requirements.txt └── setup.py