A comprehensive security scanner for Model Context Protocol (MCP) servers that detects vulnerabilities and security issues in your MCP implementations.
Features
🔑 Credential Detection - Finds hardcoded API keys, tokens, and insecure credential storage
A comprehensive security scanner for Model Context Protocol (MCP) servers that detects vulnerabilities and security issues in your MCP server implementations.
🎭 Server Spoofing - Detects servers impersonating popular services
🌊 Toxic Flows - Identifies dangerous data flow patterns
🔐 Permission Issues - Finds excessive permissions and access control problems
Quick Start 🚀
Option 1: NPM Package (Recommended)
# Install globally
npm install -g mcp-watch
# Scan any GitHub MCP repository
mcp-watch scan https://github.com/user/mcp-server
# Scan your local MCP project
mcp-watch scan-local /path/to/your/mcp-project
Option 2: From GitHub Source
# Clone and use immediately
git clone https://github.com/kapilduraphe/mcp-watch.git
cd mcp-watch
npm install
npm run build
# Scan GitHub repos
npm run scan:github https://github.com/user/mcp-server
# Scan local projects
npm run scan:local /path/to/your/mcp-project
Option 3: Docker (No Installation)
# Scan without installing anything
docker run --rm mcp-watch scan https://github.com/user/mcp-server
docker run --rm -v $(pwd):/workspace mcp-watch scan-local /workspace
Installation
Global Installation
npm install -g mcp-watch
Local Installation
npm install mcp-watch
From Source
git clone https://github.com/kapilduraphe/mcp-watch.git
cd mcp-watch
npm install
npm run build
Docker Installation 🐳
Quick Start with Docker
# Build and run locally
docker build -t mcp-watch .
docker run --rm mcp-watch scan https://github.com/user/mcp-server
# Build from source
git clone https://github.com/kapilduraphe/mcp-watch.git
cd mcp-watch
docker build -t mcp-watch .
Docker Compose (Recommended for Production)
# Build and run with Docker Compose
docker compose build
docker compose up mcp-watch
# Or run a one-off scan
docker compose run --rm mcp-watch scan https://github.com/user/repo
Docker Features
🔒 Security: Non-root user, minimal attack surface
📦 Optimized: Multi-stage builds, Alpine Linux base
🚀 Production: Ready for deployment and CI/CD
🧹 Simplified: Single optimized Dockerfile for all use cases
Usage
Command Line
Scan GitHub Repositories
# Scan a GitHub repository
mcp-watch scan https://github.com/user/mcp-server
# Scan with JSON output
mcp-watch scan https://github.com/user/mcp-server --format json
# Filter by severity
mcp-watch scan https://github.com/user/mcp-server --severity high
# Filter by category
mcp-watch scan https://github.com/user/mcp-server --category credential-leak
Scan Local Projects
# Scan current directory
mcp-watch scan-local .
# Scan specific directory (absolute path)
mcp-watch scan-local /path/to/your/mcp-project
# Scan specific directory (relative path)
mcp-watch scan-local ../my-mcp-server
# Local scan with JSON output
mcp-watch scan-local . --format json
# Local scan with severity filter
mcp-watch scan-local . --severity high
# Clone and build
git clone https://github.com/kapilduraphe/mcp-watch.git
cd mcp-watch
npm install
npm run build
# Use built version
node dist/main.js scan https://github.com/user/mcp-server
node dist/main.js scan-local /path/to/project
# Or use npm scripts
npm run scan https://github.com/user/mcp-server
npm run scan-local /path/to/project
Docker Usage 🐳
# Production container
docker run --rm mcp-watch scan https://github.com/user/mcp-server
docker run --rm mcp-watch scan https://github.com/user/mcp-server --format json --severity high
# Docker Compose
docker compose run --rm mcp-watch scan https://github.com/user/repo
docker compose run --rm mcp-watch scan https://github.com/user/repo --format json
# Interactive container
docker run -it --rm mcp-watch sh
Options
--format <type> - Output format: console (default) or json
# Build the project
npm run build
# Run in development mode
npm run dev scan https://github.com/user/repo
# Quick scan during development
npm run scan https://github.com/user/repo
# Clean build artifacts
npm run clean
# Type checking
npm run type-check
Development Workflow 🚀
Local Development (Recommended)
# Install dependencies
npm install
# Run development server
npm run dev
# Run scans during development
npm run scan https://github.com/user/repo
# Type checking
npm run type-check
Docker Development 🐳
# Build Docker image
docker compose build
# Test the image
docker run --rm mcp-watch scan https://github.com/user/repo
# Test Docker Compose
docker compose run --rm mcp-watch scan --help
Adding New Scanners
Create a new scanner in scanner/scanners/
Extend AbstractScanner
Implement the scan() method
Add to MCPScanner.ts
Example:
import { AbstractScanner } from "../BaseScanner";
import { Vulnerability } from "../../types/Vulnerability";
export class MyScanner extends AbstractScanner {
async scan(projectPath: string): Promise<Vulnerability[]> {
console.log("🔍 Scanning for my vulnerability type...");
const vulnerabilities: Vulnerability[] = [];
// Your scanning logic here
return vulnerabilities;
}
}
Security Research
This tool is based on security research from leading organizations in AI and cybersecurity, identifying novel attack vectors specific to MCP environments including:
Parameter injection attacks that extract sensitive AI context
# Clone and setup
git clone https://github.com/kapilduraphe/mcp-watch.git
cd mcp-watch
# Build Docker image
docker compose build
# Test the image
docker run --rm mcp-watch --help
# Run a scan
docker compose run --rm mcp-watch scan https://github.com/user/repo
Create an issue for bug reports or feature requests
Check existing issues before creating new ones
Include scan output and repository details when reporting issues
Docker Support 🐳
Documentation: See DOCKER.md for detailed Docker usage
Issues: Include Docker version and Docker Compose version when reporting issues
Testing: Test with both production and development containers
⚠️ Security Notice: This tool identifies potential security issues but should not be the only security measure. Always perform manual security reviews and follow security best practices.
M
MCP Watch
kapilduraphe·139 个星标·
A comprehensive security scanner for Model Context Protocol (MCP) servers that detects vulnerabilities and security issues in your MCP server implementations.
上次检查时间:2026-11-05。 A comprehensive security scanner for Model Context Protocol (MCP) servers that detects vulnerabilities and security issues in your MCP server implementations.