Labsco
GitGuardian logo

GitGuardian

β˜… 36

from GitGuardian

Scan projects for over 500 types of secrets using GitGuardian's API to prevent credential leaks.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredAdvanced setup

GitGuardian MCP Server

Bring GitGuardian's secret detection and incident management into your AI agent. Scan code for credentials before they leak, triage existing incidents, generate honeytokens, and remediate findings β€” all from inside your IDE or chat client, backed by GitGuardian's 500+ detectors.

[!CAUTION] MCP servers are an emerging technology. Agents act on your behalf and under your responsibility. Use trusted MCP servers and review agent actions when they interact with tools. To limit blast radius the server defaults to read-only-leaning permissions; what is actually exposed is determined by the OAuth scopes your access token holds.

What it does

  • Secret scanning β€” proactively scan files for leaked credentials.
  • Incident management β€” list, filter, assign, resolve, and tag incidents (both internal and Public Monitoring incidents).
  • Honeytokens β€” generate honeytokens and list existing ones.
  • Code-fix automation β€” open pull requests that remediate secrets in repositories your workspace monitors.

The exact set of tools exposed to your agent depends on the OAuth scopes granted to your access token.

Prompt examples

Copy & paste β€” that's it
Scan this codebase for any leaked secrets or credentials.
Copy & paste β€” that's it
Remediate all incidents related to my project.
Copy & paste β€” that's it
Check if there are any new security incidents assigned to me.
Copy & paste β€” that's it
Help me understand this security incident and provide remediation steps.
Copy & paste β€” that's it
List all my active honeytokens.
Copy & paste β€” that's it
Generate a new honeytoken for monitoring AWS credential access.
Copy & paste β€” that's it
Create a honeytoken named 'dev-database' and hide it in config files.

Authentication

Most users do not need to touch this β€” the Quick start config implicitly uses the OAuth proxy mode on the hosted server, and the Local stdio config uses PAT env.

There are four authentication modes the server can run in; you pick one via env vars.

ModeConfigurationUsed by
OAuth proxy (HTTP)MCP_OAUTH_PROXY_ENABLED=true + ENABLE_LOCAL_OAUTH=falseThe hosted MCP server. MCP client runs OAuth against /authorize+/token; the server proxies to the GG dashboard.
Raw bearer (HTTP)ENABLE_LOCAL_OAUTH=false + MCP_PORT setSelf-hosted deployments without OAuth. Client sends Authorization: Bearer <PAT> on every request.
PAT env (any transport)GITGUARDIAN_PERSONAL_ACCESS_TOKEN=<pat> + ENABLE_LOCAL_OAUTH=falseCI, scripts, local stdio. Server uses the env-var PAT for every GG API call.
Browser-OAuth stdio (deprecated)ENABLE_LOCAL_OAUTH=true (today's default in stdio)Legacy uvx --from … flow that opens a localhost callback and stores the PAT on disk.

[!NOTE] Browser-driven OAuth in stdio mode is deprecated. New stdio deployments should authenticate with a PAT; OAuth-driven flows should use the hosted or self-hosted HTTP server. The stdio OAuth code path will be removed in a future release; until then it remains the default in stdio for backward compatibility.

Local stdio mode (PAT-only)

For CI/CD, airgapped environments, or older MCP clients, run the server locally over stdio with a PAT:

Copy & paste β€” that's it
{
  "mcpServers": {
    "GitGuardian": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/GitGuardian/ggmcp.git",
        "gg-mcp-server"
      ],
      "env": {
        "ENABLE_LOCAL_OAUTH": "false",
        "GITGUARDIAN_PERSONAL_ACCESS_TOKEN": "your_pat_here",
        "GITGUARDIAN_URL": "https://dashboard.gitguardian.com"
      }
    }
  }
}

Create a PAT in your GitGuardian dashboard under API β†’ Personal Access Tokens. The set of tools the server exposes depends on the PAT's scopes.

For Claude Desktop on macOS, the command field needs the absolute path to uvx (e.g. /Users/you/.local/bin/uvx) β€” Claude Desktop does not resolve $PATH for MCP servers.

Self-hosting the MCP server

The MCP server will be soon available out of the box as part of your GitGuardian self-hosted deployment (Helm chart). This section is only meant to describe how it works, but you don't have to set it up.

A Docker image is published at ghcr.io/gitguardian/ggmcp. Run it behind a reverse proxy that terminates TLS, then point your MCP clients at it. The container exposes the StreamableHTTP transport on port 8000 by default.

Minimum configuration:

Copy & paste β€” that's it
docker run -p 8000:8000 \
  -e GITGUARDIAN_URL=https://dashboard.gitguardian.mycorp.local \
  -e MCP_BASE_URL=https://mcp.mycorp.local \
  -e MCP_OAUTH_PROXY_ENABLED=true \
  -e ENABLE_LOCAL_OAUTH=false \
  ghcr.io/gitguardian/ggmcp:latest \
  gunicorn --workers=4 --worker-class=uvicorn.workers.UvicornWorker \
           -b 0.0.0.0:8000 gg_mcp_server.http_app:app

MCP_OAUTH_PROXY_ENABLED=true makes the server advertise itself as an OAuth Protected Resource (RFC 9728) and proxy /authorize, /token, /register to your GitGuardian dashboard. MCP clients then run the OAuth flow against your domain.

Migration notes

The developer-mcp-server and secops-mcp-server console scripts are deprecated and re-export the unified gg-mcp-server. Update your MCP client configuration to invoke gg-mcp-server directly; both old scripts will be removed in a future release.

Want more?

Have a use case that isn't covered? Open an issue with your idea.

Development

See DEVELOPMENT.md for contributing, running tests, and adding new tools.