Thank you for your interest in contributing to the Angular Toolkit MCP! This document provides guidelines and information for contributors.
- Getting Started
- Development Setup
- Project Structure
- Development Workflow
- Testing
- Code Quality
- Submitting Changes
- Documentation
- Debugging
- Release Process
- Node.js (version 18 or higher)
- npm (comes with Node.js)
- Git for version control
- Fork the repository on GitHub
- Clone your fork locally
-
Install dependencies:
npm install
-
Build the project:
npx nx build angular-toolkit-mcp
This project uses Nx for monorepo management. Key commands:
# Build all projects
npx nx run-many --target=build --all
# Build specific project
npx nx build angular-mcp-server
# Run tests for all projects
npx nx run-many --target=test --all
# Lint all projects
npx nx run-many --target=lint --all
# Check project graph
npx nx graphThis is an Nx monorepo with the following structure:
├── packages/
│ ├── angular-mcp/ # Main MCP client application
│ ├── angular-mcp-server/ # Core MCP server library
│ ├── minimal-repo/ # Test fixtures and examples
│ └── shared/ # Shared libraries
│ ├── angular-ast-utils/ # Angular AST parsing
│ ├── ds-component-coverage/ # Design system analysis
│ ├── models/ # Core types and schemas
│ ├── styles-ast-utils/ # CSS/SCSS AST parsing
│ ├── typescript-ast-utils/ # TypeScript AST utilities
│ └── utils/ # General utilities
├── testing/ # Testing utilities and setup
├── docs/ # Documentation
└── tools/ # Build and development tools
angular-mcp: Main executable MCP clientangular-mcp-server: Core server logic and MCP tools- Shared libraries: Reusable utilities for AST parsing, file operations, and Angular analysis
git checkout -b feature/your-feature-name- Follow the existing code style and patterns
- Add tests for new functionality
- Update documentation as needed
# Build affected projects
npx nx affected --target=build
# Run tests
npx nx affected --target=test
# Lint code
npx nx affected --target=lintFollow conventional commit format:
git commit -m "feat: add new MCP tool for component analysis"
git commit -m "fix: resolve dependency resolution issue"
git commit -m "docs: update API documentation"# Run all tests
npx nx run-many --target=test --all
# Run tests for specific project
npx nx test angular-mcp-server
# Run tests with coverage
npx nx test angular-mcp-server --coverage- Use Vitest for unit testing
- Follow the existing test patterns
- Mock external dependencies appropriately
- Test both success and error scenarios
The project uses ESLint with TypeScript and Nx-specific rules:
# Lint all files
npx nx run-many --target=lint --all
# Lint specific project
npx nx lint angular-mcp-server
# Auto-fix linting issues
npx nx lint angular-mcp-server --fix- Use TypeScript strict mode
- Follow functional programming patterns where possible
- Use descriptive variable and function names
- Add JSDoc comments for public APIs
- Prefer composition over inheritance
Before committing, ensure:
- All tests pass
- No linting errors
- Code builds successfully
- Documentation is updated
-
Push your branch:
git push origin feature/your-feature-name
-
Create a Pull Request:
- Use a descriptive title
- Include a detailed description of changes
- Reference any related issues
- Add screenshots for UI changes
-
PR Requirements:
- All CI checks must pass
- Code review approval required
- Documentation updates included
- Tests added for new functionality
Start the MCP server in debug mode:
npx nx run angular-toolkit-mcp:debugThis starts the server with the MCP Inspector for debugging.
- Use the MCP Inspector for real-time debugging
- Check server logs for detailed error information
- Use
console.logor debugger statements in development - Test with the minimal-repo examples
The Angular Toolkit MCP is published to npm as @push-based/angular-toolkit-mcp. Only maintainers with appropriate permissions can publish new versions.
-
Update Version
Update the version in
packages/angular-mcp/package.jsonfollowing semantic versioning:- Patch (0.1.0 → 0.1.1): Bug fixes
- Minor (0.1.0 → 0.2.0): New features (backwards compatible)
- Major (0.1.0 → 1.0.0): Breaking changes
-
Build the Package
npx nx build angular-toolkit-mcp
-
Test the Package
cd packages/angular-mcp/dist npm pack # Test the generated .tgz file node main.js --help
-
Authenticate with npm
npm login
Ensure you have access to the
@push-basedscope. -
Publish to npm
npm run publish:mcp
Or manually:
npx nx build angular-toolkit-mcp cd packages/angular-mcp/dist npm publish -
Verify Publication
npm view @push-based/angular-toolkit-mcp npx @push-based/angular-toolkit-mcp@latest --help
-
Tag the Release
git tag v0.1.0 git push origin v0.1.0
-
Update Documentation
- Update CHANGELOG.md with release notes
- Update any version references in documentation
Before publishing a new version:
- All tests pass (
npx nx run-many --target=test --all) - No linting errors (
npx nx run-many --target=lint --all) - Build succeeds (
npx nx build angular-toolkit-mcp) - Version number updated in package.json
- CHANGELOG.md updated with changes
- Documentation updated as needed
- Local npm pack test successful
By contributing, you agree that your contributions will be licensed under the MIT License.