Skip to main content
Glama
P-Shreyas-Maersk

security-mcp

Security MCP セットアップ

このセットアップは、security-mcp サーバーを AI コーディングツールに接続し、エージェントが現在のリポジトリの GitHub Code Scanning アラートを取得してローカルパッチを適用できるようにします。

対応クライアント:

  • Claude Code — MCP は claude mcp add、スラッシュコマンドは .claude/commands/fix-vuls.md

  • Cursor — MCP は設定、スキルは .cursor/skills/fix-vuls/SKILL.md

  • GitHub Copilot CLI — MCP は copilot mcp add または .github/mcp.json、スキルは .github/skills/fix-vuls/SKILL.md

  • IntelliJ IDEA (GitHub Copilot プラグイン) — MCP は Copilot Chat Agent モードウィジェット、スキルは .github/skills/fix-vuls/SKILL.md

/fix-vuls スキルは修復ループを実行します:

/fix-vuls
  → fetch open GitHub Code Scanning alerts
  → triage and classify each alert
  → research CVEs (Spring Boot BOM first for dependency alerts)
  → apply minimal local patches
  → validate with build and tests
  → re-check alerts and repeat until done or blocked

明示的に依頼しない限り、エージェントはコミット、プッシュ、PR の作成を行いません。完全なスキルプロンプトは、このリポジトリ内の fix-vuls.md にあります。

アラートの取得に使用される GitHub トークンは、修復対象のリポジトリ内の .env ファイル(IDE または CLI で開く組織リポジトリ)から読み取られます。コマンドラインで渡されたり、ソース管理にコミットされることはありません。また、クライアントがサポートしている場合は、MCP サーバーの env 設定に GITHUB_TOKEN を設定することもできます。


1. 依存関係のクローンとインストール

このリポジトリをクローンし、MCP サーバーを接続する前に Node.js の依存関係をインストールします:

git clone https://github.com/P-Shreyas-Maersk/security-mcp.git
cd security-mcp
npm install

以下の手順で MCP サーバーを登録する際には、このフォルダへの絶対パスを使用してください。


Related MCP server: osv-ui-mcp

2. GitHub トークンを含む .env ファイルを追加する

GitHub トークンはCLI フラグとして渡されません。代わりに、スキャンしたい組織リポジトリ内security-mcp サーバーフォルダではありません)に .env ファイルを作成します。

現在の v1 では、トークンはセキュリティ/コードスキャンアラートを読み取るためのアクセス権のみが必要です。

macOS:

cd your-org-repo
echo "GITHUB_TOKEN=YOUR_GITHUB_TOKEN" > .env

Windows (PowerShell):

cd your-org-repo
"GITHUB_TOKEN=YOUR_GITHUB_TOKEN" | Out-File -Encoding utf8 .env

Windows (コマンドプロンプト):

cd your-org-repo
echo GITHUB_TOKEN=YOUR_GITHUB_TOKEN > .env

YOUR_GITHUB_TOKEN を、Code Scanning アラートを読み取る権限を持つ GitHub トークンに置き換えてください。

⚠️ トークンがコミットされないように、.env.gitignore に追加してください。


3. Claude Code — MCP の接続

同じリポジトリフォルダから、MCP サーバーを追加します(トークンフラグは不要です。security-mcp は実行時に .env から読み取ります):

macOS:

claude mcp add security-mcp -- node /absolute/path/to/security-mcp/server.js

例:

claude mcp add security-mcp -- node /Users/p.shreyas/workplace/experiment/code-vuls/security-mcp/server.js

Windows (PowerShell / コマンドプロンプト):

claude mcp add security-mcp -- node C:\absolute\path\to\security-mcp\server.js

例:

claude mcp add security-mcp -- node C:\Users\shreyas\workplace\experiment\code-vuls\security-mcp\server.js

4. MCP 接続の確認

次を実行:

claude mcp list

期待される出力:

security-mcp  ✓ Connected

サーバーが接続されていない場合は、Claude Code を再起動し、MCP パスと .env ファイルを確認してください。


5. ターゲットリポジトリで Claude Code を開く

組織リポジトリ(.env ファイルを含む同じフォルダ)に移動します:

macOS:

cd your-org-repo
claude

例:

cd /Users/p.shreyas/workplace/vas-experience-api
claude

Windows (PowerShell / コマンドプロンプト):

cd your-org-repo
claude

例:

cd C:\Users\shreyas\workplace\vas-experience-api
claude

6. MCP を手動でテストする

Claude Code 内で、次のプロンプトを実行:

Use the security-mcp tool to list open code scanning alerts for this current GitHub repo. Detect owner and repo from git remote.

