mitre-mcp 标志

mitre-mcp

组织
Montimage

A Model Context Protocol (MCP) server that provides tools for working with the MITRE ATT&CK framework using the mitreattack-python library and the official MCP Python SDK.

发布者Montimage
代码仓库mitre-mcp
语言JavaScript
复刻数
2
星标数
13
可用工具
0
传输类型stdio, streamable-http
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    mitre-mcp 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 13 个 Star 和 2 个 Fork。

mitre-mcp: MITRE ATT&CK MCP Server

MCP Registry

PyPI version Python versions Test status License Code style: black Pre-commit

Production-ready Model Context Protocol (MCP) server that exposes the MITRE ATT&CK® framework to LLMs, AI assistants, and automation workflows. Built with the official MCP Python SDK and mitreattack-python library for secure, high-performance access to adversary tactics, techniques, groups, software, and mitigations.

Available in the MCP Registry (search for io.github.luongnv89/mitre-mcp).

Highlights

  • LLM-native experience – Seamless integration with Claude, Windsurf, Cursor, and any MCP-compatible client
  • Secure-by-default – Validated inputs, TLS verification, disk-space checks, and structured error handling
  • High performance – O(1) technique lookups using pre-built indices (80-95% faster than scanning)
  • Flexible deployment – stdio for local clients or HTTP server for web-based integrations

Table of Contents

Features

  • Comprehensive MITRE ATT&CK Coverage - All techniques, tactics, groups, software, and mitigations
  • Multi-Domain Support - Enterprise, Mobile, and ICS ATT&CK domains
  • Intelligent Caching - Atomic, per-user caching with conditional refreshes, stale-serve with background refresh, and configurable expiry (default: 14 days)
  • Fast Startup - Enterprise loads eagerly; mobile and ICS domains lazy-load on first use
  • Performance Optimized - O(1) lookups using pre-built indices (80-95% faster)
  • Dual Transport Modes - stdio for local clients, HTTP for web integrations
  • CORS-Enabled HTTP Server - Async notifications and cross-origin request support
  • Comprehensive Testing - pytest suite with an enforced coverage gate
  • Pre-commit Quality Checks - Automated formatting, linting, type checking, and security scanning
  • Input Validation - Secure-by-default with validated inputs and sanitized responses
  • Programmatic API - Python and Node.js clients (see API-INTEGRATION.md)

Available MCP Tools

Tool NameDescription
get_techniquesList all techniques with filtering options
get_technique_by_idLook up specific technique by ID (e.g., T1055)
get_techniques_by_tacticGet techniques for a specific tactic (e.g., persistence)
get_tacticsList all tactical categories
get_groupsList all threat actor groups
get_techniques_used_by_groupGet techniques used by a specific group (e.g., APT29)
get_softwareList malware and tools with filtering
get_mitigationsList all security mitigations
get_techniques_mitigated_by_mitigationGet techniques addressed by a specific mitigation

All list and relationship tools accept limit/offset paging parameters (default page size 20, maximum 200 — see MITRE_DEFAULT_PAGE_SIZE and MITRE_MAX_PAGE_SIZE in CONTRIBUTING.md) and return a pagination block (total, offset, limit, has_more).

Quick Start

Installation

  1. Create and activate a virtual environment:
bash
python3 -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate.bat
  1. Install from PyPI:
bash
pip install mitre-mcp
  1. Verify installation:
bash
mitre-mcp --help

HTTP Mode (Recommended)

Start the server:

bash
mitre-mcp --http

Expected output:

2025-11-17 22:40:10,991 - mitre_mcp.mitre_mcp_server - INFO - Starting MITRE ATT&CK MCP Server (HTTP mode on localhost:8000)
======================================================================
MITRE ATT&CK MCP Server is ready (Streamable HTTP mode)
Server URL: http://localhost:8000
MCP Endpoint: http://localhost:8000/mcp

Add this to your MCP client configuration:
{
  "mcpServers": {
    "mitreattack": {
      "url": "http://localhost:8000/mcp"
    }
  }
}
======================================================================

