← Back
GitHub
GitHub MCP Server gains secret scanning for AI coding agents in public preview
GitHub CopilotGitHub · featuresecurityapiintegration · github.blog ↗

Secret Scanning in AI Coding Environments

The GitHub MCP Server now integrates secret scanning capabilities directly into AI coding agents and MCP-compatible IDEs. This new feature helps developers prevent accidental credential leaks by detecting exposed secrets while writing code, before those changes are committed or pushed to repositories.

How It Works

When using MCP-enabled environments, AI coding agents can invoke GitHub's secret scanning tools on demand. Developers can prompt their AI agent to scan current changes for exposed secrets, which sends the code to GitHub's secret scanning engine. The response includes structured results showing the locations and details of any detected secrets, allowing developers to remediate issues immediately.

Getting Started

To use this feature:

  1. Set up the GitHub MCP Server in your development environment
  2. (Optional) Install the GitHub Advanced Security plugin for enhanced scanning:
    • GitHub Copilot CLI: Run /plugin install advanced-security@copilot-plugins
    • Visual Studio Code: Install the advanced-security agent plugin and use /secret-scanning in Copilot Chat
  3. Ask your agent to scan changes for secrets before committing:
    • Copilot CLI: Use copilot --add-github-mcp-tool run_secret_scanning
    • VS Code: Use /secret-scanning followed by your prompt in Copilot Chat

Example prompt: "Scan my current changes for exposed secrets and show me the files and lines I should update before I commit."

Availability and Requirements

This feature is currently in public preview and requires repositories with GitHub Secret Protection enabled. It works with any MCP-compatible IDE and AI coding agent, with dedicated integration paths for GitHub Copilot CLI and Visual Studio Code.