期待される結果:

Found open code scanning alerts:
- java/sql-injection ...
- java/path-injection ...
- java/log-injection ...

次のエラーが表示された場合:

Missing GITHUB_TOKEN in environment

以下を確認してください:

  • claude を実行したリポジトリフォルダ(security-mcp サーバーフォルダではありません)に .env ファイルが存在すること。

  • .env ファイルに GITHUB_TOKEN=YOUR_GITHUB_TOKEN のような行が、引用符や余分なスペースなしで正確に含まれていること。

  • .env を作成または編集した後、Claude Code(claude)を再起動したこと。

必要に応じて、MCP を削除して再追加:

macOS:

claude mcp remove security-mcp
claude mcp add security-mcp -- node /absolute/path/to/security-mcp/server.js

Windows:

claude mcp remove security-mcp
claude mcp add security-mcp -- node C:\absolute\path\to\security-mcp\server.js

その後、Claude Code を再起動してください。


7. fix-vuls スキルをインストールする

このリポジトリには、スキルプロンプトが fix-vuls.md に含まれています。手動で内容をコピーしないでください。そのファイルを、ターゲットリポジトリとツールのスキルまたはスラッシュコマンドフォルダにコピーまたは移動してください。

Claude Code スラッシュコマンド — スキャンするリポジトリにコピー:

macOS:

mkdir -p your-org-repo/.claude/commands
cp /absolute/path/to/security-mcp/fix-vuls.md your-org-repo/.claude/commands/fix-vuls.md

Windows (PowerShell):

New-Item -ItemType Directory -Force your-org-repo\.claude\commands
Copy-Item C:\absolute\path\to\security-mcp\fix-vuls.md your-org-repo\.claude\commands\fix-vuls.md

Cursor プロジェクトスキル — スキャンするリポジトリにコピー:

macOS:

mkdir -p your-org-repo/.cursor/skills/fix-vuls
cp /absolute/path/to/security-mcp/fix-vuls.md your-org-repo/.cursor/skills/fix-vuls/SKILL.md

Windows (PowerShell):

New-Item -ItemType Directory -Force your-org-repo\.cursor\skills\fix-vuls
Copy-Item C:\absolute\path\to\security-mcp\fix-vuls.md your-org-repo\.cursor\skills\fix-vuls\SKILL.md

GitHub Copilot スキル — スキャンするリポジトリに SKILL.md としてコピー(Copilot では YAML フロントマターが必要です。セクション 11 または セクション 13 を参照):

macOS:

mkdir -p your-org-repo/.github/skills/fix-vuls
cp /absolute/path/to/security-mcp/fix-vuls.md your-org-repo/.github/skills/fix-vuls/SKILL.md

Windows (PowerShell):

New-Item -ItemType Directory -Force your-org-repo\.github\skills\fix-vuls
Copy-Item C:\absolute\path\to\security-mcp\fix-vuls.md your-org-repo\.github\skills\fix-vuls\SKILL.md

その後、セクション 11 または 13 に示す YAML フロントマターを SKILL.md の先頭に追加してください。

/absolute/path/to/security-mcp をこのリポジトリをクローンしたパスに、your-org-repo を修復したいリポジトリに置き換えてください。

ここでスキルが更新された場合は、fix-vuls.md をターゲットフォルダに再コピーして変更を反映してください。


8. Claude Code — コマンドを実行する

Claude Code 内で:

/fix-vuls

期待される最終的な動作:

Remediation complete after 2 cycles.

Fixed:
- Alert #4 (java/sql-injection) — src/main/java/.../Repository.java
- Alert #7 (CVE-2024-XXXX) — root pom.xml Spring Boot 3.2.x → 3.2.y

Fixed locally, pending GitHub rescan:
- Alert #9 (java/path-injection) — green build; push and wait for CodeQL rescan

Blocked:
- Alert #12 — generated code; cannot patch locally

Build: mvn -B test — SUCCESS

No commit, push, or PR was performed.

9. 開発者によるレビュー

修復ループが完了したら、サマリーとローカルの差分を確認:

git diff

Claude はループ中にビルドとテストを実行しますが、コミットする前に実際の環境で結果を確認してください。

変更が問題なければ、通常のチームワークフローを使用してブランチを作成し、コミット、プッシュ、PR を作成してください。GitHub Code Scanning アラートは、プッシュと CodeQL の再スキャン後に更新されます。


10. GitHub Copilot CLI — MCP サーバー

前提条件:

  • GitHub Copilot CLI がインストールされ、サインイン済みであること

  • 手順 12 が完了していること

  • スキャンしたい組織リポジトリ.env ファイルを含むフォルダ)でターミナルを開いていること

