Explore MITRE CWE weaknesses, CAPEC attack patterns, mitigations, code examples, and mappings.
Explore MITRE CWE weaknesses and CAPEC attack patterns, mitigations, code examples, and mappings via MCP. STDIO or Streamable HTTP.
MITRE's CWE and CAPEC catalogs connect software and hardware weaknesses with attack mechanics. Search root causes, inspect mitigations and code examples, navigate CWE views and live hierarchies, and follow recorded CWE → CAPEC → ATT&CK mappings.
| Tool | Description |
|---|---|
cwe_list_reference | Discover views, filter vocabulary, workflow guidance, and catalog refresh health |
cwe_get_weakness | Retrieve CWE weaknesses or categories with selected sections and complete example pages |
cwe_get_attack_pattern | Retrieve CAPEC prerequisites, execution steps, mitigations, and recorded mappings |
cwe_search_weaknesses | Search weaknesses by text, platform, abstraction, consequences, status, or view |
cwe_search_attack_patterns | Search CAPEC by text, CWE or ATT&CK mapping, abstraction, severity, or likelihood |
cwe_get_view | Read a CWE view's metadata and direct members in published order |
cwe_get_hierarchy | Traverse live CWE parents, children, ancestors, or descendants within a view |
cwe_list_reference tooltopic: views, abstraction_levels, mitigation_phases, platforms, relationship_natures, filter_values, workflow, or versions; optional all-token label filterlimit (default 20, capped at 100) and cursor; pagination.nextCursor continues them. versions also returns catalogs with loaded versions, dates, counts, and refresh errorscwe_get_weakness toolsections supports summary, consequences, mitigations, relations, examples, detection, observed, platforms, and mappings; defaults to the first four, while [] requests an outlineentries[].kind is full or outline; notFound[].reason is not_found or wrong_type, and deferredIds carries whole IDs for another call. Categories are retrievable organizational records; views belong in cwe_get_viewexamples with optional exampleLanguage; exampleOffset defaults to 0 and exampleLimit to 3 (no fixed upper cap). Complete examples retain ordered prose and code; continue with examplePage.nextOffsetcwe_get_attack_pattern toolsections: summary, prerequisites, execution, skills, consequences, mitigations, examples, relations, or mappings; defaults to summary, prerequisites, execution, mitigations, and mappingssections: [] requests an outline. entries[].kind, per-ID notFound, and deferredIds distinguish complete selections, outlines, misses, and continuation; mappings preserve recorded CWE and ATT&CK IDscwe_search_weaknesses toolfilter, exact language, technology, abstraction, consequenceImpact, status, and viewId; omit filters to browse. View filtering includes same-view weakness membership closure; categories are excludedlimit defaults to 20, caps at 100; continue with pagination.nextCursorcwe_search_attack_patterns toolfilter, cweId, attackTechniqueId, abstraction, severity, and likelihood; CWE mappings are exact, while a parent ATT&CK technique includes recorded subtechniquesincludeInactive defaults to false, excluding Deprecated and Obsolete patterns. Results order by name matches, description matches, then numeric ID; limit defaults to 20, caps at 100; continue with pagination.nextCursorcwe_get_view toolid, with limit (default 20, capped at 100) and cursor; discover IDs through cwe_list_reference topic viewsmembers in source order, continued by pagination.nextCursor. found: false carries not_found or wrong_type; navigation views list top-level members, with descendants accessible through hierarchy traversalcwe_get_hierarchy toolid and direction: parents, children, ancestors, or descendants; viewId defaults to 1000, with all available explicitly. primaryOnly is valid only for ancestorsnodes and parent-to-child edges, found, retrievedAt, and hierarchyFingerprint; empty relations succeed, while upstream failures remain errors. Node names come from the loaded catalog and can lag live IDslimit defaults to 20, caps at 100 edges. Follow pagination.nextCursor; continuations re-fetch the traversal, and invalid_cursor requires restarting without a cursor when topology or the catalog changesBuilt on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
MITRE-specific:
cwe_list_reference topic versionsAgent-friendly output:
deferredIds, pagination.nextCursor, or examplePage.nextOffset; stale or incompatible cursors fail with invalid_cursor. Unsupported vocabulary fails with unknown_filter and discovery guidancecontent[] and structuredContent preserve the same selected values, including ordered example code. Catalog prose and code are reference data, never instructions to executeAdd the following to your MCP client configuration file.
{
"mcpServers": {
"mitre-cwe-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/mitre-cwe-mcp-server@latest"],
"env": { "MCP_TRANSPORT_TYPE": "stdio", "MCP_LOG_LEVEL": "info" }
}
}
}
Or with npx (no Bun required):
{
"mcpServers": {
"mitre-cwe-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/mitre-cwe-mcp-server@latest"],
"env": { "MCP_TRANSPORT_TYPE": "stdio", "MCP_LOG_LEVEL": "info" }
}
}
}
Or with Docker:
{
"mcpServers": {
"mitre-cwe-mcp-server": {
"type": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/mitre-cwe-mcp-server:latest"]
}
}
}
For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcp after both catalogs load
cwe.mitre.org and capec.mitre.org for initial catalogs, and cwe-api.mitre.org for version checks and live hierarchy calls.git clone https://github.com/cyanheads/mitre-cwe-mcp-server.git
cd mitre-cwe-mcp-server
bun install
cp .env.example .env
# edit .env for optional transport, authentication, and logging settings
No server-specific environment variables are required. Catalog sources, refresh intervals, and response limits are fixed; framework storage settings do not persist these catalogs.
| Variable | Description | Default |
|---|---|---|
MCP_TRANSPORT_TYPE | Transport: stdio or http. | stdio |
MCP_HTTP_PORT | HTTP server port. | 3010 |
MCP_HTTP_HOST | HTTP bind address. | 127.0.0.1 |
MCP_SESSION_MODE | HTTP session mode: stateless, stateful, or auto. | stateless |
MCP_AUTH_MODE | Authentication: none, jwt, or oauth. | none |
MCP_LOG_LEVEL | Log level (debug, info, warning, error, etc.). | info |
LOGS_DIR | Directory for log files (Node.js only). | <app-root>/logs |
STORAGE_PROVIDER_TYPE | Storage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1. | in-memory |
OTEL_ENABLED | Enable OpenTelemetry. | false |
See .env.example for every server setting and the common framework overrides.
Build and run the production version:
# One-time build
bun run rebuild
# Run the built server
bun run start:http
# or
bun run start:stdio
Run checks and tests:
bun run devcheck # Lints, formats, type-checks, and more
bun run test # Runs the test suite
| Directory | Purpose |
|---|---|
src/mcp-server/tools/definitions | Seven read-only tools. |
src/mcp-server/tools | Shared output schemas, section projection, budgets, and pagination. |
src/services/catalog | Catalog acquisition, XML normalization, indexes, refresh lifecycle, and live hierarchy. |
tests/ | Unit and integration tests, mirroring the src/ structure. |
docs/ | Design and generated directory reference. |
See CLAUDE.md for development guidelines and architectural rules. The short version:
try/catch in tool logicctx.log for logging, ctx.state for storagecreateApp() arrays in src/index.tsIssues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run test
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
CWE data: Copyright © 2006–2026, The MITRE Corporation. CAPEC data: Copyright © 2007–2026, The MITRE Corporation. CWE and CAPEC are MITRE trademarks; their data licenses and disclaimers are reproduced in THIRD_PARTY_NOTICES.md.
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y @cyanheads/mitre-cwe-mcp-serverMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-cyanheads-mitre-cwe-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/mitre-cwe-mcp-server"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceio.github.cyanheads/mitre-cwe-mcp-server works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.