Logo Contrast MCP Server

Contrast MCP Server

Tổ chức
Contrast-Security-OSS

MCP Server for Contrast Security

Nhà phát hànhContrast-Security-OSS
Kho mãmcp-contrast
Ngôn ngữJava
Bản fork
6
Sao
23
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépApache-2.0
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Contrast MCP Server cung cấp các chức năng MCP cho các ứng dụng khách AI và tác nhân AI tương thích.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Mẫu cấu hình có thể sao chép ngay

    Dùng các đoạn cấu hình mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Mức độ quan tâm của cộng đồng đến kho mã

    23 sao và 6 bản fork từ kho mã được liên kết.

Contrast MCP Server

Java CI with Gradle License

The Contrast MCP Server connects Contrast Security to your AI coding agent so you can remediate vulnerabilities, update insecure libraries, and analyze security coverage through natural language.

It comes in two forms.

  • Hosted MCP Server is a remote MCP server that Contrast runs for you. It is the simplest path for Contrast SaaS customers, with browser-based OAuth sign-in and nothing to install. Recommended for most users.
  • Local MCP Server is the open-source server in this repository that you run yourself with API keys. It is the right choice for on-premises and EOP (Enterprise On-Premises) instances.

[!WARNING] CRITICAL SECURITY WARNING: Exposing Contrast vulnerability data to an AI service that trains on your prompts can leak sensitive information. Only use the Contrast MCP Server with environments that contractually guarantee data isolation and prohibit model training on your inputs.

Verify AI Data Privacy: Confirm that your service agreement prevents model training on your prompts and consult your security team before sharing Contrast data.

UNSAFE: Public consumer LLM sites (e.g., free ChatGPT, Gemini, Claude) that use prompts for training.

POTENTIALLY SAFE: Enterprise services with contractual privacy guarantees (e.g., Google Cloud AI, AWS Bedrock, Azure OpenAI).

Contents

Hosted MCP Server (recommended)

The Hosted MCP Server, a remote MCP server that Contrast operates for you, is the easiest way to connect an AI agent to Contrast. You point your client at one URL, sign in through your browser, and your agent can start asking questions about your security data. There are no API keys to copy around, no container or JAR to keep updated, and no local process to run.

The hosted server is read-only and is available now for Contrast SaaS.

Prerequisites

  • A Contrast SaaS account with access to at least one organization
  • An MCP client that supports Streamable HTTP transport and OAuth 2.0 with PKCE (see Supported clients)
  • A modern web browser for the OAuth sign-in

Connect

Add the server to Claude Code by pointing it at your Contrast host followed by /mcp.

bash
claude mcp add --transport http contrast-hosted-mcp https://app.contrastsecurity.com/mcp

Replace app.contrastsecurity.com with your organization's Contrast URL if you use a dedicated instance. The first time your agent calls a tool, your browser opens for sign-in. If sign-in does not start automatically, run /mcp in Claude Code and choose Authenticate for contrast-hosted-mcp. You log in with your existing Contrast credentials, choose an organization, and approve read access. Your session refreshes on its own, so you typically sign in once and keep working.

For step-by-step setup for Claude Code, Claude Desktop, the Codex CLI, the GitHub Copilot CLI, and opencode, see the Hosted MCP Server installation guide.

Connection details

Any MCP client that supports Streamable HTTP transport and OAuth 2.0 with PKCE can connect.

SettingValue
Endpoint URLhttps://<your-contrast-host>/mcp (for example https://app.contrastsecurity.com/mcp)
TransportStreamable HTTP (stateless)
HTTP methodPOST
AuthenticationOAuth 2.0 with PKCE (S256)
OAuth scopesopenid, profile, offline_access

Your client discovers the OAuth configuration automatically through the WWW-Authenticate response header, which points to the standard /.well-known/oauth-protected-resource metadata document. Clients that support Dynamic Client Registration can register at /oauth2/connect/register on the Contrast origin.

These OAuth scopes cover identity only, and that is deliberate. The token grants no data permissions of its own. Authorization is decided by the Contrast platform on every request, using the signed-in user's existing role-based access control. This means there is no broadly-scoped token for an agent to hold or leak, and no authorization scope to get wrong at connection time. See Security and privacy for the full model.

Supported clients

ClientStatus
Claude Code CLIWorking
Codex CLIWorking
GitHub Copilot CLIWorking
opencodeWorking
Claude DesktopWorking
Gemini CLINot yet supported, OAuth compatibility issue
VS Code Copilot pluginNot yet supported, OAuth compatibility issue

Support for more clients is in progress as their OAuth handling matures. If your client fails during OAuth registration before the login page appears, that is usually a client compatibility issue rather than a problem with your account.

Security and privacy

