MCP Hub
Back to servers

bd-skill

An MCP server that provides Claude Code with access to Black Duck SCA for managing vulnerabilities, licenses, and policy violations through natural language. It enables users to query component risks and execute Black Duck Detect scans directly within their workspace.

glama
Updated
Apr 1, 2026

bd-skill — Black Duck SCA Skill for Claude Code

An MCP (Model Context Protocol) server that gives Claude Code access to your Black Duck instance. Ask natural-language questions about vulnerabilities, licenses, policy violations, and component risks — Claude handles the multi-step API navigation automatically.

Prerequisites

  • Python 3.11+
  • A Black Duck server with API access
  • A Black Duck API token
  • Claude Code CLI
  • Java 17+ (required only for running Detect scans)

Installation

cd bd_skill
python -m venv .venv
source .venv/bin/activate
pip install -e .

This installs the bd-skill command into the virtualenv.

Registering with Claude Code

Register the MCP server so Claude Code can use the skill:

claude mcp add -s project \
  -e BLACKDUCK_BDSCA_URL=https://your-blackduck-server.com \
  -e BLACKDUCK_BDSCA_TOKEN=your-api-token \
  blackduck \
  -- /path/to/bd_skill/.venv/bin/bd-skill

Scope options:

FlagScopeStored in
-s localThis machine + project (default).claude/settings.local.json
-s projectShared with team via git.claude/settings.json
-s userAll your projects~/.claude/settings.json

Verify

claude mcp list

You should see blackduck listed. Start a new Claude Code session and the 16 tools will be available.

Environment Variables

VariableRequiredDefaultDescription
BLACKDUCK_BDSCA_URLYesBlack Duck server URL
BLACKDUCK_BDSCA_TOKENYesAPI bearer token
BLACKDUCK_TLS_VERIFYNotrueVerify TLS certificates
BD_TIMEOUT_SECONDSNo30Request timeout
CACHE_TTL_SECONDSNo300Name/response cache TTL

Multi-Server Profiles

If you work with multiple Black Duck instances (e.g. production and staging), you can configure named profiles instead of using environment variables.

Setup

Create ~/.blackduck/profiles.yaml:

profiles:
  prod:
    url: https://bd-prod.example.com
    token: "your-prod-api-token"
    tls_verify: true       # optional, default: true
    timeout: 30            # optional, default: 30
    cache_ttl: 300         # optional, default: 300
  staging:
    url: https://bd-staging.example.com
    token: "your-staging-api-token"

default: prod   # optional — first profile is used if omitted

When a profiles file is present, environment variables are ignored. If no profiles file exists, the server falls back to BLACKDUCK_BDSCA_URL / BLACKDUCK_BDSCA_TOKEN environment variables (full backward compatibility).

Registration with Profiles

When using profiles, you don't need to pass credentials via -e flags:

claude mcp add -s project \
  blackduck \
  -- /path/to/bd_skill/.venv/bin/blackduck-assist

Profile Management Tools

ToolDescription
list_profilesList all configured profiles with server URLs and active status
switch_profileSwitch the active profile — subsequent tool calls use the new connection
get_active_profileShow the currently active profile name and server URL

Switching Profiles

Ask Claude naturally:

  • "Switch to the staging profile"
  • "Which Black Duck profile am I connected to?"
  • "List my Black Duck profiles"

Available Tools

Navigation

ToolDescription
list_projectsList/search all projects
search_projectsSearch projects by name with relevance scoring
get_projectGet project details and version count
list_project_versionsList versions (newest first)

Security & Compliance

ToolDescription
get_risk_profile5-dimensional risk summary (vulnerability, license, operational, activity, version)
get_policy_statusPolicy compliance status and violation count
list_vulnerable_componentsVulnerable components with severity/remediation filters
count_vulnerabilitiesVulnerability counts by severity

Investigation

ToolDescription
list_bom_componentsBOM inventory with licenses and vuln counts
get_vulnerability_detailFull CVE/BDSA details (CVSS, CWE, remediation)
list_licensesLicenses grouped by risk level
list_policy_violationsComponents violating policy rules

Detect Scanning

ToolDescription
run_detect_scanRun a Black Duck Detect scan on a source path. Returns a scan ID for polling.
get_detect_scan_statusGet status and log output of a running or completed Detect scan
list_detect_scansList all Detect scans started in this session

Advanced

ToolDescription
search_vulnerability_across_projectsFind which projects are affected by a CVE/BDSA
list_code_locationsScan history for a project version
get_component_upgrade_guidanceUpgrade paths and vulnerability fixes
compare_versionsBOM diff between two project versions

Resources

MCP resources provide browsable data endpoints that LLMs can read via URI patterns. Unlike tools, resources don't consume tool-call tokens and are ideal for paginated data.

Resource URIDescription
bom://{project}/{version}/{offset}/{limit}Paginated BOM components
vulns://{project}/{version}/{offset}/{limit}Paginated vulnerable components
vuln-detail://{cve_or_bdsa}Full CVE/BDSA vulnerability details
licenses://{project}/{version}License inventory grouped by risk level
policies://allAll system policy rules
rendering-guidelines://allOutput formatting guidelines for presenting data

Project and version names support the same fuzzy matching as tools — if a name doesn't match exactly, the response includes suggestions.

Slash Commands

Quick-access commands for common operations. Type these directly in Claude Code:

