|
1 | | -# angular-mcp |
| 1 | +# Angular Toolkit MCP |
2 | 2 |
|
3 | | -This library was generated with [Nx](https://nx.dev). |
| 3 | +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. |
4 | 4 |
|
5 | | -## Building |
| 5 | +## Installation |
6 | 6 |
|
7 | | -Run `nx build angular-mcp-server` to build the library. |
| 7 | +No installation required! Run directly with npx: |
| 8 | + |
| 9 | +```bash |
| 10 | +npx @push-based/angular-toolkit-mcp@latest --workspaceRoot=/path/to/workspace --ds.uiRoot=packages/ui |
| 11 | +``` |
| 12 | + |
| 13 | +## Configuration |
| 14 | + |
| 15 | +Add the server to your MCP client configuration (e.g., Claude Desktop, Cursor, Copilot, Windsurf): |
| 16 | + |
| 17 | +```json |
| 18 | +{ |
| 19 | + "mcpServers": { |
| 20 | + "angular-toolkit": { |
| 21 | + "command": "npx", |
| 22 | + "args": [ |
| 23 | + "@push-based/angular-toolkit-mcp@latest", |
| 24 | + "--workspaceRoot=/absolute/path/to/your/angular/workspace", |
| 25 | + "--ds.uiRoot=packages/ui", |
| 26 | + "--ds.storybookDocsRoot=storybook/docs", |
| 27 | + "--ds.deprecatedCssClassesPath=design-system/component-options.js" |
| 28 | + ] |
| 29 | + } |
| 30 | + } |
| 31 | +} |
| 32 | +``` |
| 33 | + |
| 34 | +### Configuration Parameters |
| 35 | + |
| 36 | +#### Required Parameters |
| 37 | + |
| 38 | +| Parameter | Type | Description | Example | |
| 39 | +|-----------|------|-------------|---------| |
| 40 | +| `workspaceRoot` | Absolute path | Root directory of your Angular workspace | `/Users/dev/my-angular-app` | |
| 41 | +| `ds.uiRoot` | Relative path | Directory containing UI components | `packages/ui` | |
| 42 | + |
| 43 | +#### Optional Parameters |
| 44 | + |
| 45 | +| Parameter | Type | Description | Example | |
| 46 | +|-----------|------|-------------|---------| |
| 47 | +| `ds.storybookDocsRoot` | Relative path | Root directory containing Storybook documentation | `storybook/docs` | |
| 48 | +| `ds.deprecatedCssClassesPath` | Relative path | JavaScript file mapping deprecated CSS classes | `design-system/component-options.js` | |
| 49 | + |
| 50 | +## Key Features |
| 51 | + |
| 52 | +- **Component Analysis**: Detect deprecated CSS classes and component usage violations |
| 53 | +- **Safe Refactoring**: Generate contracts for safe component refactoring with breaking change detection |
| 54 | +- **Dependency Mapping**: Map component dependencies across modules, templates, and styles |
| 55 | +- **ESLint Integration**: Lint Angular files with automatic ESLint configuration discovery |
| 56 | +- **Project Analysis**: Analyze buildable/publishable libraries and validate import paths |
| 57 | +- **Component Documentation**: Retrieve component data and documentation, list available components |
| 58 | + |
| 59 | +## Available Tools |
| 60 | + |
| 61 | +### Component Analysis |
| 62 | +- `report-violations` - Report deprecated CSS usage in a directory |
| 63 | +- `report-deprecated-css` - Report deprecated CSS classes found in styling files |
| 64 | +- `get-deprecated-css-classes` - List deprecated CSS classes for a component |
| 65 | +- `list-ds-components` - List all available Design System components |
| 66 | +- `get-ds-component-data` - Get component data including implementation and documentation |
| 67 | +- `build-component-usage-graph` - Map component imports across the project |
| 68 | + |
| 69 | +### Component Contracts |
| 70 | +- `build_component_contract` - Generate a static surface contract for a component |
| 71 | +- `diff_component_contract` - Compare before/after contracts for breaking changes |
| 72 | +- `list_component_contracts` - List all available component contracts |
| 73 | + |
| 74 | +### Project Analysis |
| 75 | +- `get-project-dependencies` - Analyze project dependencies and library configuration |
| 76 | +- `lint-changes` - Lint changed Angular files using ESLint rules |
| 77 | + |
| 78 | +## Requirements |
| 79 | + |
| 80 | +- Node.js version 18 or higher |
| 81 | + |
| 82 | +## Documentation |
| 83 | + |
| 84 | +For comprehensive documentation, guides, and workflows, see the [full documentation](https://github.com/push-based/angular-toolkit-mcp). |
| 85 | + |
| 86 | +## License |
| 87 | + |
| 88 | +MIT License - see the [LICENSE](https://github.com/push-based/angular-toolkit-mcp/blob/main/LICENSE) file for details. |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +<div align="center"> |
| 93 | + <p><strong>Sponsored by Entain</strong></p> |
| 94 | +</div> |
0 commit comments