Enables analysis and refactoring of Angular projects, providing component analysis, dependency mapping, safe refactoring with breaking change detection, and project structure validation.
Detects deprecated CSS classes and analyzes CSS usage in Angular components, supporting migration planning and refactoring safety.
Integrates with ESLint to lint Angular files with automatic configuration discovery, supporting code quality analysis across Angular projects.
Runs on Node.js and analyzes Node.js-based Angular projects, providing project dependency analysis and validation.
Retrieves component documentation from Storybook docs, supporting component analysis and documentation access for Angular components.
Angular Toolkit MCP
A Model Context Protocol (MCP) server that provides Angular project analysis and refactoring capabilities. This server enables LLMs to analyze Angular projects for component usage patterns, dependency analysis, code quality issues, and provides automated refactoring assistance.
Key Features
- Component Analysis: Detect deprecated CSS classes and component usage violations
- Safe Refactoring: Generate contracts for safe component refactoring with breaking change detection
- Dependency Mapping: Map component dependencies across modules, templates, and styles
- ESLint Integration: Lint Angular files with automatic ESLint configuration discovery
- Project Analysis: Analyze buildable/publishable libraries and validate import paths
- Component Documentation: Retrieve component data and documentation
Use Cases
- Angular project migration and refactoring
- Component usage analysis and dependency mapping
- Deprecated CSS class detection and reporting
- Component contract generation for safe refactoring
- Breaking change detection during component updates
- Code quality analysis and improvement
Configuration
Prerequisites
- Node.js (version 18 or higher)
Installation & Setup
- Clone the repository
- Build the MCP
- Locate the built serverAfter building, the server will be available at
packages/angular-mcp/dist/main.js
MCP Configuration
Add the server to your MCP client configuration (e.g., Claude Desktop, Cursor, Copilot, Windsurf or other MCP-compatible clients):
For Cursor (.cursor/mcp.json
or MCP settings):
Open the project you working with and register the mcp with next parameters:
Configuration Parameters
Required Parameters
Parameter | Type | Description | Example |
---|---|---|---|
workspaceRoot | Absolute path | Root directory of your Angular workspace | /Users/dev/my-angular-app |
ds.storybookDocsRoot | Relative path | Root directory containing Storybook documentation | storybook/docs |
ds.deprecatedCssClassesPath | Relative path | JavaScript file mapping deprecated CSS classes | design-system/component-options.js |
ds.uiRoot | Relative path | Directory containing UI components | packages/ui |
Deprecated CSS Classes File Format
The component-options.js
file should export an array of component configurations:
Example Project Structure
Troubleshooting
- Server not starting: Ensure all paths are correct and the server is built
- Permission errors: Check that the Node.js process has read access to all specified directories
- Component not found: Verify that component names in
component-options.js
match your actual component class names - Path resolution issues: Use absolute paths for
workspaceRoot
and relative paths (from workspace root) for other parameters
Available Tools
Component Analysis
report-violations
: Report deprecated CSS usage in a directory with configurable grouping formatreport-deprecated-css
: Report deprecated CSS classes found in styling filesget-deprecated-css-classes
: List deprecated CSS classes for a component
Component Analysis
get-ds-component-data
: Return data for a component including implementation files, documentation files, and import pathbuild-component-usage-graph
: Maps where given Angular components are imported (modules, specs, templates, styles) so refactors touch every file
Component Contracts
build_component_contract
: Generate a static surface contract for a component's template and SCSSdiff_component_contract
: Compare before/after contracts for parity and surface breaking changeslist_component_contracts
: List all available component contracts in the .cursor/tmp/contracts directory
Project Analysis
get-project-dependencies
: Analyze project dependencies and detect if library is buildable/publishable. Checks for peer dependencies and validates import paths for componentslint-changes
: Lint changed Angular files using ESLint rules. Automatically resolves ESLint config by walking up the directory tree
Component Contract Workflow
The component contract system provides a safety net for Angular component refactoring:
- Generate Initial Contract: Create a baseline contract before refactoring
- Perform Refactoring: Make your component changes
- Generate New Contract: Create a contract after refactoring
- Compare Contracts: Detect breaking changes and API differences
Angular Project Integration
This MCP server is designed for Angular project analysis and refactoring. It helps with:
- Migration Planning: Identify all usages of deprecated components/classes
- Refactoring Safety: Generate contracts to ensure no breaking changes
- Documentation Access: Quick access to component documentation and examples
- Code Quality: Analyze and improve code quality across your Angular project
Documentation
For comprehensive documentation, guides, and workflows, see our Documentation Hub.
Contributing
Please read our Contributing Guide.
License
This project is licensed under the MIT License - see the LICENSE file for details.
This server cannot be installed
A Model Context Protocol server that provides Angular project analysis and refactoring capabilities, enabling LLMs to analyze component usage patterns, dependency structures, and perform safe refactoring with breaking change detection.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that provides tools for code modification and generation via Large Language Models, allowing users to create, modify, rewrite, and delete files using structured XML instructions.Last updated -121PythonMIT License
- -securityAlicense-qualityA Model Context Protocol server that enables LLMs to read, search, and analyze code files with advanced caching and real-time file watching capabilities.Last updated -2020JavaScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server that enables large language models to interact with Linear's issue tracking system, allowing management of issues, projects, teams, and other Linear resources.Last updated -554TypeScriptMIT License
- AsecurityFlicenseAqualityA comprehensive Model Context Protocol server for advanced code analysis that provides tools for syntax analysis, dependency visualization, and AI-assisted development workflow support.Last updated -284Python