Configure your MCP client:

Add this JSON to your client's configuration file:

json
{
  "mcpServers": {
    "mitreattack": {
      "url": "http://localhost:8000/mcp"
    }
  }
}

Configuration file locations:

  • macOS (Claude Desktop): ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows (Claude Desktop): %APPDATA%\Claude\claude_desktop_config.json
  • Linux (Claude Desktop): ~/.config/Claude/claude_desktop_config.json
  • VSCode: Configure in your MCP extension settings

Custom host and port:

bash
mitre-mcp --http --host 0.0.0.0 --port 8080

Then use http://your-server-ip:8080/mcp in your client configuration.

Security — a non-loopback bind is unauthenticated by default. Binding --host 0.0.0.0 (or any non-loopback address) exposes the MCP endpoint to the whole network: the data is public, but the endpoint is an open CPU and memory amplifier. Either set MITRE_HTTP_AUTH_TOKEN so every request must carry Authorization: Bearer <token>:

bash
MITRE_HTTP_AUTH_TOKEN=$(openssl rand -hex 32) mitre-mcp --http --host 0.0.0.0 --port 8080

or place an authenticating reverse proxy in front of a loopback-only server — nginx example (TLS + basic auth → 127.0.0.1:8000):

nginx
server {
    listen 443 ssl;
    server_name mcp.example.com;
    ssl_certificate     /etc/nginx/certs/mcp.example.com.pem;
    ssl_certificate_key /etc/nginx/certs/mcp.example.com.key;

    location / {
        auth_basic           "mitre-mcp";
        auth_basic_user_file /etc/nginx/.htpasswd;
        proxy_pass           http://127.0.0.1:8000;
        proxy_set_header     Host $host;
    }
}

The server logs a warning at startup whenever it binds a non-loopback host without MITRE_HTTP_AUTH_TOKEN set.

Why HTTP mode?

  • Multiple clients can connect simultaneously
  • Better concurrency and async support
  • Easier debugging with HTTP tools
  • CORS support for web-based clients
  • No path configuration needed

stdio Mode (Alternative)

For local-only clients that require stdio transport:

bash
mitre-mcp

Client configuration:

json
{
  "mcpServers": {
    "mitreattack": {
      "command": "/absolute/path/to/.venv/bin/python",
      "args": ["-m", "mitre_mcp.mitre_mcp_server"]
    }
  }
}

Note: Use absolute paths. HTTP mode is recommended for most use cases.

Force Data Download

Force a fresh download of MITRE ATT&CK data:

bash
mitre-mcp --http --force-download

Example Screenshots

VSCode Configuration:

Configure

Tool Invocation:

Tool call

Results:

Result

Web Frontend

A React chat UI lives in frontend/. A hosted copy is at https://montimage.github.io/mitre-mcp/. That public HTTPS page can call cloud LLM providers (Gemini, OpenRouter). It cannot reach anything on this machine — mitre-mcp on localhost:8000, Ollama, LM Studio, or any other loopback endpoint. The browser blocks public sites from the loopback address space (net::ERR_SSL_PROTOCOL_ERROR if it upgrades the MCP URL to https://localhost:8000/mcp, CORS / private-network errors for http://localhost:…/v1/models).

Use the local UI whenever the MCP server or the LLM runs on your computer.

Local setup (MCP server + chat UI)

Two terminals, from a clone of this repository.

1. Install and start the MCP server (Python >= 3.11):

bash
uv sync --locked --extra dev
source .venv/bin/activate
mitre-mcp --http

Wait for MCP Endpoint: http://localhost:8000/mcp. The first start downloads ATT&CK data into ~/.cache/mitre-mcp.

2. Start the chat UI (Node 24):

bash
cd frontend
npm ci
npm run dev

Open http://localhost:5173/ — not the GitHub Pages URL.

3. Settings (gear in the chat header):

