mitre-cwe-mcp-server
Public Hosted Server: https://mitre-cwe.caseyjhand.com/mcp
Overview
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.
Tools
Tool | Description |
| Discover views, filter vocabulary, workflow guidance, and catalog refresh health |
| Retrieve CWE weaknesses, categories, or groupings with selected sections and complete example pages |
| Retrieve CAPEC attack patterns, categories, and views: prerequisites, execution steps, mitigations, members, and recorded mappings |
| Search weaknesses by text, platform, abstraction, consequences, status, mapping usage, view, taxonomy mapping (CERT C |
| Search CAPEC by text, CWE or ATT&CK mapping, abstraction, severity, or likelihood |
| Read a CWE view's metadata and direct members in published order |
| Traverse live CWE parents, children, ancestors, or descendants within a view |
Related MCP server: mcp-mitre-cwe
Capability reference
cwe_list_reference tool
topic:views,abstraction_levels,mitigation_phases,platforms,relationship_natures,filter_values,workflow, orversions; optional all-tokenfilteron labels, using the word-start, bounded-prefix, and closed-compound rules below (scriptfinds JavaScript)viewslists every CWE view with its direct member count, and a filter-defined view'sfilterDefinitionfilter_valueslists weakness statuses, mapping usage, and taxonomy names, consequence impacts, and CAPEC statuses, severity, and likelihoodLists page with
limit(default 20, max 100) andpagination.nextCursor;versionsadds each loaded catalog's version, date, counts, and refresh errors
cwe_get_weakness tool
One or more CWE IDs (
CWE-79,CWE79,cwe 079,CWE_79, or79); up to 20 distinct items are processed per call and the rest return indeferredIds. A malformed item comes back innotFoundwithout 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 outlinesummaryincludes technical nuance, typed dimensions, recorded alternate terms and roles, ordinalities (Primary, Resultant, Indirect), background details, and mapping notes. When MITRE suggests alternative CWEs,mappingNotes.suggestionsretains their IDs, source comments, and resolved names.platformsadds functional areas and affected resources, andrelationsnames each related weakness.notesreturns every recorded note for weaknesses, categories, and groupingsentries[].kindisfullfor complete default or selected sections, oroutlineforsections: []; outlines list available sections and their sizes.notFound[].reasonisnot_found,wrong_type(a view, which belongs tocwe_get_view, or a prefixed ID of the other catalog), orinvalid_id(an item that is no ID, echoed trimmed;NVD-CWE-noinfoandNVD-CWE-Otherget their own guidance). Categories and groupings resolve here with distinct record typesExamples filter by
exampleLanguageand page withexampleOffset(default 0),exampleLimit(default 3, no fixed cap), andexamplePage.nextOffset. Withsectionsomitted, setting any of the three to a non-default value addsexamplesafter the defaults; explicitsectionswithoutexamplesignore them, andguidancegives the re-call that addsexamples. 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 inreferences
cwe_get_attack_pattern tool
One or more CAPEC IDs (
CAPEC-66,CAPEC66,capec_066, or66), Deprecated and Obsolete included; up to 20 distinct items per call, the rest indeferredIdssections: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[].typeisattack_pattern,category, orview, and only patterns carryabstraction. A category or view'srelationslist its directmembersin source order, or for a filter-defined view its source XPath asfilterDefinition; itsmappingsandnotescarry the recorded taxonomy mappings, references, and MITRE notesStart at view
CAPEC-1000(Mechanisms of Attack) orCAPEC-3000(Domains of Attack) to browse patterns by category, then select a pattern'srelationsto followchildAttackPatternsto its direct children. These rows include names, abstraction, and every recorded status in numeric ID orderSame
entries[].kindandnotFoundcontract ascwe_get_weakness; CAPEC patterns, categories, and views all resolve here, sowrong_typemarks only a prefixed CWE ID. Mappings keep the recorded CWE and ATT&CK IDs
cwe_search_weaknesses tool
Optional all-token
filterover the name, MITRE's recorded alternate terms (XSS,ReDoS,UAF), the description, and the extended description, plus exactlanguage,technology,abstraction,consequenceImpact,status,mappingUsage,taxonomyName,taxonomyEntryId,observedCveId, andviewId; no filters browses the catalogA
filtertoken matches at a word start, after_, or at a camelCase hump (dosfinds ReDoS). Tokens of at least four Unicode letters also match after exactly oneunormisprefix at a word start (trustedfinds untrusted;configfinds misconfiguration). Prefixes are never stripped recursively; spelling coincidences remain possible. An exact closed spelling also matches a source compound joined by single ASCII hyphens:hardcodedfindshard-coded, anduseafterfreefindsuse-after-free. Spaces, repeated hyphens, and other dashes do not form these aliases. Solid-word interiors remain distinct:serializationdoes not find CWE-502,deserializationdoes. A token ending in a digit never matches before another digit (79skips RFC 793)Exact platform filters can exclude records under
Not Language-SpecificorNot Technology-Specific. When replacing one platform field with that class adds results, a notice gives the additional count and repeat; keep the other filters, start without a cursor, and deduplicate by CWE ID. These are catalog classes, not an applicability judgmentEach result carries MITRE's
mappingUsage, such asAllowed,Allowed-with-Review, orProhibited, which says whether the entry may be used to map a vulnerabilitytaxonomyName(such asCERT C Secure CodingorISA/IEC 62443) andtaxonomyEntryId(such asARR30-CorA1, any case) find the weaknesses that record a taxonomy mapping, both holding on one mapping when given together;observedCveId(such asCVE-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 matchedviewIdincludes same-view membership closure, or for a filter-defined view the weaknesses its source XPath filter selects (CWE-658 C, CWE-702 Implementation, …). Categories and groupings are excluded; every status is included by defaultRanked by all tokens in the name or in one alternate term, then in the description, then any other match, then numeric ID. Existing literal matches keep their tier when a compound alias also matches. Previews hold the first sentence, and
cwe_get_weaknessreturns the terms insummary.limitdefault 20, max 100; continue withpagination.nextCursor
cwe_search_attack_patterns tool
Optional all-token
filterover the name, recorded alternate terms (MITM), and the description, using the same word-start, bounded-prefix, and closed-compound rules ascwe_search_weaknesses, pluscweId,attackTechniqueId,abstraction,severity, andlikelihood; CWE mappings match exactly, and a parent ATT&CK technique includes its recorded subtechniquesincludeInactive(defaultfalse) adds Deprecated and Obsolete patterns. A zero-hit notice suggests enabling it only when the same filters recover patterns. Ranking followscwe_search_weaknesses;cwe_get_attack_patternreturns the terms insummary.limitdefault 20, max 100; continue withpagination.nextCursor
cwe_get_view tool
One view
id(fromcwe_list_referencetopicviews);limitdefault 20, max 100, continued bypagination.nextCursorObjective, audience, status, filter definition, recorded notes, and direct
membersin published order. Navigation views list only top-level members;cwe_get_hierarchyreaches descendantsA filter-defined view lists no members:
filterDefinitionis its source XPath, andcwe_search_weaknesseswith itsviewIdreturns the weaknesses that filter selects. A filter with a part the server does not evaluate is named as such inguidance, and that search returns none with a noticefound: falsecarriesnot_foundorwrong_type
cwe_get_hierarchy tool
One CWE
idand adirection:parents,children,ancestors, ordescendants;viewIddefaults to1000, orallfor every view.primaryOnlyapplies to ancestors only. Parents and children include category, grouping, and view relations and match the first level of the same view's treeView-scoped
nodes, parent-to-childedges,found,retrievedAt, andhierarchyFingerprint. 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 APIThe total deadline includes queue wait; expiry is retryable
hierarchy_timeout, while caller cancellation is nonretryable. Source-recordedrelationsremain available throughcwe_get_weakness, but do not replace live children or descendantslimitdefault 20, max 100 edges; each page lists only the nodes its edges reference, plus any root without edges on the first page. Eachpagination.nextCursorcall re-fetches the traversal;invalid_cursormeans the topology or catalog changed, so restart without a cursor
Features
Built 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 schema 7 and 8 catalogs are supported. CWE groupings retain their own record type alongside older categories; both organize weaknesses rather than identify root causes. Sparse schema-8 metadata stays in existing sections, including custom phase domains, platform notes, note versions, observed-example rationales, and alternative reference links
No API key. Both XML catalogs load into memory before the server accepts requests. Each successful download is saved to a cache directory (
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 refresh checks run every 24 hours and CAPEC checks weekly, using ETag or Last-Modified when available. HTTP 304 preserves the served catalog, its origin, and download time. A catalog loaded from the cache is checked right after start and, while those checks fail, again after 5, 10, 20, 40, then every 60 minutes. A failed refresh keeps the loaded data and shows in
cwe_list_referencetopicversions, which also reports whether each catalog came from the cache or a downloadMITRE can refuse a burst of requests from one address with HTTP 403 for a few minutes. Catalog downloads, version checks, and hierarchy calls report it as a temporary, retryable failure and do not retry it immediately
Hierarchy calls go to the live CWE REST API and keep multiple parents and view identity; search and detail run against the local catalogs
MITRE statuses and absent sections stay explicit. CAPEC mappings and execution flows are incomplete: a missing mapping does not establish that no relationship exists, or that an ATT&CK ID is current
Agent-friendly output:
The published mitre-cwe-guide supplies classification gates and multi-step research workflows through plugin discovery and the MCP Skills extension
Provenance on every response: catalog versions and dates, load time, source links, and attribution
Pages are bounded by item count, and detail calls process up to 20 distinct IDs with complete default or selected sections. Choose smaller pages, specific sections,
sections: []outlines, or example pages to control response sizeContinuation through
deferredIds,pagination.nextCursor, orexamplePage.nextOffset; stale cursors fail withinvalid_cursor, unknown vocabulary withunknown_filter, whose message names the field and value and lists the supported values or thecwe_list_referencetopic that doesCWE and CAPEC ID inputs accept an optional prefix in any case, followed by
-,_, a space, or nothing, and drop leading zeros. ATT&CK technique IDs takeTddddorTdddd.ddd, with or without theTin either case (T1059,t1059.001,1059). A malformed single ID is an invalid argument whose message names the accepted formscontent[]andstructuredContentcarry the same values, ordered example code included. Catalog prose and code are reference data, never instructions
Getting started
Connect to the hosted instance, no install:
claude mcp add --transport http mitre-cwe-mcp-server https://mitre-cwe.caseyjhand.com/mcpOr run it locally:
claude mcp add mitre-cwe-mcp-server -- npx -y @cyanheads/mitre-cwe-mcp-serverFor other clients, add this to the MCP config file:
{
"mcpServers": {
"mitre-cwe-mcp-server": {
"command": "npx",
"args": ["-y", "@cyanheads/mitre-cwe-mcp-server"]
}
}
}No API key is required. For Docker or a source build, see Running the server.
Configuration
No environment variables are required. Catalog sources, refresh intervals, and page and batch limits are fixed; framework storage settings do not persist these catalogs.
Variable | Description | Default |
| Directory for the last good CWE and CAPEC downloads ( |
|
| Transport: |
|
| HTTP server port. |
|
| HTTP bind address. |
|
| HTTP session mode: |
|
| Authentication: |
|
| Log level ( |
|
| Directory for log files (Node.js only). |
|
| Storage backend: |
|
| Enable OpenTelemetry. |
|
See .env.example for the full list of optional overrides.
Running the server
Local development
Requires Bun v1.4.4 or higher (or Node.js v24+), outbound HTTPS access to cwe.mitre.org and capec.mitre.org at least once to fill the cache, and cwe-api.mitre.org for version checks and live hierarchy calls.
Clone and install:
git clone https://github.com/cyanheads/mitre-cwe-mcp-server.git cd mitre-cwe-mcp-server && bun install cp .env.example .env # optional transport, authentication, and logging settingsBuild and run the production version:
# One-time build bun run rebuild # Run the built server bun run start:http # or bun run start:stdioRun checks and tests:
bun run devcheck # Lints, formats, type-checks, and more bun run test # Runs the test suite
Docker
docker run --rm -p 3010:3010 -v mitre-cwe-cache:/usr/src/app/.cache ghcr.io/cyanheads/mitre-cwe-mcp-server:latestThe image defaults to HTTP transport, stateless sessions, and logs to /var/log/mitre-cwe-mcp-server. The named volume keeps catalog downloads across containers. For stdio, use "command": "docker" with "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"]. To build locally, run docker build -t mitre-cwe-mcp-server .; add --build-arg OTEL_ENABLED=false to omit OpenTelemetry peers.
Project structure
Directory | Purpose |
| Seven read-only tools. |
| Shared output schemas, section projection, and pagination. |
| Server environment configuration ( |
| Catalog acquisition, the last-known-good cache, XML normalization, indexes, refresh lifecycle, and live hierarchy. |
| Published guidance for agents calling the tools. |
| Unit and integration tests, mirroring the |
| Design and generated directory reference. |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor logging,ctx.statefor storageRegister new tools and resources in the
createApp()arrays insrc/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
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.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
CVE, KEV, EPSS, SBOM and advisory lookups; per-CVE exposure from Shodan data (© Shodan). Keyless.
Search and audit NIST NVD CVEs by keyword, severity, CWE, CISA KEV status, and CPE.
Free CVE lookup and CISA KEV known exploited vulnerabilities over MCP. Read-only, no login or key.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables querying MITRE's Common Weakness Enumeration database for vulnerability information, supporting CWE lookup, search, taxonomy navigation, and relationship mapping through MCP.97MIT
- AlicenseNot gradedqualityCmaintenanceEnables querying MITRE Common Weakness Enumeration (CWE) data, including weaknesses, categories, views, and their relationships, through natural language or direct tools.90 npmMIT
- AlicenseAqualityCmaintenanceEnables users to search and retrieve CVE records, CVE history, CPE Dictionary entries, and CPE match criteria through MCP tools, with local caching, pagination, and upstream rate-limit handling.10MIT
- FlicenseNot gradedqualityAmaintenanceEnables users to query a vulnerability database for vendors, products, vulnerabilities by product, specific CVE IDs, recent CVEs with CAPEC/CWE/CPE expansions, and database update information.-