オプション A — copilot mcp add でグローバルに登録

macOS:

copilot mcp add security-mcp -- node /absolute/path/to/security-mcp/server.js

Windows (PowerShell / コマンドプロンプト):

copilot mcp add security-mcp -- node C:\absolute\path\to\security-mcp\server.js

MCP プロセスがターゲットリポジトリの .env を読み取れない場合は、トークンを明示的に渡します:

macOS:

copilot mcp add security-mcp -e GITHUB_TOKEN=YOUR_GITHUB_TOKEN -- node /absolute/path/to/security-mcp/server.js

Windows (PowerShell):

copilot mcp add security-mcp -e GITHUB_TOKEN=YOUR_GITHUB_TOKEN -- node C:\absolute\path\to\security-mcp\server.js

確認:

copilot mcp list
copilot mcp get security-mcp

オプション B — 組織リポジトリにプロジェクト MCP 設定をコミット

スキャンするリポジトリに .github/mcp.json を追加すると、コラボレーターも同じ設定を使用できます:

macOS の例 (your-org-repo/.github/mcp.json):

{
  "mcpServers": {
    "security-mcp": {
      "type": "local",
      "command": "node",
      "args": ["/Users/you/workplace/projects/security-mcp/server.js"],
      "env": {
        "GITHUB_TOKEN": "YOUR_GITHUB_TOKEN"
      },
      "tools": ["*"]
    }
  }
}

Windows の例 (your-org-repo\.github\mcp.json):

{
  "mcpServers": {
    "security-mcp": {
      "type": "local",
      "command": "node",
      "args": ["C:\\Users\\you\\workplace\\projects\\security-mcp\\server.js"],
      "env": {
        "GITHUB_TOKEN": "YOUR_GITHUB_TOKEN"
      },
      "tools": ["*"]
    }
  }
}

組織リポジトリのルートから Copilot CLI を起動します。初回使用時に、フォルダの信頼を確認するよう求められたら、プロジェクト MCP サーバーが読み込まれるように承認します。

インタラクティブセッション内で /mcp add を実行し、STDIO を選択して node /absolute/path/to/security-mcp/server.js と入力することもできます。


11. GitHub Copilot CLI — fix-vuls スキル

GitHub Copilot スキルは、スキル名と同じ名前のフォルダに配置し、SKILL.md というファイルに YAML フロントマターを含める必要があります。

  1. fix-vuls.md を組織リポジトリにコピー:

macOS:

mkdir -p your-org-repo/.github/skills/fix-vuls
cp /absolute/path/to/security-mcp/fix-vuls.md your-org-repo/.github/skills/fix-vuls/SKILL.md

Windows (PowerShell):

New-Item -ItemType Directory -Force your-org-repo\.github\skills\fix-vuls
Copy-Item C:\absolute\path\to\security-mcp\fix-vuls.md your-org-repo\.github\skills\fix-vuls\SKILL.md
  1. このフロントマターブロックを SKILL.md の先頭に追加:

---
name: fix-vuls
description: Fetch open GitHub code scanning alerts, apply minimal local fixes, validate with build/tests, and loop until alerts are resolved or blocked. Use when asked to fix vulnerabilities, code scanning alerts, CVEs, or /fix-vuls.
---
  1. 組織リポジトリで Copilot CLI を起動し、スキルをリロード:

cd your-org-repo
copilot
/skills reload
/skills list
  1. 修復を実行:

Use the /fix-vuls skill to fetch open code scanning alerts for this repo and fix them locally.

12. IntelliJ IDEA — MCP サーバー (Copilot ウィジェット)

前提条件:

  • IntelliJ IDEA に最新の GitHub Copilot プラグインがインストールされていること

  • Copilot Chat で Agent モード が有効になっていること(MCP ツールは Agent モードで使用可能)

  • 手順 12 が完了していること

  • 組織リポジトリが IntelliJ プロジェクトとして開かれていること(.env ファイルを含むフォルダ)

  • 組織が Copilot Business/Enterprise を使用している場合、Copilot の MCP サーバー ポリシーが有効になっている必要があります

