ThreatByte-MCP

by anotherik

Not rated
GitHub

About

ThreatByte-MCP is a deliberately vulnerable, MCP-based case management web app. It mirrors a realistic SOC analyst workflow with a server-rendered UI and a real MCP server. The MCP tools are intentionally vulnerable for training and demonstration.

Details

Author
anotherik
Categories
Other, Security, Developer Tools

Setup

Install ThreatByte-MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/anotherik/ThreatByte-MCP

Follow the installation instructions in the repository README, then restart your MCP client.

ThreatByte-MCP is a deliberately vulnerable, MCP-based case management web app. It mirrors a realistic SOC analyst workflow with a server-rendered UI and a real MCP server. TheMCP tools are intentionally vulnerablefor training and demonstration.

[!NOTE]For educational use in controlled environments only.

- Safe web authentication (signup/login/logout)
- Case management UI (create/list/view cases)
- Notes and attachments tied to cases
- Indicator search and agent workflows via MCP tools
- Agent customization with schema-based tool registry

- SOC Web App (client/UI) runs on port 5001.
- MCP Server (tools + agent) runs on port 5002 using the official MCP Python SDK (FastMCP).

The MCP server exposes JSON-RPC atPOST http://localhost:5002/mcp(Streamable HTTP). The web UI calls the MCP server through a server-side proxy to keep auth consistent with the SOC session; the proxy streams agent responses to the browser via SSE. A samplemcp.jsonmanifest is included at the repo root. All direct MCP calls must includeMCP-Protocol-Version: 2025-11-25andAccept: application/json, text/event-stream.

Browser | v +------------------+ X-TBMCP-Token + X-TBMCP-User +-------------------+ | SOC Web App | ---------------------------------------> | MCP Server | | (Flask, :5001) | /mcp-proxy (server-side) | (FastMCP, :5002) | +------------------+ +-------------------+ | | v v SQLite DB Tool registry Agent + tool handlers

Diagram:ThreatByte-MCP architecture diagram

The web app proxies MCP calls with these headers:

- X-TBMCP-Token: shared secret fromTBMCP_MCP_SERVER_TOKEN(configured on both servers).
- X-TBMCP-User: current user id from the authenticated SOC session.

Direct MCP calls require the same headers.

- cases.create
- cases.list
- cases.list_all
- cases.get
- cases.rename
- cases.set_status
- cases.delete
- notes.create
- notes.list
- notes.update
- notes.delete
- files.upload(base64)
- files.list
- files.get(base64)
- files.read_path
- indicators.search
- agent.summarize_case
- agent.run_task
- tools.registry.list
- tools.builtin.list
- tools.registry.register
- tools.registry.delete

The following weaknesses areintentionally presentfor teaching:

- Broken object level authorization (cases/notes/files, list_all)
- Stored XSS (notes rendered as trusted HTML)
- SQL injection in indicator search
- Prompt injection in agent task runner
- Token mismanagement & secret exposure (hardcoded tokens in prompts, persisted contexts, full logs)
- Tool poisoning via schema-driven tool registry overrides (MCP03)
- Over-trusting client context (MCP header identity spoofing)
- Arbitrary file read viafiles.read_path
- Cross-user file overwrite (shared filename namespace)

cd ThreatByte-MCP python -m venv venv_threatbyte_mcp source venv_threatbyte_mcp/bin/activate pip install -r requirements.txt python db/create_db_tables.py python run_mcp_server.py --http python run.py

This repository ships two MCP server transports:

- HTTP (Streamable HTTP): what the ThreatByte web app uses. The web app is anHTTP MCP client only, via the server-side/mcp-proxyforwarder.
- stdio: for external MCP clients (e.g., IDE/agent clients) thatspawnthe MCP server and communicate over stdin/stdout.

# HTTP (required for the web app) python run_mcp_server.py --http --host 127.0.0.1 --port 5002 # stdio (for MCP clients that support stdio transport; the web app will NOT work with this) # In stdio mode there are no HTTP headers, so the server reads user context from env vars. # Note: stdio mode runs the MCP server on AnyIO's Trio backend; ensure trio>=0.28.0 is installed. export TBMCP_MCP_SERVER_TOKEN=tbmcp-mcp-token export TBMCP_MCP_USER_ID=1 python run_mcp_server.py --stdio

Claude Desktop compatibility (tool names)

Some MCP clients (e.g., Claude Desktop) enforce strict tool name validation (^[a-zA-Z0-9_-]{1,64}$) and will reject dotted tool names likecases.create.

