Skip to content

Commit a655a21

Browse files
committed
feat(angular-toolkit-mcp): prepare publishing
1 parent 0e9ae2b commit a655a21

File tree

7 files changed

+266
-22
lines changed

7 files changed

+266
-22
lines changed

CONTRIBUTING.MD

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Thank you for your interest in contributing to the Angular Toolkit MCP! This doc
1313
- [Submitting Changes](#submitting-changes)
1414
- [Documentation](#documentation)
1515
- [Debugging](#debugging)
16+
- [Release Process](#release-process)
1617

1718
## 🚀 Getting Started
1819

@@ -38,7 +39,7 @@ Thank you for your interest in contributing to the Angular Toolkit MCP! This doc
3839

3940
2. **Build the project:**
4041
```bash
41-
npx nx build angular-mcp
42+
npx nx build @push-based/angular-toolkit-mcp
4243
```
4344

4445
### Nx Workspace Commands
@@ -209,7 +210,7 @@ Before committing, ensure:
209210
Start the MCP server in debug mode:
210211

211212
```bash
212-
npx nx run angular-mcp:debug
213+
npx nx run @push-based/angular-toolkit-mcp:debug
213214
```
214215

215216
This starts the server with the MCP Inspector for debugging.
@@ -222,6 +223,78 @@ This starts the server with the MCP Inspector for debugging.
222223
- Use `console.log` or debugger statements in development
223224
- Test with the minimal-repo examples
224225

226+
## 📦 Release Process
227+
228+
### Publishing to npm
229+
230+
The Angular Toolkit MCP is published to npm as `@push-based/angular-toolkit-mcp`. Only maintainers with appropriate permissions can publish new versions.
231+
232+
### Release Steps
233+
234+
1. **Update Version**
235+
236+
Update the version in `packages/angular-mcp/package.json` following semantic versioning:
237+
- **Patch** (0.1.0 → 0.1.1): Bug fixes
238+
- **Minor** (0.1.0 → 0.2.0): New features (backwards compatible)
239+
- **Major** (0.1.0 → 1.0.0): Breaking changes
240+
241+
2. **Build the Package**
242+
```bash
243+
npx nx build @push-based/angular-toolkit-mcp
244+
```
245+
246+
3. **Test the Package**
247+
```bash
248+
cd packages/angular-mcp/dist
249+
npm pack
250+
# Test the generated .tgz file
251+
node main.js --help
252+
```
253+
254+
4. **Authenticate with npm**
255+
```bash
256+
npm login
257+
```
258+
Ensure you have access to the `@push-based` scope.
259+
260+
5. **Publish to npm**
261+
```bash
262+
npm run publish:mcp
263+
```
264+
Or manually:
265+
```bash
266+
npx nx build @push-based/angular-toolkit-mcp
267+
cd packages/angular-mcp/dist
268+
npm publish
269+
```
270+
271+
6. **Verify Publication**
272+
```bash
273+
npm view @push-based/angular-toolkit-mcp
274+
npx @push-based/angular-toolkit-mcp@latest --help
275+
```
276+
277+
7. **Tag the Release**
278+
```bash
279+
git tag v0.1.0
280+
git push origin v0.1.0
281+
```
282+
283+
8. **Update Documentation**
284+
- Update CHANGELOG.md with release notes
285+
- Update any version references in documentation
286+
287+
### Pre-release Checklist
288+
289+
Before publishing a new version:
290+
- [ ] All tests pass (`npx nx run-many --target=test --all`)
291+
- [ ] No linting errors (`npx nx run-many --target=lint --all`)
292+
- [ ] Build succeeds (`npx nx build @push-based/angular-toolkit-mcp`)
293+
- [ ] Version number updated in package.json
294+
- [ ] CHANGELOG.md updated with changes
295+
- [ ] Documentation updated as needed
296+
- [ ] Local npm pack test successful
297+
225298
## 📄 License
226299

227300
By contributing, you agree that your contributions will be licensed under the MIT License.

README.md

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,27 @@ A Model Context Protocol (MCP) server that provides Angular project analysis and
2020
- Breaking change detection during component updates
2121
- Code quality analysis and improvement
2222

23+
## Quick Start
24+
25+
Install and run via npx (no manual build required):
26+
27+
```json
28+
{
29+
"mcpServers": {
30+
"angular-toolkit": {
31+
"command": "npx",
32+
"args": [
33+
"@push-based/angular-toolkit-mcp@latest",
34+
"--workspaceRoot=/absolute/path/to/your/angular/workspace",
35+
"--ds.uiRoot=packages/ui"
36+
]
37+
}
38+
}
39+
}
40+
```
41+
42+
**Required Node.js version:** 18 or higher
43+
2344
## Configuration
2445

2546
### Prerequisites
@@ -28,39 +49,63 @@ A Model Context Protocol (MCP) server that provides Angular project analysis and
2849

2950
### Installation & Setup
3051

52+
#### For Users
53+
54+
Simply use npx as shown in the Quick Start section above. No installation or build required.
55+
56+
#### For Contributors (Local Development)
57+
3158
1. Clone the repository
3259

33-
2. Build the MCP
60+
2. Install dependencies and build the MCP
3461

35-
```bash
62+
```bash
3663
npm install
3764
npx nx build angular-mcp
38-
```
65+
```
3966

40-
2. Locate the built server
67+
3. Locate the built server
4168

4269
After building, the server will be available at `packages/angular-mcp/dist/main.js`
4370

4471
### MCP Configuration
4572

4673
Add the server to your MCP client configuration (e.g., Claude Desktop, Cursor, Copilot, Windsurf or other MCP-compatible clients):
4774

48-
#### For Cursor (`.cursor/mcp.json` or MCP settings):
75+
#### For Users (npx - Recommended)
76+
77+
```json
78+
{
79+
"mcpServers": {
80+
"angular-toolkit": {
81+
"command": "npx",
82+
"args": [
83+
"@push-based/angular-toolkit-mcp@latest",
84+
"--workspaceRoot=/absolute/path/to/your/angular/workspace",
85+
"--ds.uiRoot=relative/path/to/ui/components",
86+
"--ds.storybookDocsRoot=relative/path/to/storybook/docs",
87+
"--ds.deprecatedCssClassesPath=relative/path/to/component-options.js"
88+
]
89+
}
90+
}
91+
}
92+
```
93+
94+
#### For Contributors (Local Development)
4995

50-
Copy `.cursor/mcp.json.example` to the project you're working on. Copied file should be: `.cursor/mcp.json` and update `angular-toolkit-mcp` values accordingly:
96+
When developing locally, point to the built server:
5197

5298
```json
5399
{
54100
"mcpServers": {
55-
...(other servers)...
56101
"angular-toolkit-mcp": {
57102
"command": "node",
58103
"args": [
59-
"/absolute/path/to/angular-mcp-server/packages/angular-mcp-server/dist/index.js",
104+
"/absolute/path/to/angular-toolkit-mcp/packages/angular-mcp/dist/main.js",
60105
"--workspaceRoot=/absolute/path/to/your/angular/workspace",
106+
"--ds.uiRoot=relative/path/to/ui/components",
61107
"--ds.storybookDocsRoot=relative/path/to/storybook/docs",
62-
"--ds.deprecatedCssClassesPath=relative/path/to/component-options.js",
63-
"--ds.uiRoot=relative/path/to/ui/components"
108+
"--ds.deprecatedCssClassesPath=relative/path/to/component-options.js"
64109
]
65110
}
66111
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"version": "0.0.0",
44
"type": "module",
55
"license": "MIT",
6-
"scripts": {},
6+
"scripts": {
7+
"publish:mcp": "nx build @push-based/angular-toolkit-mcp && cd packages/angular-mcp/dist && npm publish"
8+
},
79
"private": true,
810
"devDependencies": {
911
"@eslint/js": "^9.28.0",

packages/angular-mcp/README.md

Lines changed: 91 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,94 @@
1-
# angular-mcp
1+
# Angular Toolkit MCP
22

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.
44

5-
## Building
5+
## Installation
66

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>

packages/angular-mcp/package.json

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
11
{
2-
"name": "@push-based/angular-mcp",
3-
"version": "0.0.1",
4-
"private": true,
5-
"bin": "main.js",
2+
"name": "@push-based/angular-toolkit-mcp",
3+
"version": "0.1.0",
4+
"description": "A Model Context Protocol server for Angular project analysis and refactoring",
5+
"keywords": [
6+
"mcp",
7+
"angular",
8+
"refactoring",
9+
"analysis",
10+
"model-context-protocol"
11+
],
12+
"author": "Push-Based",
13+
"license": "MIT",
14+
"repository": {
15+
"type": "git",
16+
"url": "https://github.com/push-based/angular-toolkit-mcp.git"
17+
},
18+
"homepage": "https://github.com/push-based/angular-toolkit-mcp",
19+
"bugs": "https://github.com/push-based/angular-toolkit-mcp/issues",
20+
"engines": {
21+
"node": ">=18"
22+
},
23+
"publishConfig": {
24+
"access": "public"
25+
},
26+
"bin": {
27+
"angular-toolkit-mcp": "main.js"
28+
},
629
"files": [
730
"main.js",
831
"README.md"

packages/angular-mcp/src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env node
12
import express from 'express';
23
import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
34
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';

packages/angular-mcp/webpack.config.cjs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const { NxAppWebpackPlugin } = require('@nx/webpack/app-plugin');
22
const { join } = require('path');
3+
const webpack = require('webpack');
34

45
module.exports = {
56
output: {
@@ -11,10 +12,22 @@ module.exports = {
1112
compiler: 'tsc',
1213
main: './src/main.ts',
1314
tsConfig: './tsconfig.app.json',
14-
assets: ['./src/assets'],
15+
assets: [
16+
'./src/assets',
17+
{
18+
input: '.',
19+
glob: 'README.md',
20+
output: '.',
21+
},
22+
],
1523
optimization: false,
1624
outputHashing: 'none',
1725
generatePackageJson: true,
1826
}),
27+
new webpack.BannerPlugin({
28+
banner: '#!/usr/bin/env node',
29+
raw: true,
30+
entryOnly: true,
31+
}),
1932
],
2033
};

0 commit comments

Comments
 (0)