SettingLocal value
MCP host / portlocalhost / 8000 (dev proxies /mcp to the server)
LLM providerOllama, Gemini, OpenRouter, or OpenAI-compatible

For a local OpenAI-compatible server (LM Studio, llama.cpp, vLLM, …):

  • Provider: OpenAI-compatible
  • Endpoint URL: http://localhost:<port>/v1 (example: http://localhost:20128/v1)
  • Model: an id the endpoint lists at /v1/models
  • API key: leave empty unless that server requires one

The endpoint must allow CORS from http://localhost:5173. If Ollama is not running, do not leave Ollama selected — the default probe hits localhost:11434 and Vite logs http proxy error: /api/tags.

For more details, see frontend/README.md.

Documentation

We provide three comprehensive guides tailored to different use cases:

1. Beginner's Guide

Beginner-Playbook.md - For those new to MITRE ATT&CK or cybersecurity

Ideal for:

  • Non-technical users
  • Security awareness training
  • Basic threat intelligence
  • General cybersecurity education

2. Advanced Playbook

Playbook.md - For security professionals using MCP clients

Ideal for:

  • Security analysts
  • Threat hunters
  • Incident responders
  • Security engineers

Includes 10 ready-to-use scenarios:

  • Threat Intelligence
  • Detection Engineering
  • Threat Hunting
  • Red Teaming
  • Security Assessment
  • Incident Response
  • Security Operations
  • Security Training
  • Vendor Evaluation
  • Risk Management

3. API Integration Guide

API-INTEGRATION.md - For developers building automation and custom integrations

Ideal for:

  • Backend developers
  • Automation engineers
  • Data pipeline developers
  • Custom tooling projects

Includes:

  • Complete Python and Node.js client implementations
  • Protocol requirements and examples
  • Testing and debugging tools
  • Common integration patterns

Configuration

Environment Variables

Set before starting mitre-mcp to customize behavior:

VariableDefaultPurpose
MITRE_ENTERPRISE_URL, MITRE_MOBILE_URL, MITRE_ICS_URLOfficial MITRE CTI GitHub URLsOverride ATT&CK bundle locations or point to internal mirror
MITRE_DATA_DIR~/.cache/mitre-mcpStore cached bundles in custom directory
MITRE_DOWNLOAD_TIMEOUT120HTTP timeout in seconds for bundle downloads
MITRE_CACHE_EXPIRY_DAYS14Maximum age before cached data is refreshed
MITRE_REQUIRED_SPACE_MB200Disk space threshold checked before downloading
MITRE_DEFAULT_PAGE_SIZE / MITRE_MAX_PAGE_SIZE20 / 200Default and maximum records returned by list tools
MITRE_MAX_DESC_LENGTH500Trimmed description length in responses
MITRE_LOG_LEVELINFOLogging verbosity (DEBUG, INFO, WARNING, etc.)
MITRE_CORS_ORIGINSlocalhost originsCORS allowed origins for HTTP mode (comma-separated list; * is an explicit opt-in)
MITRE_HTTP_AUTH_TOKENunset (no auth)Bearer token required on every HTTP request when set; recommended for non-loopback binds

To let a hosted UI (e.g. the Netlify deployment) call the server cross-origin, set MITRE_CORS_ORIGINS to its origin, e.g. MITRE_CORS_ORIGINS="https://mitre-mcp.netlify.app,http://localhost:5173". Credentials are never allowed in any CORS configuration.

Data Caching

The server automatically caches MITRE ATT&CK data to improve performance:

  1. On first run, downloads and stores data in the per-user cache directory ($XDG_CACHE_HOME/mitre-mcp, or ~/.cache/mitre-mcp by default)
  2. On subsequent runs, uses cached data if less than 14 days old
  3. Automatically refreshes data older than 14 days, using conditional requests — a 304 Not Modified answer reuses the cached bundles. Expired-but-present data is served immediately while the refresh runs in the background; startup never blocks on it and a failed refresh keeps the existing cache.
  4. Cache files are written atomically (temp file + rename), so a failed download never corrupts a good cache
  5. Only the enterprise domain is parsed at startup; the mobile and ICS bundles are lazy-loaded on first use, so cold starts stay fast when they are never queried
  6. Use --force-download to force fresh download

