DevLens — Claude Code MCP server: features and setup
DevLens builds a graph of your repository so an agent can locate relevant code, follow calls, and inspect change impact. Use it when working through an unfamiliar codebase.
claude mcp add devlens -- npx -y @devlensio/cliWhat DevLens does
DevLens analyzes a repository and builds a graph of code entities, their links, and summaries. An MCP-connected agent can query for files and symbols relevant to a task, trace calls, and inspect the potential reach of a change. The server also provides per-node security analysis and understands route relationships in Next.js.
Install the CLI, then run devlens analyze . --summarize from your project. This creates the graph and search index. Model setup is needed for AI-generated summaries; structural analysis can run offline without an API key. The repository must be analyzed before the agent can query its graph.
What it helps with
- locate files and symbols for a task
- trace a function's call flow
- inspect the reach of a code change
- check code nodes for security risks
Example prompts for the agent
- Find the files and symbols involved in authorization.
- Trace the calls made by this function.
- Show which parts of the project could be affected by changing this symbol.
How to install DevLens
Platform CLI
claude mcp add devlens -- npx -y @devlensio/cliPlatform CLI
codex mcp add devlens -- npx -y @devlensio/cliConfig file
{
"mcpServers": {
"devlens": {
"command": "npx",
"args": [
"-y",
"@devlensio/cli"
]
}
}
}Config file
{
"servers": {
"devlens": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@devlensio/cli"
]
}
}
}Platform CLI
gemini mcp add devlens npx -y @devlensio/cliStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about DevLens
How do I install DevLens in Claude Code?
Run claude mcp add devlens -- npx -y @devlensio/cli.
What does DevLens do?
It creates a code graph that an MCP-connected agent can query for related files, symbols, and calls. It also supports change-impact checks and per-node security analysis.
Does DevLens need an API key?
Structural analysis works offline without one. Configure a model and API key if you want AI-generated summaries.