mitre-cwe-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mitre-cwe-mcp-serverfind CWE weaknesses related to SQL injection and their mitigations"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 or categories with selected sections and complete example pages |
| Retrieve CAPEC prerequisites, execution steps, mitigations, and recorded mappings |
| Search weaknesses by text, platform, abstraction, consequences, status, or view |
| 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-token labelfilterLists use
limit(default 20, capped at 100) andcursor;pagination.nextCursorcontinues them.versionsalso returnscatalogswith loaded versions, dates, counts, and refresh errors
cwe_get_weakness tool
Submit 1–200 CWE IDs or bare numbers; up to 20 distinct IDs are processed.
sectionssupportssummary,consequences,mitigations,relations,examples,detection,observed,platforms, andmappings; defaults to the first four, while[]requests an outlineentries[].kindisfulloroutline;notFound[].reasonisnot_foundorwrong_type, anddeferredIdscarries whole IDs for another call. Categories are retrievable organizational records; views belong incwe_get_viewSelect
exampleswith optionalexampleLanguage;exampleOffsetdefaults to 0 andexampleLimitto 3 (no fixed upper cap). Complete examples retain ordered prose and code; continue withexamplePage.nextOffset
cwe_get_attack_pattern tool
Submit 1–200 CAPEC IDs or bare numbers; up to 20 distinct IDs are processed, including Deprecated and Obsolete records.
sections:summary,prerequisites,execution,skills,consequences,mitigations,examples,relations, ormappings; defaults to summary, prerequisites, execution, mitigations, and mappingssections: []requests an outline.entries[].kind, per-IDnotFound, anddeferredIdsdistinguish complete selections, outlines, misses, and continuation; mappings preserve recorded CWE and ATT&CK IDs
cwe_search_weaknesses tool
Optional all-token
filter, exactlanguage,technology,abstraction,consequenceImpact,status, andviewId; omit filters to browse. View filtering includes same-view weakness membership closure; categories are excludedAll statuses are included by default. Results order by name matches, description matches, extended-description matches, then numeric ID; previews contain the first sentence.
limitdefaults to 20, caps at 100; continue withpagination.nextCursor
cwe_search_attack_patterns tool
Optional all-token
filter,cweId,attackTechniqueId,abstraction,severity, andlikelihood; CWE mappings are exact, while a parent ATT&CK technique includes recorded subtechniquesincludeInactivedefaults tofalse, excluding Deprecated and Obsolete patterns. Results order by name matches, description matches, then numeric ID;limitdefaults to 20, caps at 100; continue withpagination.nextCursor
cwe_get_view tool
One CWE view
id, withlimit(default 20, capped at 100) andcursor; discover IDs throughcwe_list_referencetopicviewsReturns objective, audience, source filter, and direct
membersin source order, continued bypagination.nextCursor.found: falsecarriesnot_foundorwrong_type; navigation views list top-level members, with descendants accessible through hierarchy traversal
cwe_get_hierarchy tool
One CWE
idanddirection:parents,children,ancestors, ordescendants;viewIddefaults to1000, withallavailable explicitly.primaryOnlyis valid only for ancestorsReturns view-scoped
nodesand parent-to-childedges,found,retrievedAt, andhierarchyFingerprint; empty relations succeed, while upstream failures remain errors. Node names come from the loaded catalog and can lag live IDslimitdefaults to 20, caps at 100 edges. Followpagination.nextCursor; continuations re-fetch the traversal, andinvalid_cursorrequires restarting without a cursor when topology or the catalog changes
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:
No API key or signup. Both XML catalogs load into memory before the server accepts requests; startup and every restart require access to MITRE's CWE and CAPEC download sources. Catalogs have no persistent disk cache or bundled copy
CWE version checks run every 24 hours; CAPEC conditional refreshes run every seven days. Failed refreshes retain the loaded data and appear in
cwe_list_referencetopicversionsLive CWE REST hierarchy traversal preserves multiple parents and view identity; catalog XML supplies local search and detail records
MITRE source statuses and absent sections remain explicit. Categories and views organize weaknesses; CAPEC mappings and execution flows are incomplete, and missing mappings cannot establish absence of a relationship or current ATT&CK validity
Agent-friendly output:
Provenance: catalog versions, dates, load time, source links, and attribution accompany results
Bounded responses: ordinary responses target 24,000 serialized bytes across both output surfaces, including enrichment. Whole IDs or page items are deferred; default detail selections can become outlines. Explicit detail selections remain complete, and a single complete record or page item can exceed the budget with disclosure to preserve progress
Continuation: use
deferredIds,pagination.nextCursor, orexamplePage.nextOffset; stale or incompatible cursors fail withinvalid_cursor. Unsupported vocabulary fails withunknown_filterand discovery guidanceContent parity: rendered
content[]andstructuredContentpreserve the same selected values, including ordered example code. Catalog prose and code are reference data, never instructions to execute
Getting started
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", "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 loadPrerequisites
Bun v1.4.0 or higher (or Node.js v24+).
Outbound HTTPS access to
cwe.mitre.organdcapec.mitre.orgfor initial catalogs, andcwe-api.mitre.orgfor version checks and live hierarchy calls.
Installation
Clone the repository:
git clone https://github.com/cyanheads/mitre-cwe-mcp-server.gitNavigate into the directory:
cd mitre-cwe-mcp-serverInstall dependencies:
bun installConfigure environment:
cp .env.example .env
# edit .env for optional transport, authentication, and logging settingsConfiguration
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 |
| 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 every server setting and the common framework overrides.
Running the server
Local development
Build 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
Project structure
Directory | Purpose |
| Seven read-only tools. |
| Shared output schemas, section projection, budgets, and pagination. |
| Catalog acquisition, XML normalization, indexes, refresh lifecycle, and live hierarchy. |
| 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.
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.
Offline methodology engine for authorized penetration testing, CTF, and security research.
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 gradedqualityBmaintenanceEnables querying MITRE Common Weakness Enumeration (CWE) data, including weaknesses, categories, views, and their relationships, through natural language or direct tools.21 npmMIT
- AlicenseAqualityBmaintenanceEnables 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.-