fetch-cwe-list-mcpのロゴ

fetch-cwe-list-mcp

コミュニティ
alejandrosaenz117

A Node.js module to fetch, extract, and parse the latest or any specific CWE list from MITRE.

公開者alejandrosaenz117
リポジトリfetch-cwe-list
言語JavaScript
フォーク
2
スター
10
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    fetch-cwe-list-mcpは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには10件のスターと2件のフォークがあります。

fetch-cwe-list

npm

A simple, secure Node.js module that fetches and parses the latest Common Weakness Enumeration (CWE) list from MITRE.

Quick Start

bash
npm install fetch-cwe-list
javascript
const fetchCweList = require('fetch-cwe-list')

// Fetch latest CWE list
const cweList = await fetchCweList()
console.log(`Fetched ${cweList.length} CWE entries`)

// Fetch specific version
const cweListV413 = await fetchCweList('4.13')

That's it. Each entry includes parsed CWE data with enriched external references.

Features

  • Live data — Always current, fetched directly from MITRE
  • Enriched — CAPEC mappings, CVE context, hierarchy relationships, external references
  • Cached — Optional 1-hour TTL cache (configurable)
  • Query helpers — findById, findByName, findByCapec for common lookups
  • Secure — 30s timeout, 100MB size limit, XXE protection, no shared state
  • TypeScript — Full type definitions included

Usage

Fetch and iterate

javascript
const cweList = await fetchCweList()
cweList.forEach(cwe => {
  console.log(`${cwe.ID}: ${cwe.Name}`)
})

Use query helpers

javascript
const { findById, findByName, findByCapec } = require('fetch-cwe-list')
const cweList = await fetchCweList()

const cwe79      = findById(cweList, '79')
const injections = findByName(cweList, 'injection')
const xssCwes    = findByCapec(cweList, '209')  // CAPEC-209: XSS Using MIME Type Mismatch

Access enriched data

javascript
const cweList = await fetchCweList()
const cwe79 = findById(cweList, '79')

// CAPEC attack patterns
console.log(cwe79.CAPEC_IDs)  // ['63', '85', '209', '588', '591', '592']

// Hierarchy (parent weaknesses)
console.log(cwe79.Hierarchy.parents)  // ['74']

// Known CVEs
cwe79.Known_CVEs.forEach(({ id, description }) => {
  console.log(`${id}: ${description}`)
})

Cache control

javascript
const { clearCache } = require('fetch-cwe-list')

const list1 = await fetchCweList()  // Downloads, caches for 1 hour
const list2 = await fetchCweList()  // Instant (cached)

// Bypass cache
const fresh = await fetchCweList('latest', { cache: false })

// Invalidate cache
clearCache()

API Reference

fetchCweList([version], [opts])

Parameters:

  • version (string, optional) — CWE version to fetch (e.g., '4.13'). Defaults to 'latest'.
  • opts (object, optional) — Options:
    • cache (boolean, optional) — Set to false to bypass cache. Default: true

Returns:

  • Promise resolving to array of CWE objects

Throws:

  • Error if download fails, timeout occurs, or version not found

clearCache()

Clears the in-memory cache. The cache instance itself is not exposed to prevent external poisoning via cache.set().

findById(cweList, id)

Find a single CWE by its ID string.

Parameters:

  • cweList — Array returned by fetchCweList()
  • id (string) — The CWE ID, e.g., '79'

Returns:

  • CWE object or undefined

findByName(cweList, pattern)

Find all CWEs whose name contains the given string (case-insensitive).

Parameters:

  • cweList — Array returned by fetchCweList()
  • pattern (string) — Case-insensitive substring

Returns:

  • Array of CWE objects

Note: RegExp is intentionally not supported to prevent ReDoS attacks.

findByCapec(cweList, capecId)

Find all CWEs that map to a given CAPEC ID string.

Parameters:

  • cweList — Array returned by fetchCweList()
  • capecId (string) — The CAPEC ID, e.g., '86'

Returns:

  • Array of CWE objects

Data Structure

Each CWE entry contains MITRE's fields plus enriched data after v0.1.0:

FieldTypeAlways presentDescription
IDstringYesCWE ID (normalized from numeric parser output)
CAPEC_IDsstring[]YesMapped CAPEC attack pattern IDs (empty array if none)
Known_CVEs{ id, description }[]YesCVEs from Observed_Examples (empty array if none)
HierarchyobjectNoParent relationships (absent if no Related_Weaknesses)
References.Full_Detailsobject[]NoEnriched external reference objects

Example entry:

javascript
{
  ID: "79",
  Name: "Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')",
  Status: "Stable",
  Description: "...",
  CAPEC_IDs: ['63', '85', '209', '588', '591', '592'],
  Known_CVEs: [
    { id: 'CVE-2021-1879', description: '...' }
  ],
  Hierarchy: {
    parents: ['74'],
    relationships: [
      { nature: 'ChildOf', cweId: '74', viewId: '1000', ordinal: 'Primary' }
    ]
  },
  References: {
    Reference: [{ External_Reference_ID: "REF-2" }],
    Full_Details: [
      {
        Reference_ID: "REF-2",
        Author: "OWASP",
        Title: "Cross Site Scripting (XSS)",
        URL: "https://www.owasp.org/..."
      }
    ]
  }
}

Note: Single references are automatically normalized to arrays and enriched just like multiple references. IDs are normalized to strings for consistency across all API surfaces.

MCP Server

Experimental: Alpha release. APIs may change.

An MCP server is available for using this library as tools in LLM agents like Claude Code, Codex, etc.:

bash
npx fetch-cwe-list-mcp

See packages/fetch-cwe-list-mcp for full setup and usage.

License

MIT

Author

Alejandro Saenz

fetch-cwe-list-mcpのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度fetch-cwe-list-mcpに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

fetch-cwe-list-mcpをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. fetch-cwe-list-mcpのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "fetch-cwe-list-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてfetch-cwe-list-mcpのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. fetch-cwe-list-mcpのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
fetch-cwe-list-mcpを使ってこのタスクを手伝ってもらえますか?
fetch-cwe-list-mcp
はい、読みました。
fetch-cwe-list-mcpで調べた結果をお伝えします。

よくある質問

fetch-cwe-list-mcp MCPサーバーは何に使いますか?

fetch-cwe-list-mcpは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでfetch-cwe-list-mcp MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでfetch-cwe-list-mcpを利用できます。

TypingMindでfetch-cwe-list-mcp MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。fetch-cwe-list-mcpを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

fetch-cwe-list-mcp MCPをTypingMindに接続するにはどうすればよいですか?

fetch-cwe-list-mcpはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでfetch-cwe-list-mcp MCPのどのようなツールを利用できますか?

fetch-cwe-list-mcpはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

fetch-cwe-list-mcp MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。fetch-cwe-list-mcpで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