secretscanner
The server exposes a single tool, scan_secrets, that scans files or directories for hardcoded secrets and returns a plain-text summary of findings.
Scans a given path (absolute or relative) for passwords, tokens, API keys, and other credentials.
Detects patterns like GitHub/Slack tokens, AWS keys, JWTs, RSA private keys, and URLs with credentials.
Ignores irrelevant directories and binary formats by default.
Provides a summary of found secrets, likely including severity and type (based on README capabilities).
Designed for integration with MCP-compatible agents; invoked via stdio using the
secret-scanner-mcpcommand.
Integrates as a pre-commit hook to prevent commits containing secrets.
SecretScanner
SecretScanner es una herramienta de código abierto para detectar secretos y credenciales hardcodeadas en código fuente. Incluye una CLI para Python, integración con pre-commit, un servidor MCP y una extensión para Visual Studio Code.
Características
Analiza archivos individuales o directorios completos.
Detecta tokens de GitHub y Slack, claves de AWS, JWT, contraseñas, API keys, claves RSA y URL con credenciales.
Clasifica los hallazgos por severidad y omite directorios y formatos irrelevantes.
Exporta resultados en JSON o CSV.
Devuelve un código de salida distinto de cero cuando encuentra secretos, útil para CI.
Se integra con agentes compatibles con MCP y con hooks de
pre-commit.
Los resultados pueden incluir falsos positivos. Revisa cada hallazgo y revoca inmediatamente cualquier credencial real expuesta.
Related MCP server: mcp-security-toolkit
Instalación
Requiere Python 3.10 o superior.
pip install secret-scanner-clTambién puedes instalarlo en un entorno aislado:
pipx install secret-scanner-clUso de la CLI
# Analizar el directorio actual
secret-scanner --path .
# Analizar una ruta y exportar un reporte JSON
secret-scanner --path ./mi-proyecto --output json
# Exportar CSV y mostrar cada archivo procesado
secret-scanner --path ./mi-proyecto --output csv --verboseOpción | Descripción |
| Archivo o directorio que se analizará. Es obligatorio. |
| Guarda los hallazgos en |
| Guarda los hallazgos en |
| Muestra los archivos mientras se procesan. |
El comando termina con código 1 cuando detecta al menos un posible secreto y con código 0 cuando no encuentra ninguno.
Patrones detectados
Tipo | Severidad |
GitHub Token | Alta |
AWS Access Key | Alta |
API Key genérica | Media |
Contraseña hardcodeada | Alta |
JWT | Alta |
Slack Token | Alta |
Clave privada RSA | Alta |
URL con credenciales | Media |
SecretScanner ignora automáticamente directorios como .git, node_modules, .venv, dist, build y output, además de formatos binarios comunes.
Integración con pre-commit
Añade esta configuración a .pre-commit-config.yaml:
repos:
- repo: https://github.com/Kiara1616/secretscanner
rev: v1.0.2
hooks:
- id: secret-scannerDespués instala el hook:
pre-commit installServidor MCP
El paquete instala el comando secret-scanner-mcp, que expone la herramienta mediante entrada y salida estándar (stdio).
{
"mcpServers": {
"secret-scanner": {
"command": "secret-scanner-mcp",
"args": []
}
}
}Extensión de Visual Studio Code
La carpeta vscode-extension/ contiene una extensión que analiza el archivo activo y señala posibles secretos en el editor. Para usarla:
Instala primero la CLI con
pip install secret-scanner-cl.Descarga el archivo
.vsixmás reciente desde la sección Assets del último release.En Visual Studio Code abre Extensions → ··· → Install from VSIX....
Ejecuta SecretScanner: Scan Current File desde la paleta de comandos.
Desarrollo
git clone https://github.com/Kiara1616/secretscanner.git
cd secretscanner
python -m venv .venv
# Windows
.venv\Scripts\activate
# Linux o macOS
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .
pytestLas pruebas exigen al menos 80 % de cobertura sobre el módulo del escáner.
Publicación
Las versiones estables se publican en PyPI y se generan automáticamente cuando se publica un release en GitHub. El número de versión de pyproject.toml debe coincidir con el tag del release.
Licencia
Distribuido bajo la licencia MIT. Consulta LICENSE.
Available Tools
1 toolscan_secretsA
Escanea un directorio o archivo en busca de contraseñas, tokens y claves API hardcodeadas.
Args: target_path: Ruta absoluta o relativa al archivo o carpeta que se desea analizar.
Returns: Un resumen en texto plano de los secretos encontrados.
| Name | Required | Description | Default |
|---|---|---|---|
| target_path | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description bears full burden for behavioral context. It does not disclose whether the scan is read-only, requires special permissions, or any side effects. The return type is mentioned but not the depth or scope of scanning.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured with clear Args and Returns sections. Every sentence serves a purpose with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has an output schema (not shown) and one parameter, the description is adequate but lacks details on recursion, file types scanned, or performance implications. It provides a minimal viable explanation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The single parameter 'target_path' is described as an absolute or relative path to a file or folder to analyze, adding meaningful context beyond the schema's bare title. Schema description coverage is 0%, so the description compensates well.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool scans a directory or file for hardcoded passwords, tokens, and API keys. It uses a specific verb and resource, and distinguishes itself from any potential siblings (none listed).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given on when to use this tool versus alternatives, nor any prerequisites or contextual cues. The description only states what it does without any usage direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.1- First observed
scan_secrets
TDQS
Scored across 1 tool
With only one tool, there is no ambiguity. The tool has a distinct purpose of scanning for secrets.
The single tool name 'scan_secrets' follows a clear verb_noun pattern, consistent within itself.
A single tool is appropriate for a focused secret scanning server, though it feels minimal.
The tool covers the core scanning functionality but lacks features like result filtering or detailed reports, leaving some gaps.
Maintenance
Related MCP Connectors
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
ArcAgent MCP server for bounty discovery, workspace execution, and verified coding submissions.
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP server for ai-scanner that enables AI agents to scan codebases for LLM usage, AI frameworks, and exposed secrets.38 npm1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that wraps Trivy and Gitleaks to provide file system vulnerability and secret scanning as tools for AI agents, enabling local, free security analysis.MIT
- AlicenseAqualityDmaintenanceAn MCP server that lets AI agents autonomously acquire, store, verify, and manage API keys for various services.70MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that scans code for exposed secrets (API keys, tokens, private keys, high-entropy strings) with placeholder-aware allowlisting and fully redacted reports, enabling agents to detect leaks before committing.2MIT