5g-ddos-mcp
Supports local open-source LLMs running via Ollama for fully offline generation of attack explanations and response plans.
Integrates with OpenAI-compatible endpoints (e.g., OpenAI API, vLLM, LM Studio) to provide LLM-powered attack analysis and recommendation capabilities.
Can use Perplexity's API as an OpenAI-compatible backend for generating incident reports and mitigation strategies.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@5g-ddos-mcpdetect any DDoS attack on recent 5G traffic"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
What It Does
Gives any LLM agent the ability to detect, explain, and respond to 5G DDoS attacks:
Tool | What it does |
| Classify live 5G telemetry as benign/attack — returns type, confidence, severity |
| Generate a natural-language incident report via the configured LLM |
| Slice-aware mitigation plan with generic REST API call examples |
| Search past incidents + dataset reference patterns for few-shot LLM reasoning |
Supports SYN, UDP, ICMP, DNS, and GTP-U flooding (the last being 5G-specific, critical severity).
Related MCP server: WireMCP
Quick Start
Pick your LLM backend and follow the matching path. The server runs in demo mode (rule-based heuristics) without a trained model, so you can try all tools immediately.
Option A — Claude (Anthropic API)
Best output quality for incident reports and recommendations.
# 1. Clone and install
git clone https://github.com/ncsrd/5g-ddos-mcp
cd 5g-ddos-mcp
pip install -r requirements.txt
# 2. Configure
cp .env.example .env
# Set: LLM_BACKEND=claude
# Set: ANTHROPIC_API_KEY=sk-ant-...
# 3. Run
python -m src.serverConnect in claude_desktop_config.json:
{
"mcpServers": {
"5g-ddos": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "/path/to/5g-ddos-mcp",
"env": {
"LLM_BACKEND": "claude",
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}Option B — Ollama (local open-source LLMs, fully offline)
Best for air-gapped or privacy-sensitive deployments. No data leaves your machine.
Step 1 — Install Ollama
# macOS / Linux
curl -fsSL https://ollama.com/install.sh | sh
# Windows: download from https://ollama.com/downloadStep 2 — Pull a model
ollama pull llama3.2 # 3B (fast) or 8B (balanced) — recommended default
ollama pull mistral # 7B — strong reasoning
ollama pull phi4 # 14B — best structured output
ollama pull gemma3 # Google Gemma 3, 4B–27B
ollama pull deepseek-r1 # 8B chain-of-thought distill
ollama pull qwen2.5 # 7B / 14B / 72BStep 3 — Run the MCP server
cp .env.example .env
# Set: LLM_BACKEND=ollama
# Set: OLLAMA_MODEL=llama3.2 (or whichever you pulled)
# OLLAMA_BASE_URL defaults to http://localhost:11434
python -m src.serverConnect in claude_desktop_config.json:
{
"mcpServers": {
"5g-ddos": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "/path/to/5g-ddos-mcp",
"env": {
"LLM_BACKEND": "ollama",
"OLLAMA_MODEL": "llama3.2"
}
}
}
}Option C — OpenAI-compatible endpoint
Works with vLLM, LM Studio, Groq, Together.ai, Mistral API, Perplexity, and any other OpenAI-compatible provider.
cp .env.example .env
# Set: LLM_BACKEND=openai_compatible
# Set: OPENAI_BASE_URL=<your endpoint>
# Set: OPENAI_MODEL=<model name>
# Set: OPENAI_API_KEY=<your key>
python -m src.serverProvider examples:
Provider |
|
|
vLLM (self-hosted) |
| your deployed model |
LM Studio (local) |
| model loaded in LM Studio |
Groq |
|
|
Together.ai |
|
|
Mistral API |
|
|
Perplexity |
|
|
OpenAI |
|
|
Option D — Docker (any backend)
# Build
docker build -t 5g-ddos-mcp .
# Run with Claude
docker run --env-file .env -p 8000:8000 \
-v $(pwd)/models:/app/models:ro \
-v $(pwd)/data:/app/data:ro \
5g-ddos-mcp
# Run with Ollama (Ollama running on host)
docker run -p 8000:8000 \
-e LLM_BACKEND=ollama \
-e OLLAMA_BASE_URL=http://host.docker.internal:11434 \
-e OLLAMA_MODEL=llama3.2 \
5g-ddos-mcp
# Full stack: MCP server + Ollama side-by-side
docker compose --profile with-ollama up
# Then pull a model inside the Ollama container:
docker exec -it ollama ollama pull llama3.2
# Full stack with InfluxDB + Grafana (mirrors the NCSRD testbed pipeline)
docker compose --profile full upOption E — Kubernetes
# 1. Apply namespace, storage, and config
kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/pvc.yaml
kubectl apply -f k8s/configmap.yaml
# 2. Create secrets (replace with real values)
kubectl create secret generic 5g-ddos-mcp-secrets \
--from-literal=ANTHROPIC_API_KEY=sk-ant-... \
-n 5g-ddos-mcp
# 3. Deploy (set LLM_BACKEND in k8s/deployment.yaml before applying)
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
# 4. Train the model inside the cluster (after populating the data PVC)
kubectl apply -f k8s/train-job.yaml
kubectl logs -f job/train-classifier -n 5g-ddos-mcp
# 5. Check status
kubectl get pods -n 5g-ddos-mcpTo deploy Ollama as a sidecar for a fully self-contained cluster:
# Ollama deployment + service are already included in k8s/deployment.yaml
# Set LLM_BACKEND=ollama and OLLAMA_BASE_URL=http://ollama-service:11434 in configmap.yaml
kubectl apply -f k8s/deployment.yaml # deploys both mcp-server and ollama
kubectl apply -f k8s/service.yaml
# Then exec into the Ollama pod to pull a model:
kubectl exec -it deploy/ollama -n 5g-ddos-mcp -- ollama pull llama3.2Dataset Setup
The ML model requires the NCSRD-DS-5GDDoS v3.0 dataset (~620 MB), which must be downloaded separately. The server runs in heuristic demo mode without it.
# Automatic download from Zenodo (DOI: 10.5281/zenodo.13900057)
chmod +x scripts/download_dataset.sh
./scripts/download_dataset.sh
# Then train the classifier (~5–15 min depending on hardware)
python scripts/train_model.py
# Quick smoke-test with 100k rows
python scripts/train_model.py --nrows 100000See data/DATASET_INSTRUCTIONS.md for full details on files and manual download.
Target metrics (from published results on this dataset):
Metric | Target | Published |
Binary F1 | > 0.95 | 0.98 |
AUC-ROC | > 0.99 | 0.999 |
Multi-class Weighted F1 | > 0.95 | 0.98 |
CLI
The 5g-ddos command lets you run detections, query history, get recommendations, and manage the dataset directly from your terminal — no MCP client required.
pip install -e ".[all]" # installs the 5g-ddos entry point
5g-ddos --helpserver — Start the MCP server
5g-ddos server # uses LLM_BACKEND from .env
5g-ddos server --backend ollama --model phi4
5g-ddos server --backend claudedetect — Classify 5G telemetry
# Inline single-sample detection
5g-ddos detect --ul-bitrate 9500000 --dl-bitrate 1200000 \
--ul-retx 0.42 --pdu-session-setup-request 95 \
--ue-id UE-007
# Batch detection from a CSV file (matches NCSRD dataset schema)
5g-ddos detect --input telemetry.csv --format table
5g-ddos detect --input telemetry.csv --format csv --output results.csv
# Output formats: table (default) | json | csvexplain — Generate an incident report
5g-ddos explain --attack-type gtp_u_flood --severity critical \
--slice URLLC --ue-ip 10.45.0.3 --cells "1,2"
5g-ddos explain --attack-type syn_flood --severity high \
--imeisv 3533890312345678 --format json --output report.jsonrecommend — Get mitigation recommendations
5g-ddos recommend --attack-type udp_flood --severity high --slice eMBB
# Preview auto-execute REST API commands (does not call any API without RESPONSE_API_URL set)
5g-ddos recommend --attack-type gtp_u_flood --severity critical \
--ue-ip 10.45.0.5 --imeisv 3533890312345678 \
--auto-executehistory — Query incident history
5g-ddos history # last 10 incidents
5g-ddos history --attack-type syn_flood --limit 20
5g-ddos history --severity critical --slice URLLC --time-range 24train — Train the XGBoost classifier
5g-ddos train # full dataset (~5–15 min)
5g-ddos train --nrows 100000 # quick smoke-test with 100k rowsdataset — Manage the NCSRD dataset
5g-ddos dataset status # show which files are present / missing
5g-ddos dataset download # print download instructions
5g-ddos dataset download --auto # run scripts/download_dataset.sh automaticallyversion — Show environment info
5g-ddos version
# ┌──────────────────────┬───────────────────────────────┐
# │ 5g-ddos-mcp │ 1.0.0 │
# │ LLM Backend │ claude (claude-sonnet-4-6) │
# │ ML Model │ loaded (binary + multi-class) │
# │ Dataset records │ 7 files present │
# └──────────────────────┴───────────────────────────────┘Architecture
┌──────────────────────────────────────────────┐
│ MCP Client (any LLM) │
└──────────────────┬───────────────────────────┘
│ MCP Protocol (stdio / HTTP)
┌──────────────────▼───────────────────────────┐
│ 5G-DDoS MCP Server │
│ │
│ ┌─────────────┐ ┌──────────────────────┐ │
│ │ ML Layer │ │ LLM Layer │ │
│ │ XGBoost │ │ Claude │ Ollama │ │
│ │ Classifier │ │ OpenAI-compatible │ │
│ └──────┬──────┘ └──────────────────────┘ │
│ │ │
│ ┌──────▼────────────────────────────────┐ │
│ │ MCP Tools │ │
│ │ detect_anomaly │ explain_attack │ │
│ │ recommend_response │ query_history │ │
│ └───────────────────────────────────────┘ │
└──────────────────────────────────────────────┘
│
┌──────────▼──────────┐
│ NCSRD Dataset │
│ (local CSV) │
└─────────────────────┘Tier 1 — Perception: XGBoost classifier (trained on NCSRD-DS-5GDDoS) detects attacks from real-time telemetry.
Tier 2 — Reasoning: LLM produces contextual incident reports and mitigation recommendations.
Tier 3 — Action: Generic REST API integration for automated response (blacklist UE, isolate slice, rate-limit). Compatible with Open5GS, free5GC, OAI, or any custom NMS — set RESPONSE_API_URL to enable.
Configuration Reference
All settings via environment variables. Copy .env.example to .env to get started.
Variable | Default | Description |
|
|
|
| — | Required when |
|
| Anthropic model ID |
|
| Ollama server URL |
|
| Any model pulled via |
| — | Required when |
|
| Any OpenAI-compatible endpoint URL |
|
| Model name at the endpoint |
|
| Max tokens for LLM completions |
|
| Generation temperature |
|
| Attack confidence threshold (0.0–1.0) |
| — | Network management API for auto-execute (optional) |
| — | Bearer token for the response API (optional) |
|
| Server port |
|
| Logging level |
Dataset
NCSRD-DS-5GDDoS v3.0 — DOI: 10.5281/zenodo.13900057
File | Size | Description |
| 241.5 MB | Primary ML file — labeled, 6 classes |
| 143.6 MB | UE metrics, Classic cells |
| 87.3 MB | UE metrics, Mini cell |
| 72.2 MB | Cell-level eNB counters |
| 38.2 MB | Mini cell counters |
| 37.1 MB | NAS-layer MME counters |
| 18.0 kB | Attack summary per UE |
Attack labels (attack_number column): 0 benign · 1 SYN flood · 2 UDP flood · 3 ICMP flood · 4 DNS flood · 5 GTP-U flood
Project Alignment
EU Project | Integration |
MARE | Agentic AI for 5G Security |
Citation
@dataset{ncsrd_5gddos_2024,
title = {NCSRD-DS-5GDDoS: 5G Radio & Core Metrics -- DDoS Attack Dataset},
author = {NCSRD and Space Hellas},
year = {2024},
doi = {10.5281/zenodo.13900057},
publisher = {Zenodo},
license = {CC BY 4.0},
note = {EU Horizon PRIVATEER project, Grant 101096110}
}License
MCP server code: MIT. Dataset: CC BY 4.0 (cite the DOI above).
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/core-ncsrd/5g-ddos-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server