Skip to main content
Glama
mcp-dependency-explorer
by kozer

mcp-dependency-explorer

MCP (Model Context Protocol) server that provides intelligent access to your project's installed dependencies - explore documentation and source code directly from node_modules.

Features

  • Documentation Cache: One-time initialization to cache all module documentation (README, docs/) for faster access

  • List Modules: Discover all installed npm packages across your project, including monorepo workspaces

  • Search: Regex-powered search through module source files (.ts, .tsx, .jsx, .d.ts, .css, .md, etc.)

  • Read Files: Read module files with optional line range support

  • TypeScript Symbols: List and inspect functions, classes, interfaces, types, enums, and variables

  • Workspace Support: Automatically detects and scans monorepo structures (pnpm, yarn workspaces)

Related MCP server: Augments MCP Server

Installation

npm install -g @kozer/mcp-dependency-explorer

From Source

git clone https://github.com/kozer/mcp-dependency-explorer.git
cd mcp-dependency-explorer
pnpm install
pnpm build

Usage

As MCP Server

Add to your MCP client configuration:

{
  "mcpServers": {
    "dependency-explorer": {
      "type": "local",
      "command": ["npx", "-y", "@kozer/mcp-dependency-explorer"]
    }
  }
}

Or if installed from source:

{
  "mcpServers": {
    "dependency-explorer": {
      "type": "local",
      "command": ["node", "/path/to/mcp-dependency-explorer/dist/server.js"]
    }
  }
}

Available Tools

1. list_modules

List all installed Node modules from all node_modules directories.

Parameters:

  • root (optional): Project root directory (defaults to cwd)

  • filter (optional): Filter by module name substring

Example:

// List all modules
list_modules();

// Filter by name
list_modules({ filter: "react" });

2. search

Search for patterns in module files with code snippets.

Parameters:

  • module: Module name (exact or substring match)

  • pattern: Regex pattern to search

  • flags (optional): Regex flags (e.g., 'i' for case-insensitive)

  • context (optional): Lines of context around match (default: 5)

  • limit (optional): Max results (default: 20, max: 100)

  • root (optional): Project root directory

Example:

// Search for useState in React
search({
  module: "react",
  pattern: "function useState",
  flags: "i",
  context: 10,
});

3. read_file

Read a file from a module with optional line range.

Parameters:

  • module: Module name

  • file: File path relative to module root

  • startLine (optional): Start line (1-based)

  • count (optional): Number of lines to read (max: 2000)

  • root (optional): Project root directory

Example:

read_file({
  module: "fastify",
  file: "fastify.d.ts",
  startLine: 100,
  count: 50,
});

4. list_symbols

List TypeScript symbols (functions, classes, interfaces, etc.) from a module.

Parameters:

  • module: Module name

  • kind (optional): Filter by symbol type (function, class, interface, type, enum, namespace, variable)

  • name (optional): Filter by symbol name (substring)

  • limit (optional): Max results (default: 100, max: 500)

  • root (optional): Project root directory

Example:

// List all symbols
list_symbols({ module: "fastify" });

// List only interfaces
list_symbols({ module: "fastify", kind: "interface" });

// Search for specific symbol name
list_symbols({ module: "fastify", name: "Request" });

5. get_symbol

Get the full code for a specific symbol with context.

Parameters:

  • module: Module name

  • file: File path relative to module root

  • name: Symbol name

  • padding (optional): Lines of padding around symbol (default: 10)

  • root (optional): Project root directory

Example:

get_symbol({
  module: "fastify",
  file: "types/instance.d.ts",
  name: "FastifyInstance",
  padding: 15,
});

6. list_cached_docs

List all cached documentation files for a module.

Parameters:

  • module: Module name

  • root (optional): Project root directory

Response includes:

  • cacheDir: Full path to cache directory

  • moduleHash: Base64-encoded hash used as folder name

  • totalDocs: Number of cached documentation files

  • docs: Array of cached file paths

Example:

list_cached_docs({
  module: "react",
});

How It Works

  1. Project Detection: Automatically finds your project root by looking for package.json and node_modules

  2. Documentation Caching: On server initialization, caches all module documentation (README, CHANGELOG, LICENSE, docs/) to /tmp/mcp-node-modules-docs/ for faster access

  3. Workspace Scanning: Detects monorepos (pnpm-workspace.yaml, yarn workspaces) and scans all workspace packages

  4. TypeScript Analysis: Uses TypeScript compiler API to extract symbols with accurate type information

  5. Intelligent Caching: Caches symbol indexes for fast repeated queries

Supported File Types

  • TypeScript: .ts, .tsx, .d.ts

  • JavaScript: .jsx

  • Styles: .css, .scss, .sass, .less

  • Documentation: .md, README.md

Development

# Install dependencies
pnpm install

# Build
pnpm build

# Run server
pnpm start

Requirements

  • Node.js 18+

  • TypeScript 5+

  • Project with node_modules directory

License

MIT

Available Tools

5 tools
get_symbolGet symbol codeC

Get the full code for a specific symbol

Inputs: file (required), name (required), module (required), root, +1 more.

list_modulesList modulesB

List all installed Node modules from all node_modules directories (including workspace packages)

Inputs: root, filter.

list_symbolsList TypeScript symbolsC

List TypeScript symbols (functions, classes, interfaces, etc.) from a module

Inputs: module (required), kind, name, root, +1 more.

read_fileRead module fileB

Read a file from a module with optional line range

Inputs: file (required), module (required), root, count, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 5 tools

    Disambiguation4/5

    list_modules, list_symbols, search, and read_file each target a clearly distinct operation. The only mild overlap is get_symbol vs. list_symbols + read_file, since a symbol's code could be fetched either way, but the descriptions make the intended split (discovery vs. extraction) reasonably clear.

    Naming Consistency4/5

    Four of five names follow a clean verb_noun snake_case pattern (list_modules, list_symbols, get_symbol, read_file). The bare verb 'search' is the lone deviation, though it remains unambiguous in context.

    Tool Count4/5

    Five tools is a tight, focused set that matches the narrow exploration workflow of browsing modules, searching, and reading symbols. It is slightly thin—no module metadata or cross-module lookup—but nothing feels redundant.

    Completeness3/5

    The surface covers listing, searching, file reading, and symbol extraction well, but despite the 'dependency explorer' name there is no tool to inspect the dependency graph, a module's package.json/version, or which module exports a given symbol. These are notable gaps for dependency exploration, though agents can partially work around them with list_modules and search.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables Claude Code and other MCP clients to retrieve real-time TypeScript types, prose documentation, and code examples for any npm package, with intent-aware formatting, BM25 documentation search, version migration guides, error diagnosis, and dependency scanning. Works across the entire npm ecosystem without curation while providing enhanced results for popular frameworks.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables coding assistants to pull on-demand documentation for any npm package — TypeScript signatures, prose docs, and code examples formatted to match the user's intent (how-to, reference, or migration). It also supports version comparison with real changelog-backed breaking changes, cross-version migration guides, error diagnosis, side-by-side package comparison, and project dependency scanning for outdated, deprecated, or insecure packages.
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables Claude Code and other compatible clients to retrieve real-time, context-aware documentation, TypeScript types, examples, migration guides, error diagnoses, package comparisons, and dependency scans for any npm package.
      MIT