blackduck-mcp
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., "@blackduck-mcp Check log4j-core 2.14.1 for vulnerabilities and suggest a safe upgrade."
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.
blackduck-mcp
MCP server for Black Duck Software Composition Analysis — lets AI assistants (Claude, Cursor, VS Code) query component vulnerabilities and find safe upgrade paths.
Quick Start
git clone https://github.com/maheshkumargangula/blackduck-mcp.git
cd blackduck-mcp
npm install && npm run buildThen wire it into your MCP client (see Integration below).
Related MCP server: blackduck-polaris-mcp-server
Architecture
MCP Client (Claude / Cursor / VS Code)
|
| MCP Protocol (stdio)
v
┌─────────────────────────────────┐
│ blackduck-mcp │
│ │
│ src/index.ts ← tool registry │
│ │ │
│ ├── search_component │
│ ├── list_component_vers. │
│ ├── get_version_vulns │
│ ├── get_upgrade_guidance │
│ └── analyze_component ──────── (orchestrator)
│ │ │
│ src/client.ts │
│ (auth + retry + API mapping) │
└─────────────┬───────────────────┘
│
│ HTTPS REST
v
┌─────────────────────────────────┐
│ Black Duck Server │
│ POST /api/tokens/authenticate │
│ GET /api/search/kb-components│
│ GET .../versions │
│ GET .../vulnerabilities │
│ GET .../upgrade-guidance │
└─────────────────────────────────┘analyze_component is the high-level orchestrator. It calls the other four API methods in sequence: search → version lookup → vulnerability check → upgrade guidance.
Prerequisites
Node.js 18+ (ESM +
URLglobal required)A running Black Duck instance (on-prem or SaaS) with API access
A Black Duck API token — generate one from the Black Duck UI:
Log in to Black Duck
Click your username (top right) → My Profile
Navigate to User → API Tokens
Click Generate New Token, copy the value
Configuration
Copy .env.example to .env and fill in your values, or pass them inline at runtime.
Variable | Required | Description |
| Yes | Your Black Duck instance URL, e.g. |
| Yes | API token from Black Duck UI → User → API Tokens |
Integration
Claude Code (CLI)
Add to ~/.claude/claude.json:
{
"mcpServers": {
"blackduck": {
"command": "node",
"args": ["/absolute/path/to/blackduck-mcp/dist/index.js"],
"env": {
"BLACKDUCK_BASE_URL": "https://your-blackduck.company.com",
"BLACKDUCK_API_TOKEN": "your-token-here"
}
}
}
}Or use the CLI shortcut:
claude mcp add blackduck node /absolute/path/to/blackduck-mcp/dist/index.js \
-e BLACKDUCK_BASE_URL=https://your-host \
-e BLACKDUCK_API_TOKEN=your-tokenVerify it was registered:
claude mcp listClaude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"blackduck": {
"command": "node",
"args": ["/absolute/path/to/blackduck-mcp/dist/index.js"],
"env": {
"BLACKDUCK_BASE_URL": "https://your-blackduck.company.com",
"BLACKDUCK_API_TOKEN": "your-token-here"
}
}
}
}VS Code / Cursor
Add to .vscode/mcp.json (workspace) or your user settings:
{
"servers": {
"blackduck": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/blackduck-mcp/dist/index.js"],
"env": {
"BLACKDUCK_BASE_URL": "https://your-blackduck.company.com",
"BLACKDUCK_API_TOKEN": "your-token-here"
}
}
}
}Manual Testing with MCP Inspector
Test the server directly in a browser UI before wiring it into an AI client:
BLACKDUCK_BASE_URL=https://your-host BLACKDUCK_API_TOKEN=your-token \
npx @modelcontextprotocol/inspector node dist/index.jsThis opens a browser UI where you can call each tool individually and inspect the raw JSON responses.
Available Tools
search_component
Search for a component by name in the Black Duck Global KnowledgeBase.
Parameter | Type | Required | Description |
| string | Yes | Component name, e.g. |
Output: List of matching components sorted by exact name match, then by release count. Each entry includes the href needed by other tools.
Example prompt:
"Find the log4j component in Black Duck"
list_component_versions
List versions of a component, optionally filtered by version string.
Parameter | Type | Required | Description |
| string | Yes |
|
| string | No | Version name to filter on, e.g. |
Output: List of versions with release dates, vulnerability counts (⚠️ / ✓), and hrefs.
Example prompt:
"List all versions of log4j and show which ones have vulnerabilities"
get_version_vulnerabilities
Get all known CVEs and BDSAs for a specific component version.
Parameter | Type | Required | Description |
| string | Yes |
|
Output: Vulnerabilities grouped by severity (CRITICAL / HIGH / MEDIUM / LOW / UNKNOWN), each with CVSS score, CWE ID, source, and description.
Example prompt:
"What CVEs does log4j 1.2.17 have?"
get_upgrade_guidance
Get Black Duck's recommended safe upgrade versions for a component version.
Parameter | Type | Required | Description |
| string | Yes |
|
Output: Short-term (patch) and long-term (major) upgrade recommendations, each with version string and href.
Example prompt:
"What does Black Duck recommend upgrading log4j 1.2.17 to?"
analyze_component (orchestrator)
High-level end-to-end analysis: given a component name and version, performs a full vulnerability assessment and identifies the safest upgrade path.
Parameter | Type | Required | Description |
| string | Yes | Component name, e.g. |
| string | Yes | Version to check, e.g. |
Internal sequence:
1. search_component(componentName)
2. list_component_versions(href, filter=currentVersion)
3. get_version_vulnerabilities(versionHref)
4. get_upgrade_guidance(versionHref)
→ if no guidance: scans up to 20 recent versions for a clean oneOutput: Markdown report including:
Component identity in the KnowledgeBase
Version confirmation
All vulnerabilities grouped by severity (top 5 per group shown)
Short-term and long-term upgrade recommendations
Summary with recommended upgrade version
Example prompt:
"Our project uses log4j 1.2.17. Is it safe to use? What should we upgrade to?"
Example Workflow
User: "Our project uses log4j 1.2.17. Is it safe?"
Claude uses analyze_component(componentName="log4j", currentVersion="1.2.17"):
→ Finds log4j in the KnowledgeBase
→ Confirms version 1.2.17 exists
→ Finds CVE-2019-17571 and others (CRITICAL/HIGH severity)
→ Recommends upgrading to 2.17.1 (from Black Duck guidance)
→ Returns full markdown report with all findingsAuthentication
On first API call:
POST /api/tokens/authenticatewithAuthorization: token {API_TOKEN}Bearer token cached in memory for the process lifetime
On HTTP 401: re-authenticates once automatically, then retries the original request
If the second attempt also fails, the error is propagated to the AI client
The token is not persisted to disk. Each server restart requires fresh authentication, which happens automatically on the first tool call.
Note: The
[BD] GET ...lines you may see on stderr are intentional debug logs fromclient.ts. They are not part of MCP protocol output and do not affect functionality.
Troubleshooting
Symptom | Likely Cause | Fix |
| Env vars not passed to the process | Check the |
| Expired or invalid API token | Regenerate token in Black Duck UI → User → API Tokens |
| Wrong base URL or firewall blocking | Verify the URL is reachable: |
Tool returns "not found" for a known package | Component name mismatch | Use |
|
| Run |
Stderr output visible in client | Normal — server logs to stderr intentionally | Logs are separate from MCP protocol; not a bug |
Contributing
Fork the repository
Create a feature branch:
git checkout -b feat/my-featureMake changes and run
npm run buildto confirm no TypeScript errorsSubmit a pull request with a clear description
The codebase uses strict TypeScript ("strict": true in tsconfig.json). All new tools should follow the pattern in src/tools/searchComponent.ts: export a zod schema object and a handler function, then register both in src/index.ts.
License
MIT — see LICENSE
Available Tools
5 toolsanalyze_componentA
High-level analysis: given a component name and version, confirms vulnerabilities and identifies the safest upgrade path
Inputs: componentName (required), currentVersion (required).
get_upgrade_guidanceB
Get Black Duck's recommended safe upgrade versions for a vulnerable component version
Inputs: componentVersionHref (required).
get_version_vulnerabilitiesB
Get known vulnerabilities (CVEs/BDSAs) for a specific component version
Inputs: componentVersionHref (required).
list_component_versionsC
List available versions of a component in the Black Duck KnowledgeBase
Inputs: componentHref (required), versionFilter.
search_componentC
Search for a component by name in the Black Duck Global KnowledgeBase
Inputs: name (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
The four granular tools target distinct steps (search, list versions, get vulnerabilities, get upgrade guidance) and are easy to tell apart. analyze_component overlaps by design with the granular chain, but its description clearly frames it as a high-level aggregate, so misselection risk is low though not zero.
All five tools follow a consistent snake_case verb_noun pattern (search_component, list_component_versions, get_version_vulnerabilities, get_upgrade_guidance, analyze_component). Verb choices (search/list/get/analyze) accurately signal the operation type.
Five tools is well-scoped for a vulnerability-and-upgrade lookup workflow. Each tool maps to a clear step in the pipeline, with the composite tool as a convenience entry point rather than filler.
The search → versions → vulnerabilities → upgrade path is fully covered end-to-end, including a composite shortcut. However, Black Duck's domain also includes license/security risk metadata and project/BOM scanning, which are absent, leaving minor gaps an agent cannot work around.
Maintenance
Related MCP Connectors
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
Query your team's drift, vulnerability, and upgrade data from any AI assistant. OAuth 2.1, 51 tools.
CVE lookups (NVD) and dependency-manifest audits (OSV) for AI agents. No API keys.
CVE lookups (NVD) and dependency-manifest audits (OSV) for AI agents. No API keys.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceAn 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.-
- AlicenseNot gradedqualityDmaintenanceAn MCP server for Black Duck Polaris that enables AI coding assistants to trigger scans, manage findings, generate reports, and handle policies across SAST, SCA, and DAST tools.1MIT
- AlicenseBqualityBmaintenanceEnables LLM clients to access DevSecOps tooling such as CI/CD pipeline status, vulnerability triage, log search, and dependency scanning through MCP, turning AI copilots into security-aware engineering partners.6MIT
- AlicenseAqualityCmaintenanceEnables AI coding assistants to inspect ELF, PE, and Mach-O binaries for hardening mitigations and high-risk symbols, and to triage source or decompiled code against MITRE CWE patterns through MCP tools.3MIT