To run the MCP server in a Claude-compatible mode, set:

This exposes tools as underscore names (e.g.,cases_create,tools_registry_register,files_read_path) instead of dotted names.

For a complete walkthrough (Windows + WSL stdio), seeClaude Desktop setup.

The repository includes aDockerfileand startup script that initialize the DB and run both services in one container:

- SOC Web App on:5001
- MCP Server on:5002

# Docker docker build -t threatbyte-mcp . # Podman podman build -t threatbyte-mcp .
# Docker docker run --rm -p 5001:5001 -p 5002:5002 threatbyte-mcp # Podman podman run --rm -p 5001:5001 -p 5002:5002 threatbyte-mcp

Run with optional environment variables:

# Docker docker run --rm -p 5001:5001 -p 5002:5002 \ -e TBMCP_MCP_SERVER_TOKEN=tbmcp-mcp-token \ -e OPENAI_API_KEY=your_api_key \ -e TBMCP_OPENAI_MODEL=gpt-4o-mini \ threatbyte-mcp # Podman podman run --rm -p 5001:5001 -p 5002:5002 \ -e TBMCP_MCP_SERVER_TOKEN=tbmcp-mcp-token \ -e OPENAI_API_KEY=your_api_key \ -e TBMCP_OPENAI_MODEL=gpt-4o-mini \ threatbyte-mcp

Persist SQLite data between runs (optional):

# Docker docker run --rm -p 5001:5001 -p 5002:5002 \ -v "$(pwd)/db:/app/db" \ -v "$(pwd)/app/uploads:/app/app/uploads" \ threatbyte-mcp # Podman podman run --rm -p 5001:5001 -p 5002:5002 \ -v "$(pwd)/db:/app/db:Z" \ -v "$(pwd)/app/uploads:/app/app/uploads:Z" \ threatbyte-mcp
python db/populate_db.py --users 8 --cases 20 --notes 40 --files 20

This creates random users, cases, notes, and file artifacts. All user passwords arePassword123!.

LLM Integration (Required for Agent Responses)

The agent task endpoint requires a real LLM. Without an API key, the agent returns an error indicating it is unavailable.

- TBMCP_OPENAI_API_KEYorOPENAI_API_KEY
- TBMCP_OPENAI_MODEL(default:gpt-4o-mini)

Keep API keys server-side only and never expose them in the browser.

The SOC web app proxies MCP calls to the MCP server using a shared token.

- TBMCP_MCP_SERVER_URL(default:http://localhost:5002/mcp)
- TBMCP_MCP_SERVER_TOKEN(shared secret between the SOC app and MCP server)

- The UI uses server-rendered templates.
- MCP tools are exposed underhttp://localhost:5002/mcp(JSON-RPC). The UI calls them through/mcp-proxy.
- Useful UI pages for training:

- My Cases(all cases owned by the logged-in user)
- MCP Audit Logs(server-side audit trail of MCP tool calls from HTTP + stdio clients)
- Agent Logs(internal agent runner traces; populated byagent.run_task)

A deliberately vulnerable MCP server for hands-on penetration-testing practice — 26 challenges, 78 capture-the-flag flags, plus a victim-agent harness that shows a real LLM agent being exploited.

Open-source, self-hostable MCP server for WhisperGraph — a graph of 7.39B nodes / 39B edges mapping DNS, BGP, GeoIP, WHOIS, and threat intelligence. Six read-only tools (Cypher query + schema introspection + threat assessment), six resources, eight investigation prompts. stdio and Streamable HTTP transports.

A Model Context Protocol (MCP) server implementation that provides seamless integration with the AbuseIPDB API for IP reputation checking and abuse report management.

Challenge-response quality verification for AI agents and MCP servers.

Cyber Host Artificial Intelligence (C.H.A.I) is Autonomous penetration testing MCP (Model Context Protocol) server with an integrated AI decision engine, multi-provider LLM support, and an extensible plugin architecture.

Connect to CTFd instance, download tasks and submit flags

Extracts Indicators of Compromise (IoCs) from text and checks their reputation using multiple threat intelligence services.

CVE database and vulnerability intelligence for AI agents. Search NIST NVD, check software security, find known vulnerabilities — no API key required.

Real-time CVE lookup via NIST NVD 2.0, CISA KEV alerts, EPSS exploitation probability, and MITRE ATT&CK mappings. 7 tools for AI-powered vulnerability assessment.

This tool creates an MCP server to bridge the gap between AI workflows and EMBA security analysis.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.