Performance

ScenarioImprovementNotes
Enterprise technique lookup80-95% fasterPre-built O(1) indices for groups, mitigations, and techniques
ATT&CK data downloads20-40% fasterHTTP connection pooling with TLS session reuse
Warm cache startup<2sCached bundles reused for instant LLM queries

Benchmarks: macOS 14 / Apple M3 Pro with Python 3.11. Use MITRE_LOG_LEVEL=DEBUG for timing logs.

Programmatic API

For automation, custom integrations, and batch processing, see API-INTEGRATION.md.

Quick example (Python):

python
from clients.python.mini_mcp_client import MitreMCPClient


async def main():
    client = MitreMCPClient(host="localhost", port=8000)

    # Get all tactics
    tactics = await client.call_tool("get_tactics", {"domain": "enterprise-attack"})

    # Get techniques for a group
    techniques = await client.call_tool(
        "get_techniques_used_by_group", {"group_name": "APT29", "domain": "enterprise-attack"}
    )

Available clients:

  • Python: clients/python/mini-mcp-client.py with full CLI
  • Node.js: clients/nodejs/mini-mcp-client.js with full CLI

See API-INTEGRATION.md for complete documentation.

Development

Clone and Install

bash
git clone https://github.com/montimage/mitre-mcp.git
cd mitre-mcp
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Install Pre-commit Hooks

bash
pre-commit install

This sets up automatic code quality checks before each commit.

Run Tests

bash
pytest                      # Full test suite with coverage
pre-commit run --all-files  # All quality checks

Code Quality Tools

Formatting:

  • black - Python code formatter
  • isort - Import organizer
  • prettier - YAML/JSON/Markdown formatter

Linting & Type Checking:

  • flake8 - Python linter
  • mypy - Static type checker
  • pydocstyle - Docstring checker

Security:

  • bandit - Security vulnerability scanner
  • File validators - YAML, JSON, TOML, private key detection

Testing:

  • pytest - test suite with coverage gate before commit
  • Installation test - Package verification
  • Import verification - Module importability
  • CLI test - Entry point validation

Troubleshooting

Download fails with "Insufficient disk space"

  • Free at least 200 MB in the data directory or set MITRE_DATA_DIR=/path/to/storage

Data never updates

  • Cached bundles refresh automatically after 14 days
  • Force refresh: mitre-mcp --force-download or delete ~/.cache/mitre-mcp

Tool calls return errors

  • Ensure technique IDs follow T#### or T####.### format
  • Keep names/tactics under 100 characters

MCP client cannot discover server

  • Verify client configuration points to correct Python path
  • Test manually: run mitre-mcp and verify server starts
  • For HTTP mode: ensure url field is set correctly

Chat UI: POST https://localhost:8000/mcp net::ERR_SSL_PROTOCOL_ERROR

  • The GitHub Pages UI is HTTPS, so it rewrites localhost to https://localhost:8000. mitre-mcp --http has no TLS. Open http://localhost:5173 instead (see Web Frontend).

Chat UI: CORS / “loopback address space” when calling a local LLM

  • Same cause: a public origin cannot fetch http://localhost:…. Run the frontend locally and point the OpenAI-compatible provider at http://localhost:<port>/v1.

Module not found: mcp.server.fastmcp

  • Reinstall the pinned MCP SDK: pip install "mcp>=1.28.1,<2" (or mcp[cli]>=1.28.1,<2 if you also want the CLI extra) in your virtual environment — the fastmcp distribution does not provide mcp.server.fastmcp; the package's declared pin does

FAQ

Does mitre-mcp work offline?

  • Yes. Once bundles are cached, the server works offline until cache expires.

Which Python versions are supported?

  • Python 3.11 through 3.14 (see pyproject.toml).

