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

@deplens/mcp

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deplens/mcp

Model Context Protocol server for DepLens — inspect installed npm packages (exports, types, docs, examples) and diff versions.

latest
Source
npmnpm
Version
1.0.9
Version published
Maintainers
1
Created
Source

@deplens/mcp

Model Context Protocol (MCP) server for DepLens. Exposes six package-analysis tools over stdio transport:

  • deplens_inspect — package exports, types (.d.ts), README docs/sections, examples, JSDoc, source analysis
  • deplens_diff — semver diff between two versions (uses CHANGELOG.md when available)
  • deplens_doctor — package resolution and runtime/type diagnostics
  • deplens_project_diff — project dependency changes between lockfiles or Git refs
  • deplens_check — baseline and policy enforcement for dependency upgrades
  • deplens_versions — latest and recent npm package versions

Built on the modern McpServer / registerTool API of the TypeScript SDK (≥ 1.18) with Zod input validation, structuredContent outputs, and proper tool annotations.

Run

npx --yes @deplens/mcp

If your MCP host requires command + args:

{ "command": "npx", "args": ["--yes", "@deplens/mcp"] }

Or install once and call the binary:

npm i -g @deplens/mcp
{ "command": "deplens-mcp" }

Or point directly to the local bin:

{ "command": "node", "args": ["./node_modules/@deplens/mcp/bin/deplens-mcp.js"] }

This starts an MCP server over stdio.

Tools

All tools always populate structuredContent in addition to the text channel. Analysis tools are marked non-read-only because remote inspection writes a local cache and explicit runtime inspection executes package entrypoints.

deplens_inspect

Inspect an installed (or remotely downloaded) npm package.

ParamTypeDescription
targetstring (required)Package name or import path (e.g. react, next/server, @scope/pkg)
subpathstringOptional subpath appended to target
filterstringCase-insensitive substring filter, or /regex/
kind('function'|'class'|'object'|'constant'|'interface'|'type')[]Restrict by export kind
showTypesbooleanParse .d.ts and include function signatures, interfaces, classes, types, enums
includeDocsbooleanInclude README preview
listSectionsbooleanList README section headers
docsSectionsstring[]Extract specific README sections by name (partial match)
includeExamplesbooleanInclude code from README, examples/, and @example JSDoc tags
searchstringSemantic search over export names (token matching + JSDoc)
remotebooleanDownload into local cache instead of resolving from rootDir
remoteVersionstringVersion to download when remote=true (default: "latest")
runtimebooleanExplicitly import/require the package entrypoint. Defaults off
format'text'|'json'|'object'Output format for the text channel. structuredContent is always populated.
maxExportsnumber (1–10000)Max exports to include (default: 100)
maxSymbolsnumber (1–5000)Max canonical symbols in structured output (default: 250)
maxPropsnumber (1–1000)Max props per object when depth>0 (default: 10)
maxExamplesnumber (1–100)Max examples (default: 10)
depthnumber (0–5)Object inspection depth (default: 1)
resolveFromstringBase directory for module resolution. Defaults to rootDir.
rootDirstringWorking directory (default: $DEPLENS_ROOT or process.cwd())
jsdoc'off'|'compact'|'full'JSDoc verbosity mode
jsdocOutput'off'|'section'|'inline'|'only'Where to render JSDoc
jsdocQueryobjectFine-grained JSDoc extraction, including maxParams and paramCursor
analyzeSourcebooleanAnalyze JS/TS/Python/Java source for implementation details + complexity
sourceMaxFilesnumber (1–500)Max source files to analyze (default: 5)
sourceIncludeBodybooleanInclude function body snippets
language'javascript'|'typescript'|'python'|'java'|'rust'|'go'Force language detection
detail'compact'|'full'Versioned structured output projection
cursorstringResume symbol pagination
conditionsstring[]Export conditions in priority order
cacheDirstringOverride the shared version cache
timeoutMsnumberBound registry/download work

Example call:

{
  "name": "deplens_inspect",
  "arguments": {
    "target": "ai",
    "showTypes": true,
    "filter": "generate",
    "resolveFrom": ".",
    "jsdocOutput": "section",
    "jsdocQuery": {
      "symbols": "generateText",
      "sections": ["summary", "params", "returns"],
      "tags": { "include": ["param", "returns"] },
      "mode": "compact",
      "maxParams": 5
    }
  }
}

deplens_diff

Compare two versions of an npm package.

ParamTypeDescription
packagestring (required)Package name to compare
fromstringSource version: a concrete semver, "installed" (default), or "latest"
tostringTarget version: a concrete semver, "latest" (default), or "installed"
filterstringFilter exports by name (substring or /regex/)
format'text'|'json'|'object'Output format for the text channel
includeSourcebooleanInclude source code complexity comparison
runtimebooleanImport package entrypoints while diffing. Defaults off for safer static comparison
preferCdnbooleanPrefer lightweight CDN downloads instead of full npm installs
offlinebooleanUse only versions already present in the local DepLens cache
includeChangelogbooleanParse CHANGELOG.md entries (default: true)
verbosebooleanShow detailed per-symbol changes
rootDirstringWorking directory for resolution of from="installed" (default: $DEPLENS_ROOT or cwd())
conditionsstring[]Export conditions in priority order
semanticbooleanTypeScript assignability validation (default: true)
maxChangesnumberChanges per page
cursorstringResume change pagination

Project tools

deplens_project_diff accepts from, to, rootDir, lockfile, analyze, includeTransitive, detail, maxChangesPerPackage, packageCursors, packageOnly, strictPackageOnly, projectSnapshot, conditions, and timeout/cache controls. from and to can be Git refs, lockfile paths, or working. API enrichment defaults to detail: "compact", retaining package, summary, changes, semantic compatibility, and per-package pagination. The default page size is 10; use packageCursors to continue selected packages, packageOnly to omit unrelated work, and projectSnapshot to reuse fingerprinted compact analysis. Use strictPackageOnly when an unmatched package filter should mark the MCP result as an error. The result exposes detailLevel; use detail: "full" for the rich per-package diff object.

deplens_check accepts a baseline path plus optional config and failOn. It returns a structured policy result and marks the MCP result as an error when policy fails. Format sarif is available for code-scanning integrations.

deplens_doctor mirrors the CLI Doctor report. deplens_versions is read-only and returns a bounded list of published versions.

Example call:

{
  "name": "deplens_diff",
  "arguments": { "package": "zod", "from": "3.22.0", "to": "3.23.0" }
}

Environment

VariableEffect
DEPLENS_ROOTDefault rootDir if a tool call omits it.
DEPLENS_DEBUGWhen set to "true", emits debug logs to stderr (never stdout).

Requirements

  • Node.js ≥ 22

Development

npm run start            # run the MCP server
npm run inspector        # launch the MCP Inspector against this server

Breaking changes in 0.2.0

  • Tool names: deplens.inspectdeplens_inspect, deplens.diffdeplens_diff. Dots are not allowed by the MCP tool-name grammar; the new snake_case names match the spec and align with the rest of the MCP ecosystem.
  • Migration: rename calls in your MCP host config. The input/output schemas are unchanged.

License

MIT

Keywords

mcp

FAQs

Package last updated on 12 Jul 2026

Related posts