DependencyMCP Server
Analyzes JavaScript codebases to generate dependency graphs, extract file metadata, and evaluate architectural patterns and dependencies.
Analyzes Python codebases to generate dependency graphs, extract file metadata, and evaluate architectural patterns and dependencies.
Analyzes TypeScript codebases to generate dependency graphs, extract imports/exports, and evaluate code against architectural rules and patterns.
Uses Zod for schema validation as part of the dependency analysis process when evaluating codebases.
Click on "Deploy 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., "@DependencyMCP Server analyze dependencies in my TypeScript project and show me the architectural violations"
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.
DependencyMCP Server
A Model Context Protocol (MCP) server that analyzes codebases to generate dependency graphs and architectural insights. This server helps understand code structure, dependencies, and architectural patterns across multiple programming languages.
Features
Multi-Language Support: Analyzes dependencies in TypeScript, JavaScript, C#, Python, and more
Dependency Graph Generation: Creates detailed dependency graphs in JSON or DOT format
Architectural Analysis: Infers architectural layers and validates against rules
File Metadata: Extracts imports, exports, and other metadata from source files
Scoring System: Evaluates codebase against architectural rules and patterns
Related MCP server: mcp-codebase-oracle
Installation
Clone the repository
Install dependencies:
npm installBuild the project:
npm run buildConfiguration
Add to your MCP settings file (usually located at ~/.config/cline/mcp_settings.json or equivalent):
json { mcpServers: { \DependencyMCP: { \command: \node, \args: [\path/to/dependency-mcp/dist/index.js], \env: { \MAX_LINES_TO_READ: \1000, \CACHE_DIR: \path/to/dependency-mcp/.dependency-cache, \CACHE_TTL: \3600000 } } }Environment Variables:
MAX_LINES_TO_READ: Maximum number of lines to read from each file (default: 1000)
CACHE_DIR: Directory to store dependency cache files (default: .dependency-cache)
CACHE_TTL: Cache time-to-live in milliseconds (default: 1 hour = 3600000)
Available Tools
analyze_dependencies
Analyzes dependencies in a codebase and generates a dependency graph.
const result = await client.callTool("DependencyMCP", "analyze_dependencies", {
path: "/path/to/project",
excludePatterns: ["node_modules", "dist"], // optional
maxDepth: 10, // optional
fileTypes: [".ts", ".js", ".cs"] // optional
});get_dependency_graph
Gets the dependency graph for a codebase in JSON or DOT format.
const result = await client.callTool("DependencyMCP", "get_dependency_graph", {
path: "/path/to/project",
format: "dot" // or "json" (default)
});get_file_metadata
Gets detailed metadata about a specific file.
const result = await client.callTool("DependencyMCP", "get_file_metadata", {
path: "/path/to/file.ts"
});get_architectural_score
Scores the codebase against architectural rules and patterns.
const result = await client.callTool("DependencyMCP", "get_architectural_score", {
path: "/path/to/project",
rules: [
{
pattern: "src/domain/**/*",
allowed: ["src/domain/**/*"],
forbidden: ["src/infrastructure/**/*"]
}
]
});Example Output
Dependency Graph (JSON)
{
"src/index.ts": {
"path": "src/index.ts",
"imports": ["./utils", "./services/parser"],
"exports": ["analyze", "generateGraph"],
"namespaces": [],
"architecturalLayer": "Infrastructure",
"dependencies": ["src/utils.ts", "src/services/parser.ts"],
"dependents": []
}
}Architectural Score
{
"score": 85,
"violations": [
"src/domain/user.ts -> src/infrastructure/database.ts violates architectural rules"
],
"details": "Score starts at 100 and deducts 5 points per violation"
}Development
The server is built with TypeScript and uses:
Zod for schema validation
diff for file comparison
minimatch for glob pattern matching
Project Structure
dependency-mcp/
├── src/
│ └── index.mts # Main server implementation
├── package.json
├── tsconfig.json
└── README.mdAdding Support for New Languages
To add support for a new programming language:
Add file extensions to the default
fileTypesarrayImplement language-specific regex patterns in
parseFileImportsandparseFileExportsAdd any language-specific architectural patterns to
inferArchitecturalLayer
License
MIT
Available Tools
6 toolscheck_version_existsA
Check if a specific version exists. Use for dependency validation, CI/CD checks, or ensuring version compatibility. Returns whether the version exists with package details and timestamp.
Inputs: package_name (required), version (required), registry (required).
check_versions_existA
Check if specific versions exist for multiple packages. Use for bulk dependency validation, CI/CD pipeline checks, or ensuring multiple package version compatibility. Processes up to 100 packages in parallel with individual error handling.
Inputs: packages (required), registry (required).
get_latest_versionA
Get the latest version of a package. Use for dependency updates, version checks, or when you need the most recent stable release. Returns package name, latest version, description, and timestamp.
Inputs: package_name (required), registry (required).
get_latest_versionsA
Get latest versions for multiple packages simultaneously. Use when checking 3+ dependencies - processes up to 100 packages in parallel. Returns individual results for each package with error isolation. Much faster than individual calls for multiple packages.
Inputs: packages (required), registry (required).
get_package_infoA
Get detailed package information including all versions. Use for dependency audits, security reviews, or when you need comprehensive package metadata. Returns versions list, homepage, repository, and full package details.
Inputs: package_name (required), registry (required).
get_packages_infoA
Get comprehensive package details for multiple packages. Use for dependency audits, security reviews, or bulk package analysis. Processes up to 100 packages in parallel. Returns detailed info for each package with error isolation - failed packages don't break the batch.
Inputs: packages (required), registry (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose with no overlap: single vs. multi-package operations, version existence checks vs. latest version retrieval vs. detailed package info. The descriptions reinforce these distinctions, making misselection unlikely.
Tool names follow a consistent verb_noun pattern throughout (e.g., check_version_exists, get_latest_version). All use snake_case and maintain parallel naming for singular and plural variants, making the set predictable and readable.
Six tools are well-scoped for a dependency management server, covering core operations like validation, updates, and audits. Each tool earns its place by addressing distinct use cases without redundancy or bloat.
The toolset provides strong coverage for dependency checking, version retrieval, and package info, with efficient bulk operations. A minor gap exists in update or install actions, but agents can work around this for most dependency management workflows.
Maintenance
Related MCP Connectors
AI-powered codebase analysis — call graphs, security, dead code, complexity. 150+ tools.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
AI Agent with Architectural Memory. Impact analysis (free), tests and code from the graph (pro).
Enterprise code intelligence for M&A, security audits, and tech debt. Hosted server with 200k free.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides comprehensive codebase analysis including project structure evaluation, cross-language duplicate detection, microservices validation, and configuration optimization with AI-powered pattern learning that generates actionable improvement reports.MIT
- AlicenseAqualityDmaintenanceAnalyzes software projects to extract architecture, build dependency graphs, and predict the impact of code changes.242MIT
- AlicenseNot gradedqualityDmaintenanceProvides intelligent codebase analysis, dependency scanning, architecture detection, security vulnerability scanning, and automatic documentation generation for modern development teams.17 npmMIT
- AlicenseNot gradedqualityDmaintenanceAnalyzes GitHub and local repositories to automatically generate visual architectural diagrams such as dependency graphs, class diagrams, and data flow diagrams.2MIT