How often is data refreshed?

  • By default every 24 hours. Adjust MITRE_CACHE_EXPIRY_DAYS or use --force-download.

Is HTTP mode safe for production?

  • HTTP mode serves on localhost:8000 by default. Use firewall or reverse proxy if exposing externally.

License

MIT License - See LICENSE file for details.

About Montimage

mitre-mcp is developed and maintained by Montimage, a cybersecurity company specializing in network monitoring, security analysis, and AI-driven threat detection solutions. We develop innovative tools that help organizations protect their digital assets and ensure network security.

For questions or support: luong.nguyen@montimage.eu

安装

TypingMind
{
  "mcpServers": {
    "mitre-mcp": {
      "command": "mitre-mcp",
      "args": []
    }
  }
}

将 mitre-mcp MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 mitre-mcp 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 您可以在自己的设备上本地运行 MCP,也可以通过 URL 连接远程 MCP 服务器。

方式 1:使用本地连接器

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 mitre-mcp 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 mitre-mcp MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "mitre-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 mitre-mcp MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 mitre-mcp MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 mitre-mcp 帮我完成这项任务吗?
mitre-mcp
当然。我已阅读。
以下是我使用 mitre-mcp 得到的结果。

方式 2:添加 MCP 服务器 URL

如果 mitre-mcp 已托管在远程服务器上,或您的团队希望让多个用户共用一个连接器,请选择此方式。

1

打开 MCP 连接器

在 TypingMind 中,前往“插件”,打开“MCP 连接器”,然后选择“添加 URL”。

  1. 在您的浏览器中打开 TypingMind。
  2. 进入“插件”。
  3. 打开“MCP 连接器”。
  4. 点击“添加 URL”。
TypingMind 的“添加自定义 MCP 服务器 URL”表单
2

粘贴服务器 URL

在“服务器 URL”字段中输入 提供商提供的 MCP 服务器 URL。根据服务器要求,添加连接名称、描述、图标、自定义 HTTP 请求头或 OAuth 客户端设置。

  1. 将 提供商提供的 MCP 服务器 URL 粘贴到“服务器 URL”字段中。
  2. 为 mitre-mcp 输入连接名称。
  3. 您可以添加描述和图标,以便更容易识别此连接。
  4. 如果服务器需要身份验证,请添加自定义 HTTP 请求头或 OAuth 客户端信息。
3

创建连接

点击“创建连接”,然后返回插件列表,确认新的 MCP 连接显示为“有效”。

  1. 点击“创建连接”。
  2. 返回 MCP 连接器列表。
  3. 确认 mitre-mcp 连接显示为“有效”。
  4. 如果连接未立即出现,请刷新插件列表。
4

切换模型,无需重新连接

使用您偏好的模型开始聊天,在“插件”中启用 mitre-mcp 工具,并根据需要随时切换到其他模型。该 MCP 连接在 TypingMind 工作区中仍然可用。

  1. 在 TypingMind 中开始新聊天。
  2. 选择您想使用的 AI 模型。
  3. 在“插件”中启用 mitre-mcp 工具。
  4. 需要时,请让模型使用该工具。
  5. 切换到其他 AI 模型,继续使用同一个 MCP 连接。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 mitre-mcp 帮我完成这项任务吗?
mitre-mcp
当然。我已阅读。
以下是我使用 mitre-mcp 得到的结果。

常见问题

mitre-mcp MCP 服务器有什么用途?

mitre-mcp 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 mitre-mcp MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 mitre-mcp,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 mitre-mcp MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 mitre-mcp 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 mitre-mcp MCP 连接到 TypingMind?

您可以通过本地 MCP 连接器,或添加远程 MCP 服务器 URL,在 TypingMind 中连接 mitre-mcp。当服务器需要访问您设备上的文件、应用或私有资源时,请使用本地连接器;当 MCP 服务器托管在远程时,请使用服务器 URL。

mitre-mcp MCP 在 TypingMind 中提供哪些工具?

mitre-mcp 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 mitre-mcp MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 mitre-mcp 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