New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@pkgdiet/mcp

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pkgdiet/mcp

Official MCP server for PkgDiet — gives AI agents ALLOW/WARN/BLOCK verdicts for npm packages before installation.

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

@pkgdiet/mcp

Local Model Context Protocol (MCP) server for PkgDiet dependency-policy checks.

Start a local stdio MCP server:

npx -y pkgdiet@2.0.0 mcp

Exposes four read-only tools that compatible AI clients can call before recommending or installing npm packages. Does not install packages, write files, or modify the workspace.

npm version npm downloads License: MIT Node.js Glama MCP Server

Requirements

  • Node.js 20 or later
  • An MCP-compatible client configured for stdio transport

Tools

All four tools are read-only. None install packages, write files, or modify the workspace.

check_dependency

Evaluate one npm package against the active local dependency policy.

This is a read-only operation. It may query public npm metadata when network checks are enabled. The result is advisory — call this before recommending or installing a package.

Input:

ParameterTypeRequiredDescription
packageNamestringYesExact npm package name
environmentstringNo"dev" | "prod" | "ci" | "staging" | "test". Default: "dev"

Output fields:

FieldTypeDescription
verdictstring"ALLOW" | "WARN" | "BLOCK"
healthScorenumber0–100 composite score
reasonsstring[]Explanation for the verdict
efficiencyFlagbooleanTrue if a lighter alternative is recommended
costEstimate.addedSizeMBnumberEstimated unpacked size in MB
costEstimate.monthlyCiCost100BuildsnumberEstimated CI cost (USD/month at 100 builds)
alternativesobject[]Curated replacement candidates
certifiedbooleanWhether configured certification conditions were met — not a universal safety guarantee
hasProvenancebooleanWhether npm metadata included a provenance signal — not a complete supply-chain attestation

Do not treat certified or hasProvenance alone as a pass/fail security verdict.

check_dependencies

Evaluate multiple npm package names with bounded concurrency.

  • Maximum: 50 packages per call.
  • Concurrency: 10 simultaneous checks.
  • Invalid names are reported as validationWarnings. Valid names continue to be evaluated.
  • This is a read-only operation.

suggest_alternative

Return curated replacement candidates for a package.

Candidates are advisory recommendations, not installation instructions. Call check_dependency for the selected candidate before recommending or installing it.

get_policy

Return the effective local dependency policy and its validation results for the current workspace.

This operation does not modify policy files.

Before recommending or installing any npm package:

1. call check_dependency(packageName)
   → ALLOW:  proceed
   → WARN:   explain reasons; optionally call suggest_alternative
   → BLOCK:  do not recommend without explicit user direction;
             call suggest_alternative

2. For any chosen alternative:
   call check_dependency(alternativeName)  ← re-check before installation

3. Let CI enforce the final policy gate.
   MCP results are advisory; the CI gate is the enforcement backstop.

Note: MCP tools expose results to compatible clients. Clients still decide whether to call the tools and whether to follow the results. Listing this server in an MCP registry does not automatically protect any project.

Rate limits

LimitValueScope
Tool calls per minute30Per stdio process
Batch size50 packages maxPer check_dependencies call
Tool timeout15 secondsPer individual tool call
Concurrent checks10Within a batch

Multiple independent stdio processes each have their own limits.

Error codes:

CodeMeaning
BATCH_LIMIT_EXCEEDEDMore than 50 packages in one check_dependencies call
RATE_LIMIT_EXCEEDED30 calls/minute per-process limit reached
TOOL_TIMEOUT15-second wall-clock timeout exceeded
INVALID_INPUTPackage name fails validation

MCP client configuration

{
  "mcpServers": {
    "pkgdiet": {
      "command": "npx",
      "args": ["-y", "pkgdiet@2.0.0", "mcp"]
    }
  }
}

Per-client config file locations:

ClientConfig file
Cursor.cursor/mcp.json
Claude Desktop (macOS)~/Library/Application Support/Claude/claude_desktop_config.json
Claude Desktop (Windows)%APPDATA%\Claude\claude_desktop_config.json
Clinecline_mcp_settings.json
GitHub Copilot.github/mcp.json
Claude Codeclaude mcp add pkgdiet -- npx -y pkgdiet@2.0.0 mcp
Antigravity.gemini/antigravity/mcp/pkgdiet/mcp.json
WindsurfManual — see docs/INTEGRATIONS.md

Or use the setup command (previews and confirms before writing):

npx pkgdiet@2.0.0 agent-setup --detect

Privacy and network behavior

When network checks are enabled, PkgDiet sends the requested package name to registry.npmjs.org and api.npmjs.org. No source code, file contents, or private project data is transmitted. No PkgDiet account is required.

License

MIT. See LICENSE.

Keywords

mcp

FAQs

Package last updated on 21 Sep 2026

Related posts