MCP-1st-Birthday/mcp-security-dashboard
0
π MCP Security Dashboard (Hugging Face Space)
Realβtime visibility into requests flowing through your MCP Security Gateway:
- System health & downstream service latency
- Live audit stream (auto-refresh) with execution times
- Tool & server performance metrics
- User activity & block rates
- Highβrisk / jailbreak attempt listing
- Manual LLM tool-call tester
- AI Analytics and Insights by Claude
- ---
π Quick Deploy (Web UI)
- Go to https://huggingface.co/new-space
- Name:
mcp-security-dashboard| SDK: Gradio | Hardware: CPU basic - Upload from
dashboard/: app.pyrequirements.txt- Set Space variable (
SettingsβVariables & secrets):
MCP_HOST=https://yukisui22--security-mcp-gateway-gateway.modal.run- Save. Build completes in ~2β3 minutes.
- Open the Space β click "π Refresh Health Status".
π Prerequisites
- Deployed Modal gateway with URL (e.g.
https://yukisui22--security-mcp-gateway-gateway.modal.run) - Gateway logging enabled (writes audit lines to
/tmp/audit.log.jsonl) - Gateway exposes
GET /audit/latest?limit=500(added inmodal/gateway.py).
π Environment Variables
If MCP_HOST is set, the dashboard fetches remote audit data from MCP_HOST/audit/latest. If not set, it falls back to a local audit.log.jsonl file (useful for local dev).
π Features
π₯ Team
Team Name: MemKrew
Team Members:
- Yuki Sui - @yukisui22 - Lead Developer & AI Architect
- Charles Plowman - @Plowmann - Deployment Engineer
- Long Truong - @LongTTruong - Developer
- Albert Nguyen - @TigerInATux - Developer
π§ͺ Manual Test (LLM Tester Tab)
Paste a JSON payload like:
{
"user_id": "tester",
"server": "fetch",
"tool": "fetch",
"arguments": {"url": "https://example.com", "max_length": 300},
"llm_context": "Basic demo"
}Click "Send" β check Live Audit Stream.
π©βπ» Git Workflow (Alternative)
git clone https://huggingface.co/spaces/YOUR_USERNAME/mcp-security-dashboard
cd mcp-security-dashboard
cp ../security-mcp/dashboard/app.py .
cp ../security-mcp/dashboard/requirements.txt .
cat > README.md <<'EOF'
---
title: MCP Security Dashboard
emoji: π
colorFrom: purple
colorTo: indigo
sdk: gradio
app_file: app.py
pinned: false
---
# MCP Security Dashboard
Visualize health, audit logs, and security activity from your Security MCP Gateway.
EOF
git add .
git commit -m "Initial dashboard"
git pushThen set MCP_HOST in Space Settings.
π Troubleshooting
π¦ Dependencies
Minimal runtime in requirements.txt:
gradio>=4.0.0
requests>=2.31.0π Privacy & Logs
Audit entries may include user IDs and arguments. For public demos, avoid real PII in prompts.
π License
MIT (matches project). You may fork and adapt for your own MCP gateway variants.
π Next Enhancements
- Pagination for large audit sets
- WebSocket streaming
- Role-based filtering / access control
- Graph visualizations for risk trends
Made for the MCP Hackathon 2025 Β· Secure by design.
Prerequisites
- Modal-deployed gateway URL (example):
https://yukisui22--security-mcp-gateway-gateway.modal.run- The gateway writes audit logs to
/tmp/audit.log.jsonl(already configured inmodal/gateway.py). - This repo change adds a new endpoint on the gateway:
GET /audit/latest?limit=500which serves recent audit records as JSON for the dashboard.
Quick Deploy (Web UI)
- Create a new Space: https://huggingface.co/new-space
- Name:
mcp-security-dashboard - SDK: Gradio
- Hardware: CPU basic
- Upload these files from
dashboard/: app.pyrequirements.txt
- Set the environment variable (
SettingsβVariables & secrets): MCP_HOST = https://yukisui22--security-mcp-gateway-gateway.modal.run
- Save and wait for the Space to build.
- Open the Space and click "π Refresh Health Status"; you should see status and downstream info.
- The Live Audit Stream will auto-refresh and fetch recent entries from
/audit/lateston the gateway.
Git Workflow
# Create Space repo first (via HF UI) then locally:
git clone https://huggingface.co/spaces/YOUR_USERNAME/mcp-security-dashboard
cd mcp-security-dashboard
# Copy files
cp ../security-mcp/dashboard/app.py .
cp ../security-mcp/dashboard/requirements.txt .
# Optional: Add a README.md with frontmatter
cat > README.md << 'EOF'
---
title: MCP Security Dashboard
emoji: π
colorFrom: purple
colorTo: indigo
sdk: gradio
app_file: app.py
pinned: false
---
# MCP Security Dashboard
Visualize health, audit logs, and security activity from your Security MCP Gateway.
EOF
git add .
git commit -m "Initial dashboard"
git pushThen set the Space variable MCP_HOST in the Space settings to your Modal gateway URL.
Troubleshooting
- Live Audit shows "No audit records yet": send some traffic from the Playground or LLM Tester tab. The gateway must write audit logs.
- Health check fails: verify the gateway URL and that it's reachable from the Internet.
- CORS: Gateway already enables CORS; if issues persist, check DevTools β Network.