CommandUsageDescription
/list_projects/list_projects [query]List all projects on the server. Add a search term to filter by name. Paginates automatically if there are too many to display.
/project_risk/project_risk <project>Show the 5-dimensional risk profile (vulnerability, license, operational, activity, version) for a project.
/project_vulns/project_vulns <project> [severity]List vulnerable components with a severity summary. Optionally filter by critical, high, medium, or low.
/policy_violations/policy_violations <project>List all policy violations grouped by policy rule, ordered by severity.

Slash Command Examples

/list_projects              # show first 20 projects, with option to page through more
/list_projects payment       # search for projects matching "payment"
/project_risk my-app         # risk profile for my-app (auto-resolves latest version)
/project_vulns my-app critical  # only critical vulnerabilities
/policy_violations my-app    # policy violations grouped by rule

Installation

Copy the skill files to your Claude Code skills directory:

cp -r skills/list_projects  ~/.claude/skills/
cp -r skills/project_risk   ~/.claude/skills/
cp -r skills/project_vulns  ~/.claude/skills/
cp -r skills/policy_violations ~/.claude/skills/

Restart Claude Code for the commands to appear in /help.

Running Detect Scans

The MCP server can kick off Black Duck Detect scans directly. Detect is auto-downloaded on first use — no manual installation required (Java 17+ must be available).

How it works

  1. run_detect_scan starts the scan asynchronously and returns a scan ID immediately
  2. get_detect_scan_status polls for progress and retrieves log output
  3. list_detect_scans shows all scans in the current session

Credentials (URL, token, TLS settings) are automatically injected from the active profile — you never need to pass them.

Parameters

ParameterRequiredDescription
source_pathYesPath to the source code directory to scan
project_nameNoBlack Duck project name (auto-detected from source if omitted)
version_nameNoProject version name
scan_modeNoINTELLIGENT (full) or RAPID (quick)
detect_toolsNoComma-separated list, e.g. DETECTOR,SIGNATURE_SCAN
search_depthNoHow deep to search for package manager files
code_location_nameNoCustom code location name
additional_argsNoExtra Detect properties, e.g. ["--detect.cleanup=false"]

Natural language examples

  • "Scan the current project with Black Duck Detect"
  • "Run a rapid scan on /path/to/my-app"
  • "Kick off a Detect scan for my-app version 2.0"
  • "Check the status of my Detect scan"

Detect script management

The Detect CLI script (detect10.sh) is automatically downloaded from https://detect.blackduck.com/detect10.sh to ~/.blackduck/detect/ on first use. Subsequent scans reuse the cached script.

Usage Examples

Once registered, just ask Claude naturally:

  • "What critical vulnerabilities are in my-app?"
  • "Show me the risk profile for payment-service"
  • "Which projects are affected by CVE-2021-44228?"
  • "Compare v2.0 and v3.0 of api-gateway"
  • "What GPL-licensed components are in my-app?"
  • "Run a Detect scan on this project"

Claude will automatically resolve project names (with fuzzy matching), navigate to the right version, and call the appropriate tools.

Development

Setting Up the Dev Environment

git clone <repo-url> && cd bd_skill
python -m venv .venv
source .venv/bin/activate
make dev    # installs the package in editable mode with dev deps + pre-commit hooks

This installs pytest, ruff, mypy, and pre-commit. The make dev target is equivalent to:

pip install -e ".[dev]"
pre-commit install

Running Tests

make test       # run all tests with coverage report

Tests use mocked API responses — no live Black Duck server is needed. The coverage threshold is 60%; the suite currently sits at ~63%.

Other useful commands:

make lint       # check lint + formatting (no modifications)
make format     # auto-fix lint issues and reformat
make typecheck  # run mypy type checking
make check      # run all three gates: lint → typecheck → tests

Project Structure

bd_skill/
├── .mcp.json                  # MCP server definition
├── pyproject.toml              # Package metadata, deps, and tool configs
├── Makefile                    # Dev task runner (test, lint, format, etc.)
├── .pre-commit-config.yaml     # Pre-commit hooks (ruff + mypy)
├── skills/
│   ├── blackduck/
│   │   └── SKILL.md            # Skill instructions and domain knowledge
│   ├── list_projects/
│   │   └── SKILL.md            # /list_projects slash command
│   ├── project_risk/
│   │   └── SKILL.md            # /project_risk slash command
│   ├── project_vulns/
│   │   └── SKILL.md            # /project_vulns slash command
│   └── policy_violations/
│       └── SKILL.md            # /policy_violations slash command
├── src/
│   └── bd_skill/
│       ├── server.py           # MCP server + tool definitions + resource endpoints
│       ├── client.py           # Async Black Duck API wrapper
│       ├── detect.py           # Detect CLI runner (download, execute, track scans)
│       ├── profiles.py         # Multi-profile configuration and registry
│       ├── models.py           # Pydantic response models
│       ├── cache.py            # Name and response caching
│       ├── resolver.py         # Fuzzy project/version name matching
│       └── throttle.py         # Rate limiting (5 RPS default)
└── tests/
    ├── conftest.py             # Shared fixtures (mock SDK client, sample data)
    ├── test_models.py          # Pydantic model construction and validation
    ├── test_cache.py           # ResponseCache and NameCache
    ├── test_resolver.py        # Fuzzy name matching
    ├── test_throttle.py        # Async rate limiter
    ├── test_profiles.py        # ProfileRegistry and YAML loading
    ├── test_client.py          # BlackDuckClient methods (mocked SDK)
    ├── test_detect.py          # DetectRunner and ScanRecord
    ├── test_server.py          # MCP tool functions (mocked client)
    └── test_resources.py       # MCP resource functions

Removing

claude mcp remove blackduck

Reviews

No reviews yet

Sign in to write a review