threatmodel-mcp

threatmodel-mcp

Enables AI-powered threat modeling with tools for creating threat models, analyzing security threats, generating security controls, and validating architecture against best practices.

Category
访问服务器

README

<i><b>ThreatModel-MCP</b></i>

Model Context Protocol server for AI-powered threat modeling.<br>


<samp>

<b>Demo</b></br>

Web Application Architecture

<b>Setup</b>

  1. <b>Install dependencies</b><br> <code>pip install -r requirements.txt</code>

  2. <b>Install Graphviz</b> (optional, for PNG diagrams)<br>

    • <b>Windows</b>: Download from https://graphviz.org/download/<br>
    • <b>Mac</b>: <code>brew install graphviz</code><br>
    • <b>Linux</b>: <code>sudo apt-get install graphviz</code>
  3. <b>Configure MCP client</b> (Claude Desktop, etc.)<br>

    {
      "mcpServers": {
        "threatmodel": {
          "command": "python",
          "args": ["/full/path/to/threatmodel_server.py"]
        }
      }
    }
    

<b>Available Tools</b>

<code>create_threat_model</code>

Creates comprehensive threat models with components, boundaries, and data flows.

<b>Parameters:</b><br>

  • <code>system_name</code> - Name of the system<br>
  • <code>components</code> - Array of system components with types, boundaries, security controls<br>
  • <code>boundaries</code> - Trust boundaries with security levels (0-10)<br>
  • <code>dataflows</code> - Data flows between components with protocols and classifications<br>
  • <code>output_format</code> - "diagram", "pytm_code", "threats", or "full_analysis"<br>
  • <code>auto_save</code> - Auto-save files (default: true)<br>
  • <code>save_path</code> - Directory to save files (default: current directory)

<code>analyze_security_threats</code>

Performs deep security analysis using multiple frameworks.

<b>Parameters:</b><br>

  • <code>analysis_depth</code> - "basic", "standard", "comprehensive", or "paranoid"<br>
  • <code>threat_frameworks</code> - ["STRIDE", "MITRE_ATTACK", "OWASP", "NIST", "CIS"]<br>
  • <code>focus_areas</code> - Authentication, data protection, network security, etc.<br>
  • <code>compliance_frameworks</code> - ["SOC2", "ISO27001", "HIPAA", "PCI-DSS", "GDPR"]

<code>generate_security_controls</code>

Generates security control recommendations based on threats.

<b>Parameters:</b><br>

  • <code>threats</code> - Array of identified threats<br>
  • <code>risk_appetite</code> - "low", "medium", or "high"<br>
  • <code>technology_stack</code> - Current technologies (AWS, k8s, etc.)<br>
  • <code>prioritization_method</code> - "risk_based", "quick_wins", "compliance_driven"

<code>validate_architecture</code>

Validates architecture against security best practices.

<b>Parameters:</b><br>

  • <code>components</code> - System components to validate<br>
  • <code>validation_rules</code> - ["zero_trust", "encryption_in_transit", "api_gateway_pattern"]<br>
  • <code>architecture_patterns</code> - ["microservices", "serverless", "hybrid_cloud"]

<b>Component Types</b>

<b>Actors:</b> user, admin, service_account<br> <b>Services:</b> server, api_gateway, microservice, lambda, container<br> <b>Data:</b> database, cache, message_queue, file_storage<br> <b>Infrastructure:</b> load_balancer, firewall, external_service


<b>Protocols & Classifications</b>

<b>Protocols:</b> HTTPS, gRPC, WebSocket, SQL, Redis, S3 API<br> <b>Data Classifications:</b> PUBLIC → INTERNAL → CONFIDENTIAL → RESTRICTED → TOP_SECRET


<b>Auto-Save Features</b>

Generated files (with timestamps):<br>

  • <code>SystemName_threatmodel_YYYYMMDD_HHMMSS.png</code> - Diagram (when output_format="diagram")<br>
  • <code>SystemName_threatmodel_YYYYMMDD_HHMMSS.dot</code> - DOT source (always)<br>
  • <code>SystemName_threatmodel_YYYYMMDD_HHMMSS.py</code> - PyTM code (always)<br>
  • <code>SystemName_threatmodel_analysis_YYYYMMDD_HHMMSS.md</code> - Analysis report (when output_format="full_analysis")

<b>Example Usage</b>

<b>Example 1: Codebase Analysis</b>

<b>Prompt:</b><br> <code>"Create a high level threat diagram of current codebase"</code>

OpenAI Codex Architecture

<i>Example threat model diagram generated from a cloned <a href="https://github.com/openai/codex">OpenAI Codex</a> codebase, showing multi-layer security boundaries, component classifications, and encrypted data flows between services.</i>

<b>Example 2: Web Application Architecture</b>

<b>Prompt:</b><br> <code>"A web application where the user interacts with a web server, which in turn communicates with a database server. The web server and database server are outside the user's trust boundary. The user connects to the web application via a browser. The web server handles requests and responses, and the database server stores application data. The trust boundary is around the user only; both the web server and database server are outside this boundary"</code>

Web Application Architecture

<i>Example threat model showing user trust boundary with web and database servers in untrusted zone.</i>

<i> Refer to threat analysis report in assets/Web_Application_System_Threat_Analysis_Report.md </i>


<b>Troubleshooting</b>

<b>Graphviz issues:</b> Verify with <code>dot -V</code><br> <b>DOT syntax errors:</b> Component names automatically sanitized<br> <b>No Python:</b> Ensure Python in PATH


</samp>

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选