code-scanner-mcp
Code security scanner MCP server - scans secrets, dependencies, and insecure code patterns
Documentation
Code Security Scanner MCP Server
Scan your local codebase for security vulnerabilities, hardcoded secrets, and insecure coding patterns — all from your AI assistant via MCP (Model Context Protocol).
Features
🔑 Secrets Detection (24+ patterns)
- AWS Access Keys & Secret Keys
- GitHub tokens (personal, OAuth, app)
- Stripe API keys (live/test)
- Slack tokens & webhooks
- Google Cloud / Firebase credentials
- Database connection strings
- JWT tokens & private keys (RSA, DSA, EC)
- npm auth tokens, Telegram bot tokens, SendGrid API keys
- Generic API keys & password assignments
📦 Dependency Vulnerability Scanning
Automatically detects and parses:
- `package.json` (npm/yarn/pnpm)
- `requirements.txt`, `Pipfile`, `pyproject.toml` (Python)
- `go.mod` (Go)
- `Cargo.toml` (Rust)
- `pom.xml`, `build.gradle` (Java)
Checks against a built-in database of 45+ CVEs across JavaScript, Python, Java, Go, and Rust ecosystems.
🛡️ Insecure Code Pattern Detection
- SQL Injection: String concatenation in queries, raw SQL builders
- XSS: innerHTML, dangerouslySetInnerHTML, v-html
- Command Injection: os.system, subprocess shell=True, eval/exec, child_process.exec
- Path Traversal: Unsanitized file paths
- Insecure Deserialization: pickle, yaml.load, marshal
- Configuration Issues: Debug mode, CORS wildcard, hardcoded JWT secrets
- Information Leakage: Stack trace exposure, directory listing
Tools
| Tool | Description |
|---|---|
| `scan_secrets` | Scan for hardcoded API keys, tokens, and passwords |
| `scan_dependencies` | Check dependencies against known vulnerability database |
| `scan_code_patterns` | Detect SQLi, XSS, command injection, and other patterns |
| `scan_file` | Comprehensive scan of a single file (secrets + code patterns) |
| `scan_directory` | Full project audit (secrets + dependencies + code patterns) |
Quick Start
Prerequisites
- Python 3.11+
- `pip install mcp pydantic`
Run with MCP Inspector
git clone https://github.com/214070779/code-scanner-mcp.git
cd code-scanner-mcp
pip install mcp pydantic
npx @modelcontextprotocol/inspector python3 server.pyConfigure in your AI Client
Add to your MCP settings:
{
"mcpServers": {
"code-scanner": {
"command": "python3",
"args": ["/path/to/code-scanner-mcp/server.py"]
}
}
}Example Usage
"Scan my project for security issues"
→ AI calls `scan_directory(path="./my-project")`
"Check this file for secrets before committing"
→ AI calls `scan_file(path="./src/config.ts")`
"Are there any vulnerable npm packages?"
→ AI calls `scan_dependencies(path=".")`
Supported Platforms
Development
# Clone and install
git clone https://github.com/214070779/code-scanner-mcp.git
cd code-scanner-mcp
pip install mcp pydantic
# Run tests
python3 -c "from server import mcp; print('OK:', list(mcp._tool_manager._tools.keys()))"
# Run with inspector
npx @modelcontextprotocol/inspector python3 server.pyLicense
MIT
Frequently asked questions
What is code-scanner-mcp?
code-scanner-mcp is Code security scanner MCP server - scans secrets, dependencies, and insecure code patterns
How do I install code-scanner-mcp?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is code-scanner-mcp open source?
Yes — it is hosted on GitHub at https://github.com/214070779/code-scanner-mcp.
Related MCP tools
5. Update .env file in the root directory with your mem0 API key: for the Model Context Protocol. Enhance AI assistants with powerful integrations.
Model Context Protocol integration for Python. Enhance AI assistants with powerful Python-based capabilities and integration support.
This repository contains Model Context Protocol (MCP) servers that enable MCP clients (like Claude Desktop or the cline.
🙌 OpenHands: Code Less, Make More for the Model Context Protocol. Enhance AI assistants with powerful integrations. Python-based implementation.
Universal memory layer for AI Agents; Announcing OpenMemory MCP - local and secure memory management. Python-based implementation.
基于大模型搭建的聊天机器人,同时支持 微信公众号、企业微信应用、飞书、钉钉 等接入,可选择ChatGPT/Claude/DeepSeek/文心一言/讯飞星火/通义千问/ Gemini/GLM-4/Kimi/LinkAI,能处理文本、语音和图片,访问操作系统和互联网,支持基于自有知识库进行定制企业智能客服。
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP