Explore MITRE CWE weaknesses, CAPEC attack patterns, mitigations, code examples, and mappings.
One address for any MCP client. No sign-in needed on this server.
7 read
Grouped by tool name. At most: only reads or looks up information.
Odel charges nothing per call. The publisher may charge for its own service.
Explore MITRE CWE weaknesses and CAPEC attack patterns, mitigations, code examples, and mappings via MCP. STDIO or Streamable HTTP.
Public Hosted Server: https://mitre-cwe.caseyjhand.com/mcp
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 attack patterns, categories, and views: prerequisites, execution steps, mitigations, members, and recorded mappings |
cwe_search_weaknesses | Search weaknesses by text, platform, abstraction, consequences, status, mapping usage, view, taxonomy mapping (CERT C ARR30-C), or observed-example CVE |
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 filter on labels, using the word-start and bounded-prefix rule below (script finds JavaScript)views lists every CWE view with its direct member count, and a filter-defined view's filterDefinitionfilter_values lists weakness statuses, mapping usage, and taxonomy names, consequence impacts, and CAPEC statuses, severity, and likelihoodlimit (default 20, max 100) and pagination.nextCursor; versions adds each loaded catalog's version, date, counts, and refresh errorscwe_get_weakness toolCWE-79, CWE79, cwe 079, CWE_79, or 79); up to 20 distinct items are processed per call and the rest return in deferredIds. A malformed item comes back in notFound without failing the batch; only an item holding a control character other than whitespace, or a non-ID item over 150 characters, rejects the callsections: summary, consequences, mitigations, relations, examples, detection, observed, platforms, mappings, notes (default: the first four); [] returns an outlinesummary includes recorded alternate terms (XSS), ordinalities (Primary, Resultant, Indirect), and background details, platforms adds functional areas and affected resources, and relations names each related weakness. notes returns every note MITRE records for weaknesses and categories, such as Relationship, Maintenance, Terminology, and Research Gap notesentries[].kind is full, partial (default sections that did not fit the response budget are listed in outline with their sizes, and notice groups re-calls by their complete response size, keeping example parameters only on the examples group), or outline; notFound[].reason is not_found, wrong_type (a view, which belongs to cwe_get_view, or a prefixed ID of the other catalog), or invalid_id (an item that is no ID, echoed trimmed; NVD-CWE-noinfo and NVD-CWE-Other get their own guidance). Categories resolve hereexampleLanguage and page with exampleOffset (default 0), exampleLimit (default 3, no fixed cap), and examplePage.nextOffset. With sections omitted, setting any of the three to a non-default value adds examples after the defaults (outlined with its page size and a re-call when it does not fit); explicit sections without examples ignore them, and guidance gives the re-call that adds examples. Each example keeps its ordered prose and code, with code laid out as MITRE's pages show it (4 spaces per indentation level), and lists the references it cites in referencescwe_get_attack_pattern toolCAPEC-66, CAPEC66, capec_066, or 66), Deprecated and Obsolete included; up to 20 distinct items per call, the rest in deferredIdssections: summary, prerequisites, execution, skills, consequences, mitigations, examples, relations, mappings, notes (default: summary, prerequisites, execution, mitigations, and mappings for patterns; summary and relations for categories and views); [] returns an outlineentries[].type is attack_pattern, category, or view, and only patterns carry abstraction. A category or view's relations list its direct members in source order, or for a filter-defined view its source XPath as filterDefinition; its mappings and notes carry the recorded taxonomy mappings, references, and MITRE notesCAPEC-1000 (Mechanisms of Attack) or CAPEC-3000 (Domains of Attack) to browse patterns by categoryentries[].kind and notFound contract as cwe_get_weakness; CAPEC patterns, categories, and views all resolve here, so wrong_type marks only a prefixed CWE ID. Mappings keep the recorded CWE and ATT&CK IDscwe_search_weaknesses toolfilter over the name, MITRE's recorded alternate terms (XSS, ReDoS, UAF), the description, and the extended description, plus exact language, technology, abstraction, consequenceImpact, status, mappingUsage, taxonomyName, taxonomyEntryId, observedCveId, and viewId; no filters browses the catalogfilter token matches at a word start, after _, or at a camelCase hump (dos finds ReDoS). Tokens of at least four Unicode letters also match after exactly one un or mis prefix at a word start (trusted finds untrusted; config finds misconfiguration). Prefixes are never stripped recursively; spelling coincidences remain possible. Other compounds are searched as written: serialization does not find CWE-502, deserialization does. A token ending in a digit never matches before another digit (79 skips RFC 793)mappingUsage, such as Allowed, Allowed-with-Review, or Prohibited, which says whether the entry may be used to map a vulnerabilitytaxonomyName (such as CERT C Secure Coding or ISA/IEC 62443) and taxonomyEntryId (such as ARR30-C or A1, any case) find the weaknesses that record a taxonomy mapping, both holding on one mapping when given together; observedCveId (such as CVE-2021-44228) finds the weaknesses MITRE cites that CVE on as an observed example, not NVD's CVE-to-CWE assignments. Each result then lists every mapping (matchedTaxonomyMappings) or observed example (matchedObservedExamples) that matchedviewId includes same-view membership closure, or for a filter-defined view the weaknesses its source XPath filter selects (CWE-658 C, CWE-702 Implementation, …). Categories are excluded; every status is included by defaultcwe_get_weakness returns the terms in summary. limit default 20, max 100; continue with pagination.nextCursorcwe_search_attack_patterns toolfilter over the name, recorded alternate terms (MITM), and the description, using the same word-start and bounded-prefix rule as cwe_search_weaknesses, plus cweId, attackTechniqueId, abstraction, severity, and likelihood; CWE mappings match exactly, and a parent ATT&CK technique includes its recorded subtechniquesincludeInactive (default false) adds Deprecated and Obsolete patterns. Ranked by all tokens in the name or in one alternate term, then in the description, then any other match, then numeric ID; cwe_get_attack_pattern returns the terms in summary. limit default 20, max 100; continue with pagination.nextCursorcwe_get_view toolid (from cwe_list_reference topic views); limit default 20, max 100, continued by pagination.nextCursormembers in published order. Navigation views list only top-level members; cwe_get_hierarchy reaches descendantsfilterDefinition is its source XPath, and cwe_search_weaknesses with its viewId returns the weaknesses that filter selects. A filter with a part the server does not evaluate is named as such in guidance, and that search returns none with a noticefound: false carries not_found or wrong_typecwe_get_hierarchy toolid and a direction: parents, children, ancestors, or descendants; viewId defaults to 1000, or all for every view. primaryOnly applies to ancestors only. Parents and children include category and view relations and match the first level of the same view's treenodes, parent-to-child edges, found, retrievedAt, and hierarchyFingerprint. Empty relations succeed; upstream failures are errors, and a temporary MITRE refusal (HTTP 403) is retryable after a few minutes. Node names come from the loaded catalog and can lag the live APIhierarchy_timeout, while caller cancellation is nonretryable. Source-recorded relations remain available through cwe_get_weakness, but do not replace live children or descendantslimit default 20, max 100 edges; each page lists only the nodes its edges reference, plus any root without edges on the first page. Each pagination.nextCursor call re-fetches the traversal; invalid_cursor means the topology or catalog changed, so restart without a cursorBuilt 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_CACHE_DIR), and a later start loads the saved copy without waiting on MITRE, so a restart works while MITRE is unreachable. The first start, or any start without a usable saved copy, needs MITRE's CWE and CAPEC download sourcescwe_list_reference topic versions, which also reports whether each catalog came from the cache or a downloadAgent-friendly output:
deferredIds, pagination.nextCursor, or examplePage.nextOffset; stale cursors fail with invalid_cursor, unknown vocabulary with unknown_filter, whose message names the field and value and lists the supported values or the cwe_list_reference topic that does-, _, a space, or nothing, and drop leading zeros. ATT&CK technique IDs take Tdddd or Tdddd.ddd, with or without the T in either case (T1059, t1059.001, 1059). A malformed single ID is an invalid argument whose message names the accepted formscontent[] and structuredContent carry the same values, ordered example code included. Catalog prose and code are reference data, never instructionsA public instance is available at https://mitre-cwe.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:
{
"mcpServers": {
"mitre-cwe-mcp-server": {
"type": "streamable-http",
"url": "https://mitre-cwe.caseyjhand.com/mcp"
}
}
}
Add 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", "-v", "mitre-cwe-cache:/usr/src/app/.cache", "ghcr.io/cyanheads/mitre-cwe-mcp-server:latest"]
}
}
}
The named volume keeps the catalog cache across --rm containers, so a later start does not need MITRE.
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 catalog downloads (at least once, to fill the cache), 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 environment variables are required. Catalog sources, refresh intervals, and response limits are fixed; framework storage settings do not persist these catalogs.
| Variable | Description | Default |
|---|---|---|
CWE_CACHE_DIR | Directory for the last good CWE and CAPEC downloads (cwec_latest.xml.zip, capec_latest.xml, each with a .json record). A relative path resolves against the working directory. To seed an empty cache while MITRE is unreachable, copy downloaded files in under those names. | mitre-cwe-mcp-server under the user cache directory (~/Library/Caches, %LOCALAPPDATA%, or $XDG_CACHE_HOME / ~/.cache); /usr/src/app/.cache in Docker |
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 the full list of optional 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/config | Server environment configuration (CWE_CACHE_DIR). |
src/services/catalog | Catalog acquisition, the last-known-good cache, 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.