vuln_mcp_app

vuln_mcp_app

An intentionally vulnerable, locally-runnable MCP security laboratory (a 'DVWA for MCP') used to evaluate a separate FYP security scanner.

Category
访问服务器

README

vuln_mcp_app

An intentionally vulnerable, locally-runnable Model Context Protocol (MCP) security laboratory — a controlled target (conceptually a "DVWA for MCP") used to evaluate a separate FYP security scanner. This app is the target, not the scanner. It hosts a small, documented set of MCP vulnerabilities and emits evidence; it never reports whether it is vulnerable (no oracle, SEC-006).

⚠️ Educational / research use only. Everything runs locally with synthetic data and dummy secrets (DEMO_SECRET_*). No real credentials, no external targets, no Internet scanning, no host access.

Scope (exactly three labs)

ID OWASP MCP Vulnerability Status
VULN-MCP03-001 MCP03 Tool Poisoning implemented
VULN-MCP05-001 MCP05 Command Injection & Execution implemented
VULN-MCP10-001 MCP10 Context Injection & Over-Sharing pending

No additional vulnerability labs are in scope. Each implemented lab ships a VULNERABLE and a genuinely-fixed SECURE mode.

Run it (no Docker — one command + a browser)

The whole app runs from a single uvicorn process: FastAPI serves the built UI at / and the API under /api.

First time

# 1) Build the UI once (Node 18+). Produces frontend/dist.
cd frontend && npm install && npm run build && cd ..

# 2) Run the app (uv resolves Python deps automatically; Python 3.12+).
uv run uvicorn backend.app.main:app --reload --host 127.0.0.1 --port 8000

Then open http://127.0.0.1:8000 — the lab UI appears. Interactive API docs are at http://127.0.0.1:8000/docs.

Prefer a classic venv instead of uv?

python -m venv .venv && source .venv/Scripts/activate   # Windows Git Bash
pip install -r backend/requirements.txt
uvicorn backend.app.main:app --reload --host 127.0.0.1 --port 8000

After the first build

Just run the uvicorn command and open the browser. Rebuild the UI (npm run build) only after changing frontend code.

Frontend hot-reload (optional, for UI development)

Run the API on :8000 and the Vite dev server on :5173 (it proxies /api):

# terminal 1
uv run uvicorn backend.app.main:app --reload --host 127.0.0.1 --port 8000
# terminal 2
cd frontend && npm run dev      # open http://127.0.0.1:5173

Tests

# Backend (pytest)
uv run pytest                    # or: .venv/Scripts/python -m pytest

# Frontend (Vitest + tsc)
cd frontend && npm test && npx tsc --noEmit

Architecture

Browser (React SPA, served by FastAPI at :8000)
        │  HTTP/JSON  (/api)
        ▼
  FastAPI control plane (ordinarily secure)  ── MCP client ──►  MCP tool registry
        │                                                        (vulnerable | secure)
        ▼                                                              │
   SQLite (labs, tools, telemetry, evidence)  ◄── telemetry/evidence ─┘

The control plane is ordinarily-secure infrastructure (SEC-004). Only the clearly-labelled MCP-plane tools become vulnerable, and only in vulnerable mode. Intentionally-vulnerable files carry a banner: # INTENTIONALLY VULNERABLE — <VULN-ID> — see docs/GROUND-TRUTH.md.

MCP transport: Phase 0 uses an in-process registry transport so the whole app runs in one process. The streamable-HTTP MCP transport (official SDK) is a future upgrade behind the same client API.

MCP05 sandbox (when built): with Docker removed, command execution for the MCP05 lab runs in a constrained in-process subprocess runner — an ephemeral temp work dir, a project-provided fake convert shim, a hard timeout, and no shell in secure mode. Blast radius stays local and synthetic (SEC-001/003); the OS-level isolation Docker gave (no-network, cap-drop) is replaced by that constrained runner. See sandbox/README.md.

Tech stack

React + TypeScript + Vite + Tailwind · Python 3.12 + FastAPI + Pydantic v2 · official Python MCP SDK · SQLite + SQLModel · pytest + httpx · Vitest + Testing Library. Run with uv/uvicorn (no Docker).

API surfaces (analysable by the FYP)

GET /api/health · GET /api/labs · GET /api/labs/{id} · POST /api/labs/{id}/mode|reset|attack|start · GET /api/labs/{id}/telemetry · GET /api/mcp/servers|tools · GET /api/mcp/tools/{id} · POST /api/mcp/tools/{id}/call · GET /api/vulnerabilities (catalog metadata only) · GET /api/evidence.

No endpoint discloses a vulnerability verdict (SEC-006).

Using it against the FYP (evaluation loop)

  1. Start the target (MCP03 is vulnerable by default). 2. Confirm the lab active via the manual verification in docs/GROUND-TRUTH.md. 3. Run the FYP against the HTTP + MCP surfaces. 4. Compare findings to docs/GROUND-TRUTH.md.
  2. Toggle Secure and re-run to measure false positives. 6. Reset and repeat.

Project docs

  • docs/GROUND-TRUTH.md — the answer key (per-vuln + matrix).
  • docs/OWASP-MCP-MAPPING.md — OWASP MCP Top 10 mapping.
  • docs/TEST-SCENARIOS.md — FYP-validation scenarios.
  • CLAUDE.md — implementation memory / current phase state.
  • docs/PRD.md, docs/TDD.md — design contracts, kept local only (git-ignored). Updated 2026-08-21 to the Docker-free run model.

Current state

MCP03 and MCP05 complete (all phases). Runs Docker-free via uvicorn. MCP10 is scaffolded in the catalog and not yet built. See CLAUDE.md.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选