home / mcp / dependency mcp server
A Model Context Protocol (MCP) server for analyzing code dependencies
Configuration
View docs{
"mcpServers": {
"mkearl-dependency-mcp": {
"command": "node",
"args": [
"path/to/dependency-mcp/dist/index.js"
],
"env": {
"CACHE_DIR": "path/to/dependency-mcp/.dependency-cache",
"CACHE_TTL": "3600000",
"MAX_LINES_TO_READ": "1000"
}
}
}
}DependencyMCP Server analyzes codebases to generate dependency graphs and architectural insights across multiple languages, helping you understand code structure, dependencies, and architectural patterns at a glance.
You interact with DependencyMCP Server through an MCP client to run analysis tasks, generate graphs, inspect file metadata, and evaluate architectural score against rules. Use the available tools to explore a project’s dependencies, export formats, and architectural compliance.
Prerequisites: ensure you have Node.js and npm installed on your system.
# 1) Clone the repository
git clone <repository-url>
# 2) Change into the project directory
cd dependency-mcp
# 3) Install dependencies
npm install
# 4) Build the project
npm run buildConfigure and start the MCP server as a local process. You can customize environment variables to control file reading, caching, and TTL for the dependency cache.
# Optional: set environment variables for the running server
export MAX_LINES_TO_READ=1000
export CACHE_DIR=path/to/dependency-mcp/.dependency-cache
export CACHE_TTL=3600000
# Start the local DependencyMCP server (stdio config)
node path/to/dependency-mcp/dist/index.jsYou can register the DependencyMCP server in your MCP settings to enable clients to communicate with it. The following configuration shows the stdio command and environment values used to run the server.
{
"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"
}
}
}
}Analyzes dependencies in a codebase and generates a dependency graph.
Retrieves the dependency graph for a codebase in JSON or DOT format.
Fetches detailed metadata about a specific file, including imports and exports.
Scores the codebase against defined architectural rules and patterns.