mcp-contrast

MCP Server for Contrast Security

GitHub Stars

8

User Rating

Not Rated

Favorites

0

Views

141

Forks

3

Issues

3

Installation
Difficulty
Intermediate
Estimated Time
10-20 minutes
Requirements
Java 11 or higher
Maven latest version

Installation

Installation

Prerequisites

Please specify required software and versions:
Java: 11 or higher
Maven: Latest version

Installation Steps

1. Clone Repository

bash
git clone https://github.com/Contrast-Security-OSS/mcp-contrast.git
cd mcp-contrast

2. Install Dependencies

bash
mvn install

3. Start Server

bash
mvn spring-boot:run

Troubleshooting

Common Issues

Issue: Server won't start Solution: Check your Java version and reinstall dependencies. Issue: Maven build fails Solution: Verify your Maven configuration and ensure required plugins are installed.

Configuration

Configuration

Basic Configuration

Setting Environment Variables

Set the following environment variables as needed:
bash
export CONTRAST_HOST_NAME="example.contrastsecurity.com"
export CONTRAST_API_KEY="your-api-key"
export CONTRAST_SERVICE_KEY="your-service-key"
export CONTRAST_USERNAME="your-username"
export CONTRAST_ORG_ID="your-org-id"

Configuration Example

Basic Configuration

json
{
  "mcpServers": {
    "contrast-mcp": {
      "command": "java",
      "args": ["-jar", "mcp-contrast.jar"],
      "env": {
        "CONTRAST_HOST_NAME": "example.contrastsecurity.com",
        "CONTRAST_API_KEY": "your-api-key"
      }
    }
  }
}

Examples

Examples

Basic Usage

Here are basic usage examples for the MCP server:

Programmatic Usage

java
// Java example
import com.contrast.labs.MCPClient;

public class Example {
    public static void main(String[] args) {
        MCPClient client = new MCPClient();
        client.connect();
        // Execute tool
        String result = client.callTool("toolName", new HashMap<>());
        System.out.println(result);
    }
}

API Integration

python

Python example

import requests def call_mcp_tool(tool_name, params): response = requests.post( 'http://localhost:8080/mcp/call', json={ 'tool': tool_name, 'parameters': params } ) return response.json()

Usage example

result = call_mcp_tool('analyze', {'input': 'sample data'})

Use Cases

Retrieve a list of vulnerabilities for Application Y and remediate them.
Identify libraries in Application X that have high or critical vulnerabilities and are actively used.
Get details about vulnerability X and suggest remediation steps.
Update third-party library X to a safe version.

Additional Resources