Back to blog

Supercharge your vulnerability remediation with Contrast MCP

Contrast Security is proud to announce the launch of our MCP server. Smart assistants help you find and fix mistakes in your writing. Now, picture an assistant fixing security weaknesses in your code. An IDE-based AI agent, such as Copilot, armed with Contrast’s MCP server, can do just that! 

See Contrast MCP in action: Remediating SQL injection vulnerabilities

Watch how the Contrast MCP server empowers an AI coding agent to quickly identify and fix a real-world SQL injection vulnerability.

 

Demo: Streamlining JNDI vulnerability fixes with Contrast MCP

This video showcases how the Contrast MCP server, combined with an AI assistant, simplifies the process of remediating a complex JNDI injection vulnerability.

 

The Contrast MCP server is a bridge between Contrast’s data — most notably, the powerful and contextual Interactive Application Security Testing (IAST) vulnerability data — and an integrated development environment- (IDE-) based AI agent. This bridge allows the agent to pinpoint the vulnerable code and fix it without ever leaving the IDE. In addition to the vulnerability data itself, Contrast provides its expert-curated remediation guidance to the AI agent. This ensures the AI has all the information it needs to get the fix right the first time. 

Let’s take a deeper dive into the technology behind this innovation. 

What is MCP?

Model Context Protocol (MCP) is designed to enable Large Language Models (LLMs) inside of AI agents to access external data sources and tools. This significantly expands their utility by providing custom information and the ability to effect change in external systems, without the need of special training or development. MCP comprises two key components: the MCP client, which lives within AI tools like GitHub Copilot, Cline, Aider or Claude Desktop; and the MCP server, which exposes tools, services, and/or data.

Upon startup, the MCP client within the AI tool queries the configured MCP servers to retrieve a list of available tools and descriptions. This allows the AI tool to understand what's available and how to use it. When the AI is prompted, it knows what tools are available and can leverage those tools however it sees fit, enabling a multitude of use cases.  

A simple example of MCP's power is its ability to expose a portion of the local filesystem to the MCP client and, subsequently, to the LLM. This enables the LLM to read and interact with local files, facilitating operations that would otherwise be impossible for a cloud-based LLM. Essentially, MCP bridges the gap between the LLM's execution environment and external resources, allowing for sophisticated interactions.

Contrast’s MCP server

The Contrast MCP server provides the MCP client — and, by extension, the LLM — with access to Contrast Security’s vulnerability data. When used in conjunction with an agentic coding tool, it allows developers to efficiently and effectively remediate vulnerabilities because of the deep context Contrast provides. This is made possible because Contrast’s MCP server supplies the coding tool with detailed vulnerability information, including:

  • Vulnerability type (SQL injection, unsafe deserialization, command injection, etc.)
  • Exact location in the code
  • The HTTP endpoint and HTTP request that triggered the vulnerability detection
  • Data flow through the application
  • User-controlled data that entered the vulnerable sink
  • Detailed instructions on how to fix the vulnerability

With this comprehensive information, the coding agent — which the developer prompts and then guides — can quickly and accurately remediate the identified vulnerability.

Why use Contrast’s MCP server?

Leveraging Contrast’s MCP server in conjunction with an AI coding agent allows developers to swiftly and precisely remediate vulnerabilities that Contrast detects. While this appears to be the most powerful use case, given the flexible nature of the MCP technology, you could ask an AI agent to do just about anything with your Contrast data. For example:

  • Prioritize and fix vulnerable libraries in applications based on Contrast’s library usage data.
  • Rapidly assess the impact of newly announced high-severity vulnerabilities across your applications.
  • Quickly identify and remove unused libraries using runtime class usage data.

These examples are not exhaustive; the true power of MCP lies in the flexibility it provides to users of LLMs.

Learning how to use Contrast MCP 

We've created a video that guides you through using Contrast’s MCP server. The video also shows you how to fix the SQLi and JNDI vulnerabilities discussed in this article.

 

The versatility of MCP extends far beyond what we’ve covered here, and its ability to empower LLMs to interact with various systems opens up countless possibilities for improved security workflows. To get started and explore the Contrast MCP server firsthand, check out our repository on GitHub.

Try the Contrast MCP server

Joseph Beeton, Senior Application Security Researcher, Contrast Security

Joseph Beeton, Senior Application Security Researcher, Contrast Security

Joseph Beeton is a Senior Security Researcher for Contrast Security and a recovering Java Developer. He started his career as a Java developer writing archive/backup software before moving to a large financial company working on web applications and backend APIs. However, after a while, writing yet another microservice isn't that much fun anymore. Breaking them was, though. Thus, he moved to Application Security and from there on to Research.

Enlarged Image