
MITRE ATT&CK
io.github.luongnv89由 GitHub 账号 luongnv89 发布v0.3.1更新于 Oct 24, 2026
MCP server exposing the MITRE ATT&CK framework via the official MCP Python SDK.
概览
让助手查询 MITRE ATT&CK 框架中的战术、技术、威胁组织、软件与缓解措施。
- 可以做什么
- 通过 get_techniques、get_technique_by_id、get_techniques_by_tactic、get_tactics、get_groups、get_techniques_used_by_group、get_software、get_mitigations、get_techniques_mitigated_by_mitigation 等工具开放 MITRE ATT&CK 知识库。覆盖 Enterprise、Mobile 与 ICS 领域,列表与关系类工具支持分页。数据会下载并缓存在本地,并建立索引以加快查询。
- 适用场景
- 适合威胁情报、检测工程、威胁狩猎、事件响应、红队演练、安全评估与安全培训等需要结构化 ATT&CK 数据的场景,也适合以编程方式查询 ATT&CK 的自动化与数据管道项目。
- 运行要求
- 本地 Python 包(PyPI 上的 mitre-mcp),需要 Python 3.11 或更高版本。可通过 stdio 或 localhost:8000 的 HTTP 模式运行。首次运行会从 MITRE 官方 CTI 地址下载 ATT&CK 数据到本地缓存目录,需要约 200 MB 可用磁盘空间;下载与刷新需要网络访问。未声明需要账号或 API 密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 MITRE ATT&CK,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
mitre-mcp: MITRE ATT&CK MCP Server
[MCP Registry] [PyPI Downloads]
[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
- Available MCP Tools
- Quick Start
- Web Frontend
- Documentation
- Configuration
- Performance
- Programmatic API
- Development
- Troubleshooting
- FAQ
- License
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
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
- Create and activate a virtual environment:
- Install from PyPI:
- Verify installation:
HTTP Mode (Recommended)
Start the server:
Expected output:
Configure your MCP client:
Add this JSON to your client's configuration file:
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:
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 setMITRE_HTTP_AUTH_TOKENso every request must carryAuthorization: Bearer <token>:or place an authenticating reverse proxy in front of a loopback-only server — nginx example (TLS + basic auth →
127.0.0.1:8000):The server logs a warning at startup whenever it binds a non-loopback host without
MITRE_HTTP_AUTH_TOKENset.
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:
Client configuration:
Note: Use absolute paths. HTTP mode is recommended for most use cases.
Force Data Download
Force a fresh download of MITRE ATT&CK data:
Example Screenshots
VSCode Configuration:
Tool Invocation:
Results:
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):
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):
Open http://localhost:5173/ — not the GitHub Pages URL.
3. Settings (gear in the chat header):
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:
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:
- On first run, downloads and stores data in the per-user cache directory
(
$XDG_CACHE_HOME/mitre-mcp, or~/.cache/mitre-mcpby default) - On subsequent runs, uses cached data if less than 14 days old
- Automatically refreshes data older than 14 days, using conditional
requests — a
304 Not Modifiedanswer 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. - Cache files are written atomically (temp file + rename), so a failed download never corrupts a good cache
- 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
- Use
--force-downloadto force fresh download
Performance
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):
Available clients:
- Python:
clients/python/mini-mcp-client.pywith full CLI - Node.js:
clients/nodejs/mini-mcp-client.jswith full CLI
See API-INTEGRATION.md for complete documentation.
Development
Clone and Install
Install Pre-commit Hooks
This sets up automatic code quality checks before each commit.
Run Tests
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-downloador delete~/.cache/mitre-mcp
Tool calls return errors
- Ensure technique IDs follow
T####orT####.###format - Keep names/tactics under 100 characters
MCP client cannot discover server
- Verify client configuration points to correct Python path
- Test manually: run
mitre-mcpand verify server starts - For HTTP mode: ensure
urlfield is set correctly
Chat UI: POST https://localhost:8000/mcp net::ERR_SSL_PROTOCOL_ERROR
- The GitHub Pages UI is HTTPS, so it rewrites
localhosttohttps://localhost:8000.mitre-mcp --httphas 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 athttp://localhost:<port>/v1.
Module not found: mcp.server.fastmcp
- Reinstall the pinned MCP SDK:
pip install "mcp>=1.28.1,<2"(ormcp[cli]>=1.28.1,<2if you also want the CLI extra) in your virtual environment — thefastmcpdistribution does not providemcp.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_DAYSor 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: [email protected]
来源:README.md,提交 86a27f2
工具
0版本历史
1- v0.3.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分