The hosted server changes how access works without changing what you are allowed to see.

  • OAuth, not API keys. You sign in through your browser, so there are no long-lived keys to distribute or store on developer machines.
  • Read-only. Every hosted tool is read-only. You cannot modify, update, or delete data through the hosted server.
  • Organization-scoped. Each session is bound to the single organization you select at sign-in, so there is no organization ID to guess or get wrong.
  • Your existing permissions apply. Every request carries your identity to Contrast, which enforces the same role-based access control as the web interface. If you cannot see something in Contrast, your agent cannot see it either. Authorization is a runtime decision made on each request, not a one-time grant encoded in the token, so scoping an agent is the same exercise as scoping its user.
  • Every tool call is audited. Contrast records each request with a unique identifier, the tool invoked, the user, the organization, and the outcome, supporting incident reconstruction.
  • No data storage. The hosted server stores none of your data, and your token never appears in a tool response.

The shared warning above still applies. Tool results become part of your AI conversation, so follow your organization's policy on what security data can be sent to your chosen AI client and model.

Available tools

Both servers share the same core tools, so the table below covers them together. The Hosted and Local columns show which server provides each tool. Your agent calls the tools automatically based on your questions.

Authentication

ToolDescriptionHostedLocal
get_user_infoShow who you are signed in as and which organization is active✅—

Vulnerabilities (Assess)

ToolDescriptionHostedLocal
search_vulnerabilitiesSearch vulnerabilities across all applications (org-level)✅✅
search_app_vulnerabilitiesSearch vulnerabilities within a specific application with session filtering✅✅
get_vulnerabilityGet detailed vulnerability info including stack trace and remediation guidance✅✅
list_vulnerability_typesList all available vulnerability types for filtering✅✅

Applications

ToolDescriptionHostedLocal
search_applicationsSearch applications by name, tag, or metadata filters✅✅
get_session_metadataGet session metadata fields available for an application✅✅

Servers

ToolDescriptionHostedLocal
search_serversSearch the server inventory for agent health and Protect coverage✅✅

Libraries (SCA)

ToolDescriptionHostedLocal
list_application_librariesList libraries used by an application with class usage statistics and vulnerability counts✅✅
list_applications_by_cveFind applications affected by a specific CVE✅✅

Protection (ADR/Protect)

ToolDescriptionHostedLocal
search_attacksSearch attack events with filtering by status, type, and rules✅✅
get_protect_rulesGet protection rules configured for an application✅✅

Coverage

ToolDescriptionHostedLocal
get_route_coverageGet route coverage data showing exercised vs discovered routes✅✅

SAST (Scan)

ToolDescriptionHostedLocal
get_scan_projectGet SAST project details and vulnerability counts✅✅
get_scan_resultsGet SAST scan results in SARIF format—✅

CVEs, Issues, Incidents, and Observations

These tools are available only on the hosted server and require the Contrast unified data platform (NorthStar) to be enabled for your organization.

ToolDescriptionHostedLocal
search_cvesSearch CVEs across your organization for CVE Shield exposure and risk✅—
list_cve_issuesList affected applications and libraries for a CVE, one issue per pair✅—
get_cve_impactGet CVE risk, exposure, and shield protection posture across your organization✅—
search_issuesSearch and filter security issues across your organization✅—
get_issueGet full details for a specific issue✅—
list_issue_incidentsList incidents linked to an issue✅—
list_issues_by_libraryList open issues associated with an application library✅—
search_incidentsSearch and filter incidents✅—
get_incidentGet full details for a specific incident✅—
list_incident_issuesList issues linked to an incident✅—
get_observationGet full details for a specific observation✅—
list_issue_observationsList observations linked to an issue (cursor-paginated)✅—
list_incident_observationsList observations linked to an incident (cursor-paginated)✅—

Local MCP Server

The Local MCP Server is the open-source server in this repository. Your MCP client launches it as a local process over stdio, it authenticates with Contrast API and service keys, and it connects to your own Contrast instance, including on-premises and EOP. Use it when you cannot use the hosted server, or when you need raw SARIF scan output.

The local server provides the tools marked Local in Available tools above.

Quick start

Prerequisites

VS Code (GitHub Copilot) - One-Click Install

Install in VS Code

Click the button above to automatically install in VS Code. For manual setup, see the VS Code (GitHub Copilot) Installation Guide.

IntelliJ IDEA (GitHub Copilot)

Add this to your mcp.json configuration file and replace the placeholder values with your Contrast credentials:

json
{
  "servers": {
    "contrast": {
      "command": "docker",
      "args": [
        "run",
        "-e",
        "CONTRAST_HOST_NAME",
        "-e",
        "CONTRAST_API_KEY",
        "-e",
        "CONTRAST_SERVICE_KEY",
        "-e",
        "CONTRAST_USERNAME",
        "-e",
        "CONTRAST_ORG_ID",
        "-i",
        "--rm",
        "contrast/mcp-contrast:latest",
        "-t",
        "stdio"
      ],
      "env": {
        "CONTRAST_HOST_NAME": "example.contrastsecurity.com",
        "CONTRAST_API_KEY": "example",
        "CONTRAST_SERVICE_KEY": "example",
        "CONTRAST_USERNAME": "example@example.com",
        "CONTRAST_ORG_ID": "example"
      }
    }
  }
}

