What it does
Knip is a static analysis tool that identifies unused dependencies, exports, and files in JavaScript and TypeScript projects. When invoked through this MCP server, Claude can directly analyze your codebase to surface dead code—packages you can remove, exports no one imports, and files with no references. The tool reads your project's dependency graph and filesystem to build a complete picture of what's actually in use.
Who it's for
Frontend and backend developers performing code cleanup, refactoring, or dependency audits. Teams working on tech debt reduction, monorepo maintenance, or any codebase where dead code has accumulated over time and dependency size matters.
Common use cases
- Audit npm dependencies and identify ones safe to remove
- Find dead exports that are no longer imported anywhere in the codebase
- Discover unreachable files or entire modules that serve no purpose
- Validate a large refactoring actually removed all dead code
- Clean up monorepo workspaces for reduced build and install time
Setup pitfalls
- Requires read and write filesystem access to analyze your project structure
- Node.js and npm required; Knip inspects
package.jsonand may query npm registry for dependency metadata - Monorepo projects may need custom configuration to exclude build outputs and resolve internal dependencies correctly
- False positives possible for dynamically imported code or string-based requires outside Knip's static analysis scope