DepShield MCP
Integrates with the npm Registry to verify package existence, check for CVEs, audit package.json manifests, assess package health (weekly downloads, maintenance status, deprecation, license), and find safe alternative versions of npm packages.
Integrates with PyPI to check Python package existence, scan for vulnerabilities in requirements.txt files, and identify safe versions within the Python ecosystem.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DepShield MCPcheck if lodash is safe to install"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π€ Why
AI coding agents pull packages from stale training data. They install outdated versions with known CVEs. They hallucinate package names that don't exist, opening the door to typosquatting attacks. They default to deprecated libraries when better alternatives exist.
There's no checkpoint between "agent decides to use a package" and "package lands in your project." DepShield is that checkpoint.
β‘ What It Does
Seven security tools exposed over the Model Context Protocol:
Tool | What it does |
| Pre-install gate β verifies a package exists on the registry and has no known CVEs. Your agent calls this before every install. |
| Scans an entire |
| Finds the newest version of a package with zero known vulnerabilities. |
| Deep dive into a specific CVE/GHSA β full description, affected versions, fix info, references. |
| Package health report card: weekly downloads, last publish date, maintainer count, license, deprecation status. Scored 0β100. |
| Finds better packages when one is vulnerable, deprecated, or abandoned. |
| Scans a package's transitive dependency tree for vulnerabilities, typosquats, and suspicious patterns. |
Plus a depshield://status resource and a security_review prompt template for guided full-project audits.
Zero API keys required. DepShield uses free, open APIs: npm Registry, OSV.dev (Google's open vulnerability database), and PyPI.
π Quick Start
Option 1: npx (no install)
Add to your IDE's MCP configuration and you're done. No global install needed.
Option 2: Clone and build
git clone https://github.com/devanshkaria88/depshield-mcp.git
cd depshield-mcp
npm install
npm run buildπ IDE Setup
Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project-level):
{
"mcpServers": {
"depshield": {
"command": "npx",
"args": ["-y", "depshield-mcp"]
}
}
}Or if you cloned the repo locally:
{
"mcpServers": {
"depshield": {
"command": "node",
"args": ["/absolute/path/to/depshield-mcp/dist/index.js"]
}
}
}Optionally, copy .cursor/rules/dep-shield.mdc into your project's .cursor/rules/ directory. This rule forces the Cursor agent to call check_dependency before every package install.
claude mcp add depshield -- npx depshield-mcpOr from a cloned repo:
claude mcp add depshield -- node /absolute/path/to/depshield-mcp/dist/index.jsAdd to your Windsurf MCP configuration:
{
"mcpServers": {
"depshield": {
"command": "npx",
"args": ["-y", "depshield-mcp"]
}
}
}DepShield uses stdio transport. Any tool that supports MCP over stdio can use it:
npx depshield-mcpπ‘ Usage Examples
Once connected, your AI agent has access to all seven tools. Try these prompts:
Pre-install check (automatic with .mdc rule)
"Add lodash for deep cloning"
Agent calls check_dependency β finds CVE β auto-upgrades to safe version
Block hallucinated packages
"Install react-super-utils-pro for state management"
Agent calls check_dependency β package doesn't exist β blocks install, suggests alternatives
Full project audit
"Run a security audit on this project's dependencies"
Agent calls audit_project on package.json β returns full vulnerability report
Package health check
"Is this package well maintained?"
Agent calls check_npm_health β returns health score (0β100) with breakdown
Supply chain deep scan
"Deep scan express for transitive vulnerabilities"
Agent calls deep_scan β scans dependency tree, flags suspicious patterns
Advisory deep dive
"Tell me more about GHSA-jf85-cpcp-j695"
Agent calls get_advisory_detail β returns full CVE details, remediation info
π Tools Reference
Parameter | Type | Required | Default | Description |
| string | yes | β | Package name (e.g., |
| string | no | latest | Specific version to check |
|
| no |
| Package ecosystem |
Returns: β
SAFE, β οΈ VULNERABLE (with fix version), π« BLOCKED (doesn't exist), or β οΈ CANNOT VERIFY (registry unreachable).
Parameter | Type | Required | Default | Description |
| string | yes | β | Path to |
| boolean | no |
| Include devDependencies in scan |
Returns: Full audit report with summary stats, per-dependency vulnerability breakdown, severity counts, and risk verdict.
Parameter | Type | Required | Default | Description |
| string | yes | β | Package name |
|
| no |
| Package ecosystem |
Returns: The newest stable version with zero known vulnerabilities, with comparison of all checked versions.
Parameter | Type | Required | Default | Description |
| string | yes | β | Vulnerability ID (e.g., |
Returns: Full advisory with summary, severity, CVSS score, affected versions, fix versions, and reference links.
Parameter | Type | Required | Default | Description |
| string | yes | β | npm package name |
Returns: Health report card (0β100 score) based on: publish recency, weekly downloads, license, repository presence, deprecation status, and maintainer count.
Parameter | Type | Required | Default | Description |
| string | yes | β | Package to find alternatives for |
| string | no | β | Why an alternative is needed |
Returns: Top 3 alternative packages with downloads, npm score, and publish date.
Parameter | Type | Required | Default | Description |
| string | yes | β | Package to deep scan |
| string | no | latest | Specific version to scan |
|
| no |
| 1 = direct deps, 2 = deps of deps |
Returns: Dependency tree with vulnerability flags, suspicious pattern detection (newly added deps, nonexistent packages, low-download typosquat candidates), and risk verdict.
π Cursor Rule (Optional)
The .cursor/rules/dep-shield.mdc file included in this repo forces the Cursor agent to automatically call check_dependency before every package install. Copy it to your project:
mkdir -p .cursor/rules
cp node_modules/depshield-mcp/.cursor/rules/dep-shield.mdc .cursor/rules/This turns DepShield from a tool the agent can use into a gate the agent must pass through.
π§ͺ Testing
MCP Inspector (interactive UI for testing tools):
npm run inspectOr:
npx @modelcontextprotocol/inspector node dist/index.jsRaw stdio (quick verification):
printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}\n{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"check_dependency","arguments":{"name":"lodash","version":"4.17.20"}}}\n' | node dist/index.js 2>/dev/nullπ APIs Used
All free, no API keys required:
API | What it provides |
Package existence, versions, metadata, search | |
Weekly download counts | |
Open source vulnerability database (Google) | |
Python package metadata |
π Project Structure
depshield-mcp/
βββ src/
β βββ index.ts # MCP server entry β tool/resource/prompt registration
β βββ cache.ts # In-memory TTL cache (5 min)
β βββ utils.ts # Severity parsing, version sorting, fetch helpers
β βββ apis/
β β βββ npm-registry.ts # npm registry, search, downloads
β β βββ osv.ts # OSV.dev vulnerability queries
β β βββ pypi-registry.ts # PyPI JSON API
β βββ tools/
β βββ check-dependency.ts # Pre-install gate
β βββ audit-project.ts # Full manifest audit
β βββ find-safe-version.ts # Safe version finder
β βββ get-advisory-detail.ts # CVE/GHSA deep dive
β βββ check-npm-health.ts # Package health scoring
β βββ suggest-alternative.ts # Alternative package finder
β βββ deep-scan.ts # Transitive dependency scanner
βββ .cursor/rules/
β βββ dep-shield.mdc # Cursor agent rule (alwaysApply)
βββ package.json
βββ tsconfig.json
βββ LICENSE
βββ README.mdπ Requirements
Node.js 18 or later (uses native
fetch)An MCP-compatible AI coding tool
π€ Contributing
Contributions are welcome. Please open an issue first to discuss what you'd like to change.
Areas where help would be appreciated:
Additional ecosystem support (Cargo, Go modules, Maven)
Improved CVSS vector string parsing
Integration tests with mocked API responses
GitHub Actions CI pipeline
π License
MIT β see LICENSE for details.
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/devanshkaria88/depshield-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server