@seniorsistemas/angular-components-mcp 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +87 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Moacir Zimermann
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# angular-components-mcp
|
|
2
|
+
|
|
3
|
+
MCP Server que fornece a agentes de IA conhecimento especializado sobre a biblioteca `@seniorsistemas/angular-components`, permitindo geração de código Angular correto e alinhado ao SDS.
|
|
4
|
+
|
|
5
|
+
Publica o pacote npm **`@seniorsistemas/angular-components-mcp`**.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## O que é
|
|
10
|
+
|
|
11
|
+
Este repositório implementa um [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server com ferramentas que expõem:
|
|
12
|
+
|
|
13
|
+
- Metadados de 70+ componentes Angular (inputs, outputs, exemplos de import)
|
|
14
|
+
- Tipos e propriedades do `DynamicForm`, extraídos diretamente do código-fonte TypeScript
|
|
15
|
+
- Regras de UX e guias técnicos de uso por componente
|
|
16
|
+
|
|
17
|
+
O servidor é consumido por agentes de IA (ex.: [Kiro](https://kiro.dev/)) como um **Power**, habilitando o agente a gerar código Angular correto sem inventar APIs.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Estrutura
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
mcp-server/ ← código-fonte do MCP Server (pacote npm publicado)
|
|
25
|
+
src/
|
|
26
|
+
index.ts ← entrypoint do servidor MCP
|
|
27
|
+
handlers.ts ← implementação das ferramentas
|
|
28
|
+
data/ ← regras e guias técnicos (Markdown + JSON estático)
|
|
29
|
+
scripts/
|
|
30
|
+
generate/ ← scripts que leem o fonte do angular-components e geram JSONs de metadados
|
|
31
|
+
build/ ← scripts de pós-build
|
|
32
|
+
kiro-power/ ← artefatos do Kiro Power
|
|
33
|
+
POWER.md ← manifesto do Power para o Kiro
|
|
34
|
+
mcp.json ← configuração local do MCP Server (não commitar com caminho absoluto)
|
|
35
|
+
HOW_TO_USE.md ← guia de instalação e uso local
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Dependência de build
|
|
41
|
+
|
|
42
|
+
Os scripts de geração de metadados precisam do **código-fonte não compilado** do repositório [`angular-components`](https://git.senior.com.br/arquitetura/angular-components). Clone os dois repositórios lado a lado:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
algum-diretorio/
|
|
46
|
+
angular-components-mcp/ ← este repositório
|
|
47
|
+
angular-components/ ← biblioteca de componentes
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Build local
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# 1. Instalar dependências da biblioteca (necessário para o compilador TypeScript)
|
|
56
|
+
cd angular-components && npm install && cd ..
|
|
57
|
+
|
|
58
|
+
# 2. Instalar dependências do MCP Server
|
|
59
|
+
cd angular-components-mcp/mcp-server && npm install
|
|
60
|
+
|
|
61
|
+
# 3. Buildar com a env var apontando para o fonte da biblioteca
|
|
62
|
+
ANGULAR_COMPONENTS_SRC=../../angular-components/projects/angular-components npm run build
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
O build gera o servidor em `mcp-server/dist/`. Veja o [HOW_TO_USE.md](HOW_TO_USE.md) para instruções completas de configuração no Kiro.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Ferramentas expostas pelo MCP Server
|
|
70
|
+
|
|
71
|
+
| Ferramenta | Descrição |
|
|
72
|
+
| ------------------------------- | ----------------------------------------------------------------- |
|
|
73
|
+
| `get_components` | Lista componentes por categoria ou palavra-chave |
|
|
74
|
+
| `get_component_details` | API completa de um componente (inputs, outputs, imports) |
|
|
75
|
+
| `get_dynamic_form_types` | Tipos de campos e estruturas do DynamicForm |
|
|
76
|
+
| `detect_required_providers` | Detecta providers necessários para uma configuração de formulário |
|
|
77
|
+
| `get_ux_rules` | Regras cross-component (tokens Tailwind, loading states, etc.) |
|
|
78
|
+
| `get_component_rules_index` | Lista componentes com regras de UX detalhadas |
|
|
79
|
+
| `get_component_rules` | Regras de UX de um componente específico |
|
|
80
|
+
| `get_component_technical_index` | Lista componentes com guia técnico |
|
|
81
|
+
| `get_component_technical_guide` | Guia técnico de um componente (padrões, exemplos, erros comuns) |
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Suporte
|
|
86
|
+
|
|
87
|
+
Time **[SDS](https://teams.microsoft.com/l/team/19%3AcZ2A01zJnLo1SY9z_Zgu_0rg2X66NtTnuWk9E23RV7M1%40thread.tacv2/conversations?groupId=bb0edbc3-b313-418e-9f97-3477c42a50d5&tenantId=62c7b02d-a95c-498b-9a7f-6e00acab728d)**.
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@seniorsistemas/angular-components-mcp",
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"version": "1.0.0-beta.2",
|
|
5
|
+
"description": "Model Context Protocol server for Senior Sistemas Angular Components",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.cjs",
|
|
8
|
+
"module": "dist/index.mjs",
|
|
9
|
+
"exports": {
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.cjs"
|
|
12
|
+
},
|
|
13
|
+
"bin": {
|
|
14
|
+
"angular-components-mcp": "dist/index.cjs"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "npm run clean && npm run generate:metadata && npm run generate:dynamic-form-metadata && rollup -c && node scripts/build/postbuild.mjs",
|
|
18
|
+
"dev": "tsc --watch",
|
|
19
|
+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"scripts/**/*.mjs\"",
|
|
20
|
+
"clean": "node scripts/build/clean.mjs",
|
|
21
|
+
"generate:metadata": "node scripts/generate/generate-components-metadata.mjs",
|
|
22
|
+
"generate:dynamic-form-metadata": "node scripts/generate/generate-dynamic-form-metadata.mjs",
|
|
23
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest --config jest.config.cjs"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
30
|
+
"tslib": "^2.8.1"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@rollup/plugin-commonjs": "^25.0.0",
|
|
34
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
35
|
+
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
36
|
+
"@rollup/plugin-typescript": "^11.0.0",
|
|
37
|
+
"@types/jest": "^29.5.14",
|
|
38
|
+
"@types/node": "^20.0.0",
|
|
39
|
+
"jest": "^29.7.0",
|
|
40
|
+
"prettier": "^3.0.0",
|
|
41
|
+
"rollup": "^4.0.0",
|
|
42
|
+
"ts-jest": "^29.1.1",
|
|
43
|
+
"typescript": "^5.3.0"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=18.0.0"
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
"dist/"
|
|
50
|
+
]
|
|
51
|
+
}
|