Contrast Security MCP Server for Vulnerability Remediation
Integrate Contrast's vulnerability and SCA data via MCP server into your coding agent to rapidly remediate vulnerabilities.
npx -y @Contrast-Security-OSS/mcp-contrastOverview
The Contrast Security MCP Server for Vulnerability Remediation lets you surface Contrast application security findings (vulnerabilities and SCA results) as Model Context Protocol (MCP) resources that a coding agent or LLM-based assistant can consume. Instead of embedding raw scan results in prompts, an MCP-compliant server packages targeted, pre-filtered contextual data—vulnerability details, evidence, and suggested remediation—so agents can produce precise, actionable fixes and patch suggestions.
This server is useful when you want automated code suggestions, PR comments, or pre-merge checks that directly reference Contrast findings. By converting Contrast API data into an MCP context feed, you reduce noise, protect sensitive data (by returning only what’s necessary), and accelerate remediation workflows inside IDE assistants or CI-integrated bots.
Features
- Exposes Contrast vulnerability and SCA findings as MCP-style context resources
- Filters and formats findings to include only relevant evidence (stack traces, vulnerable code snippets, dependency info)
- Supports credentialed access to Contrast APIs (API key/credentials configuration)
- Caching and rate-limit handling to avoid repeated heavy API calls
- Endpoint(s) designed for easy integration with code assistants, CI bots, and PR automation
- Configurable scoping (applications, severity, CWE, CVE, or time ranges)
Installation / Configuration
These instructions assume you have the repository locally. The server can be run via Docker (recommended) or from source.
- Clone the repo:
2a. Run with Docker (example)
# build image (if Dockerfile provided)
# run with environment variables
2b. Run locally (example; actual command may vary depending on language/build system)
# If the project uses Maven/Gradle/Node, build first, then run:
# or
&& - Example .env / config file
# Contrast API credentials and server options
CONTRAST_URL=https://app.contrastsecurity.com
CONTRAST_API_KEY=org_api_key_here
CONTRAST_SERVICE_KEY=org_service_key_here
CONTRAST_ACCOUNT_ID=12345
MCP_PORT=8080
CACHE_TTL_SECONDS=300
Environment variables and exact names may vary; consult the repository code or configuration files for exact keys.
Common configuration options (table)
| Option | Purpose |
|---|---|
| CONTRAST_URL | Base URL for Contrast API/console |
| CONTRAST_API_KEY, CONTRAST_SERVICE_KEY | API credentials for Contrast |
| CONTRAST_ACCOUNT_ID | Account or organization identifier |
| MCP_PORT | Local port the MCP server listens on |
| CACHE_TTL_SECONDS | How long to cache fetched findings |
Available Resources
The server typically exposes the following resource types (paths may vary by implementation):
- GET /mcp/manifest — Returns MCP manifest describing available context types
- POST /mcp/context — Accepts a context request from an agent and returns relevant findings
- GET /mcp/vulnerabilities?appId=… — Filtered list of vulnerability summaries
- GET /mcp/sca?appId=… — SCA/dependency findings for an application
Example request to request contextual data (agent -> server):
POST /mcp/context HTTP/1.1
Content-Type: application/json
{
"request_id": "req-123",
"target": {
"repository": "acme/service",
"file_path": "src/main/java/com/acme/PaymentService.java",
"line": 128
},
"constraints": {
"severities": ["HIGH","CRITICAL"],
"max_results": 10
}
}
Example response (server -> agent):
Use Cases
- Agent-assisted code fixes: An LLM coding assistant requests context for a file/line: the MCP server returns the specific Contrast finding and evidence, enabling the assistant to generate a minimal, correct patch (e.g., parameterize a query or sanitize input).
- PR automation: A CI bot queries the MCP server to list vulnerabilities touched by a pull request and