Skip to main content
Glama
P-Shreyas-Maersk

security-mcp

Security MCP Setup

This setup connects the security-mcp server to AI coding tools so the agent can fetch GitHub Code Scanning alerts for the current repository and apply local patches.

Supported clients:

  • Claude Code — MCP via claude mcp add, slash command via .claude/commands/fix-vuls.md

  • Cursor — MCP via settings, skill via .cursor/skills/fix-vuls/SKILL.md

  • GitHub Copilot CLI — MCP via copilot mcp add or .github/mcp.json, skill via .github/skills/fix-vuls/SKILL.md

  • IntelliJ IDEA (GitHub Copilot plugin) — MCP via Copilot Chat Agent mode widget, skill via .github/skills/fix-vuls/SKILL.md

The /fix-vuls skill runs a remediation loop:

/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

The agent does not commit, push, or open a PR unless you explicitly ask. The full skill prompt lives in fix-vuls.md in this repo.

The GitHub token used to fetch alerts is read from a .env file inside the repo you are remediating (the org repo you open in your IDE or CLI) — it is never passed on the command line or committed to source control. You can also set GITHUB_TOKEN in MCP server env configuration where your client supports it.


1. Clone and install dependencies

Clone this repo and install Node.js dependencies before connecting the MCP server:

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

Use the absolute path to this folder when registering the MCP server in the steps below.


Related MCP server: osv-ui-mcp

2. Add a .env file with your GitHub token

The GitHub token is not passed as a CLI flag. Instead, create a .env file inside the org repo you want to scan (not the security-mcp server folder).

For the current v1, the token only needs access to read security/code scanning alerts.

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 (Command Prompt):

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

Replace YOUR_GITHUB_TOKEN with a GitHub token that has permission to read Code Scanning alerts.

⚠️ Add .env to .gitignore so the token is never committed.


3. Claude Code — connect MCP

From the same repo folder, add the MCP server (no token flag needed — security-mcp reads it from .env at runtime):

macOS:

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

Example:

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

Windows (PowerShell / Command Prompt):

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

Example:

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

4. Verify MCP connection

Run:

claude mcp list

Expected output:

security-mcp  ✓ Connected

If the server is not connected, restart Claude Code and verify the MCP path and .env file.


5. Open Claude Code in the target repo

Go to your org repo (the same folder containing your .env file):

macOS:

cd your-org-repo
claude

Example:

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

Windows (PowerShell / Command Prompt):

cd your-org-repo
claude

Example:

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

6. Test the MCP manually

Inside Claude Code, run this prompt:

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

Expected result:

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

If you see this error:

Missing GITHUB_TOKEN in environment

Check the following:

  • A .env file exists in the repo folder you ran claude from (not the security-mcp server folder).

  • The .env file contains a line exactly like GITHUB_TOKEN=YOUR_GITHUB_TOKEN, with no quotes or extra spaces.

  • You restarted Claude Code (claude) after creating or editing .env.

If needed, remove and re-add the 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

Then restart Claude Code.


7. Install the fix-vuls skill

This repo ships the skill prompt in fix-vuls.md. Do not copy the content by hand — copy or move that file into the skill or slash-command folder for your target repo and tool.

Claude Code slash command — copy into the repo you scan:

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 project skill — copy into the repo you scan:

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 — copy into the repo you scan as SKILL.md (Copilot requires YAML frontmatter; see section 11 or section 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

Then add the YAML frontmatter shown in sections 11 or 13 to the top of SKILL.md.

Replace /absolute/path/to/security-mcp with the path where you cloned this repo, and your-org-repo with the repository you want to remediate.

When the skill is updated here, re-copy fix-vuls.md to your target folder to pick up changes.


8. Claude Code — run the command

Inside Claude Code:

/fix-vuls

Expected final behavior:

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. Developer review

After the remediation loop finishes, review the summary and local diff:

git diff

Claude runs build and tests during the loop, but confirm the results in your environment before committing.

If the changes look good, create a branch, commit, push, and open a PR using your normal team workflow. GitHub Code Scanning alerts will update after the push and CodeQL rescan.


10. GitHub Copilot CLI — MCP server

Prerequisites:

  • GitHub Copilot CLI installed and signed in

  • Steps 1 and 2 completed

  • Open a terminal in the org repo you want to scan (the folder containing your .env file)

Option A — register globally with copilot mcp add

macOS:

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

Windows (PowerShell / Command Prompt):

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

If the MCP process cannot read your target repo .env, pass the token explicitly:

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

Verify:

copilot mcp list
copilot mcp get security-mcp

Option B — commit project MCP config in the org repo

Add .github/mcp.json in the repo you scan so collaborators get the same setup:

macOS example (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 example (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": ["*"]
    }
  }
}

Start Copilot CLI from the org repo root. On first use, confirm folder trust when prompted so project MCP servers load.

Inside an interactive session you can also run /mcp add, choose STDIO, and enter node /absolute/path/to/security-mcp/server.js.


11. GitHub Copilot CLI — fix-vuls skill

GitHub Copilot skills must live in a folder named after the skill and use a file called SKILL.md with YAML frontmatter.

  1. Copy fix-vuls.md into your org repo:

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. Add this frontmatter block at the very top of 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. Start Copilot CLI in the org repo and reload skills:

cd your-org-repo
copilot
/skills reload
/skills list
  1. Run remediation:

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

12. IntelliJ IDEA — MCP server (Copilot widget)

Prerequisites:

  • IntelliJ IDEA with the latest GitHub Copilot plugin

  • Agent mode enabled in Copilot Chat (MCP tools are available in Agent mode)

  • Steps 1 and 2 completed

  • Org repo opened as the IntelliJ project (the folder containing your .env file)

  • If your organization uses Copilot Business/Enterprise, the MCP servers in Copilot policy must be enabled

Configure via Copilot Chat widget

  1. Open your org repo in IntelliJ IDEA.

  2. Click the GitHub Copilot icon in the status bar (bottom-right corner).

  3. Select Open Chat.

  4. In the chat panel, switch the mode dropdown to Agent.

  5. Click the tools icon at the bottom of the chat panel (Configure your MCP server).

  6. Click Add MCP Tools (or Add More Tools...).

  7. In the mcp.json editor, add the security-mcp server entry below.

  8. Save the file with Command + S (macOS) or Ctrl + S (Windows). Restart the IDE if tools do not appear immediately.

  9. Click the tools icon again and confirm list_code_scanning_alerts is listed under security-mcp.

Alternative — open MCP settings from the status bar

  1. Click the GitHub Copilot icon in the status bar.

  2. Select Edit Settings.

  3. Open Model Context ProtocolConfigure.

  4. Edit mcp.json with the same server entry below and save.

mcp.json entry for 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"
      }
    }
  }
}

Replace the args path with your cloned security-mcp folder. If .env is present in the opened IntelliJ project, you can omit env and let dotenv load GITHUB_TOKEN from the project root instead.

Test in Agent mode

In Copilot Chat (Agent mode), run:

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 skill

IntelliJ Agent mode uses the same Agent Skills layout as Copilot CLI.

  1. Copy fix-vuls.md into your org repo:

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. Add YAML frontmatter at the top of SKILL.md (same as section 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. Reopen the project or restart IntelliJ if the skill does not appear immediately.

  2. In Copilot Chat (Agent mode), run:

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

When fix-vuls.md is updated in this repo, re-copy it to .github/skills/fix-vuls/SKILL.md in your org repo (keep the frontmatter block).


Final lifecycle

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