Copilot Chat ウィジェットを使用した設定

  1. IntelliJ IDEA で組織リポジトリを開きます。

  2. ステータスバー(右下隅)の GitHub Copilot アイコンをクリックします。

  3. Open Chat を選択します。

  4. チャットパネルで、モードドロップダウンを Agent に切り替えます。

  5. チャットパネル下部の ツール アイコン(MCP サーバーの設定)をクリックします。

  6. Add MCP Tools(または Add More Tools...)をクリックします。

  7. mcp.json エディタで、以下の security-mcp サーバーエントリを追加します。

  8. Command + S(macOS)または Ctrl + S(Windows)でファイルを保存します。ツールがすぐに表示されない場合は IDE を再起動します。

  9. 再度 ツール アイコンをクリックし、security-mcp の下に list_code_scanning_alerts がリストされていることを確認します。

代替方法 — ステータスバーから MCP 設定を開く

  1. ステータスバーの GitHub Copilot アイコンをクリックします。

  2. Edit Settings を選択します。

  3. Model Context ProtocolConfigure を開きます。

  4. 以下の同じサーバーエントリで mcp.json を編集し、保存します。

mcp.json の security-mcp エントリ

macOS:

{
  "servers": {
    "security-mcp": {
      "command": "node",
      "args": ["/Users/you/workplace/projects/security-mcp/server.js"],
      "env": {
        "GITHUB_TOKEN": "YOUR_GITHUB_TOKEN"
      }
    }
  }
}

Windows:

{
  "servers": {
    "security-mcp": {
      "command": "node",
      "args": ["C:\\Users\\you\\workplace\\projects\\security-mcp\\server.js"],
      "env": {
        "GITHUB_TOKEN": "YOUR_GITHUB_TOKEN"
      }
    }
  }
}

args のパスをクローンした security-mcp フォルダに置き換えてください。開いている IntelliJ プロジェクトに .env が存在する場合は、env を省略し、dotenv がプロジェクトルートから GITHUB_TOKEN を読み込むようにすることもできます。

Agent モードでテストする

Copilot Chat(Agent モード)で、次を実行:

Use the security-mcp tool to list open code scanning alerts for this current GitHub repo. Detect owner and repo from git remote.

13. IntelliJ IDEA — fix-vuls スキル

IntelliJ Agent モードは、Copilot CLI と同じ Agent Skills レイアウトを使用します。

  1. fix-vuls.md を組織リポジトリにコピー:

macOS:

mkdir -p your-org-repo/.github/skills/fix-vuls
cp /absolute/path/to/security-mcp/fix-vuls.md your-org-repo/.github/skills/fix-vuls/SKILL.md

Windows (PowerShell):

New-Item -ItemType Directory -Force your-org-repo\.github\skills\fix-vuls
Copy-Item C:\absolute\path\to\security-mcp\fix-vuls.md your-org-repo\.github\skills\fix-vuls\SKILL.md
  1. SKILL.md の先頭に YAML フロントマターを追加(セクション 11 と同じ):

---
name: fix-vuls
description: Fetch open GitHub code scanning alerts, apply minimal local fixes, validate with build/tests, and loop until alerts are resolved or blocked. Use when asked to fix vulnerabilities, code scanning alerts, CVEs, or /fix-vuls.
---
  1. スキルがすぐに表示されない場合は、プロジェクトを開き直すか、IntelliJ を再起動します。

  2. Copilot Chat(Agent モード)で、次を実行:

Use the /fix-vuls skill to fetch open code scanning alerts for this repo and fix them locally.

このリポジトリで fix-vuls.md が更新された場合は、組織リポジトリの .github/skills/fix-vuls/SKILL.md に再コピーしてください(フロントマターブロックは保持)。


最終的なライフサイクル

Developer runs /fix-vuls (Claude Code, Cursor, or Copilot Agent mode)
        ↓
Agent detects GitHub repo
        ↓
Security MCP fetches Code Scanning alerts
        ↓
Agent triages, researches CVEs, patches, and validates (loop)
        ↓
Agent reports summary (fixed / blocked / pending rescan)
        ↓
Developer reviews diff, commits, pushes, and raises PR manually
A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    -
    maintenance
    Provides tools for autonomous CVE detection, enrichment, and remediation across managed repositories using GHSA and NVD data. It enables automated triage and pull request creation for dependency fixes based on configurable severity policies.
  • A
    license
    A
    quality
    C
    maintenance
    Visual CVE audit dashboard for npm, Python, Go, and Rust projects. Scans your project manifests (package-lock.json, requirements.txt, go.sum, Cargo.lock) against OSV.dev live data, opens a browser dashboard for human review, then applies fixes only after explicit confirmation. Supports multi-service monorepos in one command.
    4
    35
    4
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Local-only GitHub Actions and CI maintenance scanner for AI-built apps. Exposes scan, explanation, and fix-planning tools to MCP clients; modifies nothing and makes no outbound requests by default.
    3
    63
    2
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/P-Shreyas-Maersk/security-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server