📖 Full IntelliJ (GitHub Copilot) Installation Guide - Includes step-by-step setup and JAR deployment option

Other AI Assistants

More setup and troubleshooting

Getting the JAR file (download, attestation verification, and build from source), proxy configuration, and troubleshooting have moved to the Local MCP Server guide.

Sample prompts

These prompts work with either server, except where a section says otherwise.

For the Developer

Remediate Vulnerabilities in Code

  • Please list vulnerabilities for Application Y.
  • Give me details about vulnerability X in Application Y.
  • Review vulnerability X and fix it.

Third-Party Library Remediation

  • Which libraries in Application X have high or critical vulnerabilities and are actively used?
  • Update library X, which has a critical vulnerability, to the safe version.
  • Which libraries in Application X are not being used?

Retrieve Applications by Tag

  • Please give me the applications tagged with "backend."

Retrieve Applications by Metadata

  • Please give me the applications with metadata "dev-team" and "backend-team."

Retrieve Vulnerabilities by Session Metadata

  • Give me the session metadata for Application X.
  • Give me the vulnerabilities in the latest session for Application X.
  • Give me the vulnerabilities for session metadata "Branch Name" "feature/some-new-fix" for Application X.
  • Give me the route coverage for the latest session for Application X.
  • Give me the route coverage for session metadata "Branch Name" "feature/some-new-fix" for Application X.

For the Security Professional

  • Please give me a breakdown of applications and servers vulnerable to CVE-xxxx-xxxx.
  • Please list the libraries for the application named xxx and tell me what version of commons-collections is being used.
  • Which vulnerabilities in Application X are being blocked by a Protect or ADR rule?
  • Which production servers do not have Protect enabled?
  • Show me servers whose agents are out of date.
  • Show me attack events from the last 7 days and tell me which were exploited.

Hosted server with the unified data platform (NorthStar)

These prompts require the hosted server and the Contrast unified data platform (NorthStar) to be enabled for your organization.

  • Which CVEs pose the highest risk across my organization?
  • Is my organization shielded from CVE-xxxx-xxxx?
  • Which applications and libraries are affected by CVE-xxxx-xxxx?
  • Show me open security issues for Application X.
  • Give me the details of incident X and the issues linked to it.
  • What observations provide evidence for issue X?

Data privacy

The Contrast MCP Server provides a bridge between your Contrast Data and the AI Agent/LLM of your choice. By using Contrast's MCP server you will be providing your Contrast Data to your AI Agent/LLM, it is your responsibility to ensure that the AI Agent/LLM you use complies with your data privacy policy. Depending on what questions you ask the following information will be provided to your AI Agent/LLM.

  • Application Details
  • Application Rule configuration
  • Vulnerability Details
  • Route Coverage data
  • ADR/Protect Attack Event Details
  • Server inventory and agent details (hostnames, paths, agent versions, environments, log levels, and tags)
  • Issue, incident, observation, and CVE Shield data (hosted server with NorthStar)

Changelog

See CHANGELOG.md for the complete release history, including breaking changes and new features.

Cài đặt

TypingMind
Yêu cầu:

Node.js 18+

{
  "mcpServers": {
    "contrast-security-oss-mcp-contrast": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-contrast"
      ]
    }
  }
}

Dùng MCP Contrast MCP Server với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối Contrast MCP Server, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Thiết lập trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Thiết lập trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh thiết lập trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Để tiến trình tiếp tục chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Để tiến trình tiếp tục chạy trong cửa sổ Terminal khi bạn dùng các công cụ MCP.
3

Thêm Contrast MCP Server làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của Contrast MCP Server.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "contrast-security-oss-mcp-contrast": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-contrast"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của Contrast MCP Server, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của Contrast MCP Server.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện trên TypingMind dùng các công cụ MCP đã bật với mô hình AI đã chọn
Bạn có thể dùng Contrast MCP Server giúp tôi làm việc này không?
Contrast MCP Server
Được. Tôi đọc rồi.
Đây là kết quả tôi tìm được bằng Contrast MCP Server.

Câu hỏi thường gặp

Máy chủ MCP Contrast MCP Server dùng để làm gì?

Contrast MCP Server là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP Contrast MCP Server với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng Contrast MCP Server với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP Contrast MCP Server với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối Contrast MCP Server, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP Contrast MCP Server với TypingMind?

Contrast MCP Server hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP Contrast MCP Server cung cấp những công cụ nào trong TypingMind?

Contrast MCP Server cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP Contrast MCP Server không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu Contrast MCP Server yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