@iress-oss/ids-mcp-server 0.0.1 → 5.14.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.txt +201 -0
- package/README.md +29 -159
- package/dist/componentHandlers.js +241 -0
- package/dist/componentHandlers.test.js +380 -0
- package/{build → dist}/config.js +5 -5
- package/dist/index.js +53 -0
- package/{build → dist}/iressHandlers.js +52 -46
- package/dist/iressHandlers.test.js +316 -0
- package/{build → dist}/resourceHandlers.js +23 -22
- package/dist/resourceHandlers.test.js +352 -0
- package/{build → dist}/searchHandlers.js +107 -92
- package/dist/searchHandlers.test.js +524 -0
- package/{build → dist}/toolHandler.js +13 -13
- package/dist/toolHandler.test.js +369 -0
- package/dist/tools.js +165 -0
- package/{build → dist}/utils.js +11 -15
- package/dist/utils.test.js +286 -0
- package/{docs/ids → generated/docs}/components-autocomplete-docs.md +3 -3
- package/{docs/ids → generated/docs}/components-autocomplete-recipes-docs.md +17 -51
- package/{docs/ids → generated/docs}/components-card-recipes-docs.md +1 -1
- package/{docs/ids → generated/docs}/components-checkbox-docs.md +6 -19
- package/{docs/ids → generated/docs}/components-checkboxgroup-docs.md +18 -18
- package/{docs/ids → generated/docs}/components-checkboxgroup-recipes-docs.md +9 -9
- package/{docs/ids → generated/docs}/components-col-docs.md +1 -1
- package/{docs/ids → generated/docs}/components-combobox-docs.md +4 -4
- package/{docs/ids → generated/docs}/components-container-docs.md +8 -42
- package/{docs/ids → generated/docs}/components-filter-docs.md +14 -67
- package/{docs/ids → generated/docs}/components-form-docs.md +341 -335
- package/{docs/ids → generated/docs}/components-form-recipes-docs.md +198 -1
- package/{docs/ids → generated/docs}/components-hide-docs.md +16 -70
- package/{docs/ids → generated/docs}/components-icon-docs.md +4 -4
- package/{docs/ids → generated/docs}/components-input-recipes-docs.md +2 -2
- package/{docs/ids → generated/docs}/components-inputcurrency-recipes-docs.md +6 -40
- package/{docs/ids → generated/docs}/components-modal-docs.md +3 -113
- package/generated/docs/components-popover-docs.md +464 -0
- package/{docs/ids → generated/docs}/components-radiogroup-docs.md +21 -21
- package/{docs/ids → generated/docs}/components-richselect-docs.md +149 -111
- package/{docs/ids → generated/docs}/components-row-docs.md +4 -4
- package/{docs/ids → generated/docs}/components-skeleton-docs.md +3 -3
- package/{docs/ids → generated/docs}/components-skeleton-recipes-docs.md +1 -1
- package/{docs/ids → generated/docs}/components-skiplink-docs.md +1 -1
- package/{docs/ids → generated/docs}/components-slideout-docs.md +3 -113
- package/{docs/ids → generated/docs}/components-table-ag-grid-docs.md +109 -137
- package/{docs/ids → generated/docs}/components-table-docs.md +92 -597
- package/{docs/ids → generated/docs}/components-tabset-docs.md +2 -2
- package/{docs/ids → generated/docs}/components-tag-docs.md +1 -1
- package/{docs/ids → generated/docs}/components-toaster-docs.md +5 -5
- package/{docs/ids → generated/docs}/extensions-editor-docs.md +4 -4
- package/generated/docs/foundations-accessibility-docs.md +62 -0
- package/{docs/ids → generated/docs}/foundations-colours-docs.md +1 -1
- package/generated/docs/foundations-consistency-docs.md +52 -0
- package/generated/docs/foundations-content-docs.md +23 -0
- package/generated/docs/foundations-introduction-docs.md +17 -0
- package/generated/docs/foundations-principles-docs.md +70 -0
- package/{docs/ids → generated/docs}/foundations-typography-docs.md +7 -2
- package/generated/docs/foundations-user-experience-docs.md +63 -0
- package/generated/docs/foundations-visual-design-docs.md +46 -0
- package/{docs/ids → generated/docs}/get-started-develop-docs.md +3 -3
- package/generated/docs/guidelines.md +812 -0
- package/{docs/ids → generated/docs}/introduction-docs.md +4 -4
- package/{docs/ids → generated/docs}/patterns-loading-docs.md +332 -2
- package/generated/docs/resources-migration-guides-from-v4-to-v5-docs.md +437 -0
- package/generated/docs/themes-available-themes-docs.md +66 -0
- package/generated/docs/themes-tokens-docs.md +1200 -0
- package/generated/docs/versions-docs.md +17 -0
- package/package.json +42 -14
- package/LICENSE +0 -193
- package/build/componentHandlers.js +0 -205
- package/build/index.js +0 -51
- package/build/tools.js +0 -165
- package/docs/api-reference.md +0 -0
- package/docs/best-practices.md +0 -0
- package/docs/configuration.md +0 -0
- package/docs/examples.md +0 -0
- package/docs/guidelines.md +0 -269
- package/docs/ids/components-popover-docs.md +0 -4
- package/docs/ids/resources-migration-guides-from-v4-to-v5-docs.md +0 -639
- package/docs/ids/themes-available-themes-docs.md +0 -74
- package/docs/ids/themes-tokens-docs.md +0 -4580
- package/docs/ids/versions-docs.md +0 -27
- package/docs/tutorials/basic-integration.md +0 -0
- /package/{build → dist}/types.js +0 -0
- /package/{docs/ids → generated/docs}/components-alert-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-badge-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-button-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-button-recipes-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-buttongroup-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-card-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-divider-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-expander-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-field-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-inline-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-input-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-inputcurrency-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-label-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-menu-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-menu-menuitem-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-navbar-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-navbar-recipes-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-panel-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-placeholder-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-popover-recipes-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-progress-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-radio-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-readonly-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-select-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-slider-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-spinner-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-stack-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-tabset-tab-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-text-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-toaster-toast-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-toggle-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-tooltip-docs.md +0 -0
- /package/{docs/ids → generated/docs}/components-validationmessage-docs.md +0 -0
- /package/{docs/ids → generated/docs}/contact-us-docs.md +0 -0
- /package/{docs/ids → generated/docs}/extensions-editor-recipes-docs.md +0 -0
- /package/{docs/ids → generated/docs}/frequently-asked-questions-docs.md +0 -0
- /package/{docs/ids → generated/docs}/get-started-using-storybook-docs.md +0 -0
- /package/{docs/ids → generated/docs}/resources-changelog-docs.md +0 -0
- /package/{docs/ids → generated/docs}/resources-code-katas-docs.md +0 -0
- /package/{docs/ids → generated/docs}/themes-introduction-docs.md +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[](#versions)Versions
|
|
2
|
+
=====================
|
|
3
|
+
|
|
4
|
+
Version 5 is the latest release of the library and recommended for new development.
|
|
5
|
+
|
|
6
|
+
[](#list)List
|
|
7
|
+
-------------
|
|
8
|
+
|
|
9
|
+
| Version | Links |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| v5 | [Documentation](https://design.wm.iress.com) |
|
|
12
|
+
| v4 | [Documentation](https://archive.design.aws-wmcore-production-au.iress.online/index.html) |
|
|
13
|
+
| OneUI | No longer available |
|
|
14
|
+
|
|
15
|
+
On this page
|
|
16
|
+
|
|
17
|
+
* [List](#list)
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iress-oss/ids-mcp-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.14.2",
|
|
4
4
|
"description": "Model Context Protocol (MCP) server for Iress Design System (IDS) component library - provides AI assistants with contextual information about IDS components, design tokens, and usage patterns",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"registry": "https://registry.npmjs.org/"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/index.js",
|
|
7
10
|
"bin": {
|
|
8
|
-
"ids": "
|
|
11
|
+
"ids": "dist/index.js"
|
|
9
12
|
},
|
|
10
13
|
"packageManager": "yarn@4.4.1",
|
|
11
14
|
"keywords": [
|
|
@@ -18,28 +21,34 @@
|
|
|
18
21
|
"react",
|
|
19
22
|
"ai-assistant"
|
|
20
23
|
],
|
|
21
|
-
"homepage": "https://github.com/iress/ids-mcp-server#readme",
|
|
24
|
+
"homepage": "https://github.com/iress-oss/ids-mcp-server#readme",
|
|
22
25
|
"repository": {
|
|
23
26
|
"type": "git",
|
|
24
|
-
"url": "git+https://github.com/iress/ids-mcp-server.git"
|
|
27
|
+
"url": "git+https://github.com/iress-oss/ids-mcp-server.git"
|
|
25
28
|
},
|
|
26
29
|
"bugs": {
|
|
27
|
-
"url": "https://github.com/iress/ids-mcp-server/issues"
|
|
30
|
+
"url": "https://github.com/iress-oss/ids-mcp-server/issues"
|
|
28
31
|
},
|
|
29
32
|
"author": "Iress",
|
|
30
33
|
"license": "Apache-2.0",
|
|
31
34
|
"scripts": {
|
|
32
|
-
"build": "tsc && chmod 755 ./
|
|
35
|
+
"build": "tsc && chmod 755 ./dist/index.js",
|
|
36
|
+
"clean": "rimraf dist coverage generated .nyc_output",
|
|
33
37
|
"dev": "tsc --watch",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
38
|
+
"generate": "tsx scripts/generate.ts",
|
|
39
|
+
"lint": "eslint . --ext ts,tsx,mdx --report-unused-disable-directives --max-warnings 0",
|
|
40
|
+
"lint:fix": "eslint . --fix",
|
|
41
|
+
"start": "node dist/index.js",
|
|
42
|
+
"test": "vitest run --coverage",
|
|
43
|
+
"test:dev": "chmod +x ./scripts/test-dev-server.sh && ./scripts/test-dev-server.sh",
|
|
44
|
+
"test:watch": "vitest watch",
|
|
45
|
+
"typecheck": "tsc --noEmit"
|
|
37
46
|
},
|
|
38
47
|
"files": [
|
|
39
|
-
"
|
|
40
|
-
"docs",
|
|
48
|
+
"dist",
|
|
49
|
+
"generated/docs",
|
|
41
50
|
"README.md",
|
|
42
|
-
"LICENSE"
|
|
51
|
+
"LICENSE.txt"
|
|
43
52
|
],
|
|
44
53
|
"dependencies": {
|
|
45
54
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
@@ -47,6 +56,25 @@
|
|
|
47
56
|
},
|
|
48
57
|
"devDependencies": {
|
|
49
58
|
"@types/node": "^22.15.21",
|
|
50
|
-
"
|
|
59
|
+
"@types/turndown": "^5.0.5",
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
61
|
+
"@typescript-eslint/parser": "~8.34.0",
|
|
62
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
63
|
+
"commander": "^12.0.0",
|
|
64
|
+
"dotenv": "^16.5.0",
|
|
65
|
+
"eslint": "^8.56.0",
|
|
66
|
+
"eslint-config-prettier": "^10.0.0",
|
|
67
|
+
"eslint-plugin-file-progress": "^1.4.0",
|
|
68
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
69
|
+
"eslint-plugin-sonarjs": "^3.0.0",
|
|
70
|
+
"playwright": "^1",
|
|
71
|
+
"prettier": "^3.3.3",
|
|
72
|
+
"prettier-plugin-sh": "^0.17.0",
|
|
73
|
+
"rimraf": "^6.0.1",
|
|
74
|
+
"tsx": "^4.20.3",
|
|
75
|
+
"turndown": "^7.1.3",
|
|
76
|
+
"turndown-plugin-gfm": "^1.0.2",
|
|
77
|
+
"typescript": "^5.8.3",
|
|
78
|
+
"vitest": "^3.2.4"
|
|
51
79
|
}
|
|
52
80
|
}
|
package/LICENSE
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity granting the License.
|
|
13
|
-
|
|
14
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
15
|
-
other entities that control, are controlled by, or are under common
|
|
16
|
-
control with that entity. For the purposes of this definition,
|
|
17
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
18
|
-
direction or management of such entity, whether by contract or
|
|
19
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
20
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
21
|
-
|
|
22
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
23
|
-
exercising permissions granted by this License.
|
|
24
|
-
|
|
25
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
26
|
-
including but not limited to software source code, documentation
|
|
27
|
-
source, and configuration files.
|
|
28
|
-
|
|
29
|
-
"Object" form shall mean any form resulting from mechanical
|
|
30
|
-
transformation or translation of a Source form, including but
|
|
31
|
-
not limited to compiled object code, generated documentation,
|
|
32
|
-
and conversions to other media types.
|
|
33
|
-
|
|
34
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
35
|
-
Object form, made available under the License, as indicated by a
|
|
36
|
-
copyright notice that is included in or attached to the work
|
|
37
|
-
(which shall not include in the License file).
|
|
38
|
-
|
|
39
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
-
form, that is based upon (or derived from) the Work and for which the
|
|
41
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
42
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
43
|
-
of this License, Derivative Works shall not include works that remain
|
|
44
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
45
|
-
the Work and derivative works thereof.
|
|
46
|
-
|
|
47
|
-
"Contribution" shall mean any work of authorship, including
|
|
48
|
-
the original version of the Work and any modifications or additions
|
|
49
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
50
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
51
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
52
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
53
|
-
means any form of electronic, verbal, or written communication sent
|
|
54
|
-
to the Licensor or its representatives, including but not limited to
|
|
55
|
-
communication on electronic mailing lists, source code control
|
|
56
|
-
systems, and issue tracking systems that are managed by, or on behalf
|
|
57
|
-
of, the Licensor for the purpose of discussing and improving the Work,
|
|
58
|
-
but excluding communication that is conspicuously marked or otherwise
|
|
59
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
60
|
-
|
|
61
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
62
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
63
|
-
subsequently incorporated within the Work.
|
|
64
|
-
|
|
65
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
66
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
67
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
68
|
-
copyright license to use, reproduce, modify, merge, publish,
|
|
69
|
-
distribute, sublicense, and/or sell copies of the Work, and to
|
|
70
|
-
permit persons to whom the Work is furnished to do so, subject to
|
|
71
|
-
the following conditions:
|
|
72
|
-
|
|
73
|
-
The above copyright notice and this permission notice shall be
|
|
74
|
-
included in all copies or substantial portions of the Work.
|
|
75
|
-
|
|
76
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
77
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
78
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
79
|
-
(except as stated in this section) patent license to make, have made,
|
|
80
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
81
|
-
where such license applies only to those patent claims licensable
|
|
82
|
-
by such Contributor that are necessarily infringed by their
|
|
83
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
84
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
85
|
-
institute patent litigation against any entity (including a
|
|
86
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
87
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
88
|
-
or contributory patent infringement, then any patent licenses
|
|
89
|
-
granted to You under this License for that Work shall terminate
|
|
90
|
-
as of the date such litigation is filed.
|
|
91
|
-
|
|
92
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
93
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
94
|
-
modifications, and in Source or Object form, provided that You
|
|
95
|
-
meet the following conditions:
|
|
96
|
-
|
|
97
|
-
(a) You must give any other recipients of the Work or
|
|
98
|
-
Derivative Works a copy of this License; and
|
|
99
|
-
|
|
100
|
-
(b) You must cause any modified files to carry prominent notices
|
|
101
|
-
stating that You changed the files; and
|
|
102
|
-
|
|
103
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
104
|
-
that You distribute, all copyright, patent, trademark, and
|
|
105
|
-
attribution notices from the Source form of the Work,
|
|
106
|
-
excluding those notices that do not pertain to any part of
|
|
107
|
-
the Derivative Works; and
|
|
108
|
-
|
|
109
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
110
|
-
distribution, then any Derivative Works that You distribute must
|
|
111
|
-
include a readable copy of the attribution notices contained
|
|
112
|
-
within such NOTICE file, excluding those notices that do not
|
|
113
|
-
pertain to any part of the Derivative Works, in at least one
|
|
114
|
-
of the following places: within a NOTICE text file distributed
|
|
115
|
-
as part of the Derivative Works; within the Source form or
|
|
116
|
-
documentation, if provided along with the Derivative Works; or,
|
|
117
|
-
within a display generated by the Derivative Works, if and
|
|
118
|
-
wherever such third-party notices normally appear. The contents
|
|
119
|
-
of the NOTICE file are for informational purposes only and
|
|
120
|
-
do not modify the License. You may add Your own attribution
|
|
121
|
-
notices within Derivative Works that You distribute, alongside
|
|
122
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
123
|
-
that such additional attribution notices cannot be construed
|
|
124
|
-
as modifying the License.
|
|
125
|
-
|
|
126
|
-
You may add Your own copyright notice to Your modifications and
|
|
127
|
-
may provide additional or different license terms and conditions
|
|
128
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
129
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
130
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
131
|
-
the conditions stated in this License.
|
|
132
|
-
|
|
133
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
134
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
135
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
136
|
-
this License, without any additional terms or conditions.
|
|
137
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
138
|
-
the terms of any separate license agreement you may have executed
|
|
139
|
-
with Licensor regarding such Contributions.
|
|
140
|
-
|
|
141
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
142
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
143
|
-
except as required for reasonable and customary use in describing the
|
|
144
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
145
|
-
|
|
146
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
147
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
148
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
149
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
150
|
-
implied, including, without limitation, any warranties or conditions
|
|
151
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
152
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
153
|
-
appropriateness of using or redistributing the Work and assume any
|
|
154
|
-
risks associated with Your exercise of permissions under this License.
|
|
155
|
-
|
|
156
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
157
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
158
|
-
unless required by applicable law (such as deliberate and grossly
|
|
159
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
160
|
-
liable to You for damages, including any direct, indirect, special,
|
|
161
|
-
incidental, or consequential damages of any character arising as a
|
|
162
|
-
result of this License or out of the use or inability to use the
|
|
163
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
164
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
165
|
-
other commercial damages or losses), even if such Contributor
|
|
166
|
-
has been advised of the possibility of such damages.
|
|
167
|
-
|
|
168
|
-
9. Accepting Warranty or Additional Liability. When redistributing
|
|
169
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
170
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
171
|
-
or other liability obligations and/or rights consistent with this
|
|
172
|
-
License. However, in accepting such obligations, You may act only
|
|
173
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
174
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
175
|
-
defend, and hold each Contributor harmless for any liability
|
|
176
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
177
|
-
of your accepting any such warranty or additional liability.
|
|
178
|
-
|
|
179
|
-
END OF TERMS AND CONDITIONS
|
|
180
|
-
|
|
181
|
-
Copyright 2025 Iress
|
|
182
|
-
|
|
183
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
184
|
-
you may not use this file except in compliance with the License.
|
|
185
|
-
You may obtain a copy of the License at
|
|
186
|
-
|
|
187
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
188
|
-
|
|
189
|
-
Unless required by applicable law or agreed to in writing, software
|
|
190
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
191
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
192
|
-
See the License for the specific language governing permissions and
|
|
193
|
-
limitations under the License.
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool handlers for component-related operations
|
|
3
|
-
*/
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
import * as path from "path";
|
|
6
|
-
import { getMarkdownFiles, mapIressComponentToFile, extractIressComponents, readFileContent, } from "./utils.js";
|
|
7
|
-
import { DOCS_DIR } from "./config.js";
|
|
8
|
-
export function handleFindComponent(args) {
|
|
9
|
-
const schema = z.object({
|
|
10
|
-
query: z.string(),
|
|
11
|
-
category: z.enum(["components", "foundations", "resources"]).optional(),
|
|
12
|
-
});
|
|
13
|
-
const { query, category } = schema.parse(args);
|
|
14
|
-
// Check if query is an Iress component name
|
|
15
|
-
if (query.startsWith("Iress")) {
|
|
16
|
-
const componentFile = mapIressComponentToFile(query);
|
|
17
|
-
if (componentFile) {
|
|
18
|
-
return {
|
|
19
|
-
content: [
|
|
20
|
-
{
|
|
21
|
-
type: "text",
|
|
22
|
-
text: `Found exact match for **${query}**:\n\n**${componentFile}**\n ${query} component documentation\n\n*Use \`get_iress_component_info\` with "${query}" for detailed information.*`,
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const markdownFiles = getMarkdownFiles();
|
|
29
|
-
// Filter files by category if specified
|
|
30
|
-
const filteredFiles = category
|
|
31
|
-
? markdownFiles.filter((file) => file.startsWith(`${category}-`))
|
|
32
|
-
: markdownFiles;
|
|
33
|
-
const results = [];
|
|
34
|
-
for (const file of filteredFiles) {
|
|
35
|
-
try {
|
|
36
|
-
const filePath = path.join(DOCS_DIR, file);
|
|
37
|
-
const content = readFileContent(filePath);
|
|
38
|
-
const lines = content.split("\n");
|
|
39
|
-
// Score relevance based on query matches in titles and content
|
|
40
|
-
let relevanceScore = 0;
|
|
41
|
-
const queryLower = query.toLowerCase();
|
|
42
|
-
const filenameLower = file.toLowerCase();
|
|
43
|
-
// Check for Iress component mentions in content
|
|
44
|
-
const iressComponents = extractIressComponents(content);
|
|
45
|
-
const hasMatchingIressComponent = iressComponents.some((comp) => comp.toLowerCase().includes(queryLower) ||
|
|
46
|
-
queryLower.includes(comp.toLowerCase().replace("iress", "")));
|
|
47
|
-
if (hasMatchingIressComponent) {
|
|
48
|
-
relevanceScore += 75;
|
|
49
|
-
}
|
|
50
|
-
// High relevance for filename matches
|
|
51
|
-
if (filenameLower.includes(queryLower)) {
|
|
52
|
-
relevanceScore += 100;
|
|
53
|
-
}
|
|
54
|
-
// Medium relevance for title matches
|
|
55
|
-
const title = lines.find((line) => line.startsWith("#"))?.replace(/^#+\s*/, "") || "";
|
|
56
|
-
if (title.toLowerCase().includes(queryLower)) {
|
|
57
|
-
relevanceScore += 50;
|
|
58
|
-
}
|
|
59
|
-
// Lower relevance for content matches
|
|
60
|
-
const contentMatches = content.toLowerCase().split(queryLower).length - 1;
|
|
61
|
-
relevanceScore += contentMatches * 2;
|
|
62
|
-
if (relevanceScore > 0) {
|
|
63
|
-
const componentName = file
|
|
64
|
-
.replace(/^components-/, "")
|
|
65
|
-
.replace("-docs.md", "");
|
|
66
|
-
const description = lines
|
|
67
|
-
.slice(0, 10)
|
|
68
|
-
.find((line) => line.trim() && !line.startsWith("#") && !line.startsWith("<!--"))
|
|
69
|
-
?.trim() || "IDS component documentation";
|
|
70
|
-
results.push({
|
|
71
|
-
file,
|
|
72
|
-
relevance: relevanceScore,
|
|
73
|
-
description: `${componentName}: ${description}`,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
catch (error) {
|
|
78
|
-
console.error(`Error reading file ${file}:`, error);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
// Sort by relevance
|
|
82
|
-
results.sort((a, b) => b.relevance - a.relevance);
|
|
83
|
-
return {
|
|
84
|
-
content: [
|
|
85
|
-
{
|
|
86
|
-
type: "text",
|
|
87
|
-
text: results.length > 0
|
|
88
|
-
? `Found ${results.length} relevant IDS components:\n\n${results
|
|
89
|
-
.slice(0, 10) // Limit to top 10 results
|
|
90
|
-
.map((r, index) => `${index + 1}. **${r.file}**\n ${r.description}`)
|
|
91
|
-
.join("\n\n")}`
|
|
92
|
-
: `No IDS components found matching "${query}". Try searching for common component names like "button", "input", "table", or "modal".`,
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
export function handleGetComponentProps(args) {
|
|
98
|
-
const schema = z.object({
|
|
99
|
-
component: z.string(),
|
|
100
|
-
});
|
|
101
|
-
const { component } = schema.parse(args);
|
|
102
|
-
const markdownFiles = getMarkdownFiles();
|
|
103
|
-
// Find the component file
|
|
104
|
-
const componentFile = markdownFiles.find((file) => file.includes(`components-${component.toLowerCase()}`) ||
|
|
105
|
-
file.toLowerCase().includes(component.toLowerCase()));
|
|
106
|
-
if (!componentFile) {
|
|
107
|
-
return {
|
|
108
|
-
content: [
|
|
109
|
-
{
|
|
110
|
-
type: "text",
|
|
111
|
-
text: `Component "${component}" not found. Available components:\n${markdownFiles
|
|
112
|
-
.filter((f) => f.startsWith("components-"))
|
|
113
|
-
.map((f) => `- ${f.replace("components-", "").replace("-docs.md", "")}`)
|
|
114
|
-
.join("\n")}`,
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
try {
|
|
120
|
-
const filePath = path.join(DOCS_DIR, componentFile);
|
|
121
|
-
const content = readFileContent(filePath);
|
|
122
|
-
// Extract prop information, modes, examples
|
|
123
|
-
const lines = content.split("\n");
|
|
124
|
-
const propSections = [];
|
|
125
|
-
let inPropsSection = false;
|
|
126
|
-
let currentSection = "";
|
|
127
|
-
for (const line of lines) {
|
|
128
|
-
if (line.includes("mode") ||
|
|
129
|
-
line.includes("prop") ||
|
|
130
|
-
line.includes("Properties") ||
|
|
131
|
-
line.includes("API") ||
|
|
132
|
-
line.includes("Examples")) {
|
|
133
|
-
if (currentSection) {
|
|
134
|
-
propSections.push(currentSection);
|
|
135
|
-
}
|
|
136
|
-
currentSection = line + "\n";
|
|
137
|
-
inPropsSection = true;
|
|
138
|
-
}
|
|
139
|
-
else if (inPropsSection && line.trim()) {
|
|
140
|
-
currentSection += line + "\n";
|
|
141
|
-
}
|
|
142
|
-
else if (inPropsSection && !line.trim()) {
|
|
143
|
-
if (currentSection) {
|
|
144
|
-
propSections.push(currentSection);
|
|
145
|
-
currentSection = "";
|
|
146
|
-
}
|
|
147
|
-
inPropsSection = false;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
if (currentSection) {
|
|
151
|
-
propSections.push(currentSection);
|
|
152
|
-
}
|
|
153
|
-
return {
|
|
154
|
-
content: [
|
|
155
|
-
{
|
|
156
|
-
type: "text",
|
|
157
|
-
text: `**${component} Component Props & API**\n\n${propSections.length > 0
|
|
158
|
-
? propSections.join("\n---\n\n")
|
|
159
|
-
: `Props information extracted from ${componentFile}:\n\n${content.slice(0, 2000)}...`}`,
|
|
160
|
-
},
|
|
161
|
-
],
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
catch (error) {
|
|
165
|
-
throw new Error(`Failed to read component file ${componentFile}: ${error}`);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
export function handleListComponents(args) {
|
|
169
|
-
const schema = z.object({
|
|
170
|
-
category: z
|
|
171
|
-
.enum(["components", "foundations", "resources", "all"])
|
|
172
|
-
.default("all"),
|
|
173
|
-
});
|
|
174
|
-
const { category } = schema.parse(args);
|
|
175
|
-
const markdownFiles = getMarkdownFiles();
|
|
176
|
-
const categorized = {
|
|
177
|
-
components: markdownFiles
|
|
178
|
-
.filter((f) => f.startsWith("components-"))
|
|
179
|
-
.map((f) => f.replace("components-", "").replace("-docs.md", "")),
|
|
180
|
-
foundations: markdownFiles
|
|
181
|
-
.filter((f) => f.startsWith("foundations-"))
|
|
182
|
-
.map((f) => f.replace("foundations-", "").replace("-docs.md", "")),
|
|
183
|
-
resources: markdownFiles
|
|
184
|
-
.filter((f) => f.startsWith("resources-"))
|
|
185
|
-
.map((f) => f.replace("resources-", "").replace("-docs.md", "")),
|
|
186
|
-
};
|
|
187
|
-
let output = "**IDS Component Library**\n\n";
|
|
188
|
-
if (category === "all") {
|
|
189
|
-
output += `**Components (${categorized.components.length})**\n${categorized.components.map((c) => `- ${c}`).join("\n")}\n\n`;
|
|
190
|
-
output += `**Foundations (${categorized.foundations.length})**\n${categorized.foundations.map((c) => `- ${c}`).join("\n")}\n\n`;
|
|
191
|
-
output += `**Resources (${categorized.resources.length})**\n${categorized.resources.map((c) => `- ${c}`).join("\n")}`;
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
const items = categorized[category];
|
|
195
|
-
output += `**${category.charAt(0).toUpperCase() + category.slice(1)} (${items.length})**\n${items.map((c) => `- ${c}`).join("\n")}`;
|
|
196
|
-
}
|
|
197
|
-
return {
|
|
198
|
-
content: [
|
|
199
|
-
{
|
|
200
|
-
type: "text",
|
|
201
|
-
text: output,
|
|
202
|
-
},
|
|
203
|
-
],
|
|
204
|
-
};
|
|
205
|
-
}
|
package/build/index.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
-
import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
-
import { SERVER_CONFIG, CAPABILITIES } from "./config.js";
|
|
6
|
-
import { toolDefinitions } from "./tools.js";
|
|
7
|
-
import { handleToolCall } from "./toolHandler.js";
|
|
8
|
-
import { handleListResources, handleReadResource } from "./resourceHandlers.js";
|
|
9
|
-
/**
|
|
10
|
-
* Create MCP server for Iress Design System (IDS) component library context
|
|
11
|
-
*/
|
|
12
|
-
const server = new Server(SERVER_CONFIG, { capabilities: CAPABILITIES });
|
|
13
|
-
/**
|
|
14
|
-
* List available IDS component documentation resources
|
|
15
|
-
*/
|
|
16
|
-
server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
|
17
|
-
return handleListResources();
|
|
18
|
-
});
|
|
19
|
-
/**
|
|
20
|
-
* Read content from a specific markdown file
|
|
21
|
-
*/
|
|
22
|
-
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
23
|
-
return handleReadResource(request);
|
|
24
|
-
});
|
|
25
|
-
/**
|
|
26
|
-
* List available IDS development tools
|
|
27
|
-
*/
|
|
28
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
29
|
-
return {
|
|
30
|
-
tools: toolDefinitions,
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
/**
|
|
34
|
-
* Handle IDS component library tool calls
|
|
35
|
-
*/
|
|
36
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
37
|
-
const result = handleToolCall(request);
|
|
38
|
-
return result;
|
|
39
|
-
});
|
|
40
|
-
/**
|
|
41
|
-
* Start the server
|
|
42
|
-
*/
|
|
43
|
-
async function main() {
|
|
44
|
-
const transport = new StdioServerTransport();
|
|
45
|
-
await server.connect(transport);
|
|
46
|
-
console.error("IDS Component Library MCP Server running on stdio");
|
|
47
|
-
}
|
|
48
|
-
main().catch((error) => {
|
|
49
|
-
console.error("Server error:", error);
|
|
50
|
-
process.exit(1);
|
|
51
|
-
});
|