@rushstack/rush-mcp-docs-plugin 0.1.0

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/CHANGELOG.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@rushstack/rush-mcp-docs-plugin",
3
+ "entries": [
4
+ {
5
+ "version": "0.1.0",
6
+ "tag": "@rushstack/rush-mcp-docs-plugin_v0.1.0",
7
+ "date": "Sat, 14 Jun 2025 00:11:30 GMT",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "comment": "Add rush docs mcp plugin"
12
+ }
13
+ ],
14
+ "dependency": [
15
+ {
16
+ "comment": "Updating dependency \"@rushstack/mcp-server\" to `0.2.2`"
17
+ }
18
+ ]
19
+ }
20
+ }
21
+ ]
22
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Change Log - @rushstack/rush-mcp-docs-plugin
2
+
3
+ This log was last generated on Sat, 14 Jun 2025 00:11:30 GMT and should not be manually modified.
4
+
5
+ ## 0.1.0
6
+ Sat, 14 Jun 2025 00:11:30 GMT
7
+
8
+ ### Minor changes
9
+
10
+ - Add rush docs mcp plugin
11
+
package/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ @rushstack/rush-mcp-docs-plugin
2
+
3
+ Copyright (c) Microsoft Corporation. All rights reserved.
4
+
5
+ MIT License
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining
8
+ a copy of this software and associated documentation files (the
9
+ "Software"), to deal in the Software without restriction, including
10
+ without limitation the rights to use, copy, modify, merge, publish,
11
+ distribute, sublicense, and/or sell copies of the Software, and to
12
+ permit persons to whom the Software is furnished to do so, subject to
13
+ the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be
16
+ included in all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @rushstack/rush-mcp-docs-plugin
2
+
3
+ The @rushstack/rush-mcp-docs-plugin package provides a documentation query tool for Rush.
@@ -0,0 +1,10 @@
1
+ import type { IRushMcpPlugin, RushMcpPluginSession } from '@rushstack/mcp-server';
2
+ export interface IDocsPluginConfigFile {
3
+ }
4
+ export declare class DocsPlugin implements IRushMcpPlugin {
5
+ session: RushMcpPluginSession;
6
+ configFile: IDocsPluginConfigFile | undefined;
7
+ constructor(session: RushMcpPluginSession, configFile: IDocsPluginConfigFile | undefined);
8
+ onInitializeAsync(): Promise<void>;
9
+ }
10
+ //# sourceMappingURL=DocsPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocsPlugin.d.ts","sourceRoot":"","sources":["../src/DocsPlugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAGlF,MAAM,WAAW,qBAAqB;CAAG;AAEzC,qBAAa,UAAW,YAAW,cAAc;IACxC,OAAO,EAAE,oBAAoB,CAAC;IAC9B,UAAU,EAAE,qBAAqB,GAAG,SAAS,CAAa;gBAE9C,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,qBAAqB,GAAG,SAAS;IAKlF,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;CAUhD"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
+ // See LICENSE in the project root for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.DocsPlugin = void 0;
6
+ const DocsTool_1 = require("./DocsTool");
7
+ class DocsPlugin {
8
+ constructor(session, configFile) {
9
+ this.configFile = undefined;
10
+ this.session = session;
11
+ this.configFile = configFile;
12
+ }
13
+ async onInitializeAsync() {
14
+ this.session.registerTool({
15
+ toolName: 'rush_docs',
16
+ description: 'Search and retrieve relevant sections from the official Rush documentation based on user queries.'
17
+ }, new DocsTool_1.DocsTool(this));
18
+ }
19
+ }
20
+ exports.DocsPlugin = DocsPlugin;
21
+ //# sourceMappingURL=DocsPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocsPlugin.js","sourceRoot":"","sources":["../src/DocsPlugin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,yCAAsC;AAItC,MAAa,UAAU;IAIrB,YAAmB,OAA6B,EAAE,UAA6C;QAFxF,eAAU,GAAsC,SAAS,CAAC;QAG/D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAEM,KAAK,CAAC,iBAAiB;QAC5B,IAAI,CAAC,OAAO,CAAC,YAAY,CACvB;YACE,QAAQ,EAAE,WAAW;YACrB,WAAW,EACT,mGAAmG;SACtG,EACD,IAAI,mBAAQ,CAAC,IAAI,CAAC,CACnB,CAAC;IACJ,CAAC;CACF;AAnBD,gCAmBC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { IRushMcpPlugin, RushMcpPluginSession } from '@rushstack/mcp-server';\nimport { DocsTool } from './DocsTool';\n\nexport interface IDocsPluginConfigFile {}\n\nexport class DocsPlugin implements IRushMcpPlugin {\n public session: RushMcpPluginSession;\n public configFile: IDocsPluginConfigFile | undefined = undefined;\n\n public constructor(session: RushMcpPluginSession, configFile: IDocsPluginConfigFile | undefined) {\n this.session = session;\n this.configFile = configFile;\n }\n\n public async onInitializeAsync(): Promise<void> {\n this.session.registerTool(\n {\n toolName: 'rush_docs',\n description:\n 'Search and retrieve relevant sections from the official Rush documentation based on user queries.'\n },\n new DocsTool(this)\n );\n }\n}\n"]}
@@ -0,0 +1,17 @@
1
+ import type { IRushMcpTool, RushMcpPluginSession, CallToolResult, zodModule } from '@rushstack/mcp-server';
2
+ import type { DocsPlugin } from './DocsPlugin';
3
+ export declare class DocsTool implements IRushMcpTool<DocsTool['schema']> {
4
+ readonly plugin: DocsPlugin;
5
+ readonly session: RushMcpPluginSession;
6
+ constructor(plugin: DocsPlugin);
7
+ get schema(): zodModule.ZodObject<{
8
+ userQuery: zodModule.ZodString;
9
+ }, "strip", zodModule.ZodTypeAny, {
10
+ userQuery: string;
11
+ }, {
12
+ userQuery: string;
13
+ }>;
14
+ private _searchDocs;
15
+ executeAsync({ userQuery }: zodModule.infer<DocsTool['schema']>): Promise<CallToolResult>;
16
+ }
17
+ //# sourceMappingURL=DocsTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocsTool.d.ts","sourceRoot":"","sources":["../src/DocsTool.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAI3G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAY/C,qBAAa,QAAS,YAAW,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC/D,SAAgB,MAAM,EAAE,UAAU,CAAC;IACnC,SAAgB,OAAO,EAAE,oBAAoB,CAAC;gBAE3B,MAAM,EAAE,UAAU;IAOrC,IAAW,MAAM;;;;;;OAMhB;IAGD,OAAO,CAAC,WAAW;IAeN,YAAY,CAAC,EAAE,SAAS,EAAE,EAAE,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;CAYvG"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
+ // See LICENSE in the project root for license information.
4
+ var __importDefault = (this && this.__importDefault) || function (mod) {
5
+ return (mod && mod.__esModule) ? mod : { "default": mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.DocsTool = void 0;
9
+ const node_core_library_1 = require("@rushstack/node-core-library");
10
+ const path_1 = __importDefault(require("path"));
11
+ class DocsTool {
12
+ constructor(plugin) {
13
+ this.plugin = plugin;
14
+ this.session = plugin.session;
15
+ }
16
+ // ZOD relies on type inference generate a messy expression in the .d.ts file
17
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
18
+ get schema() {
19
+ const zod = this.session.zod;
20
+ return zod.object({
21
+ userQuery: zod.string().describe('The user query to search for relevant documentation sections.')
22
+ });
23
+ }
24
+ // TODO: replace with Microsoft's service
25
+ _searchDocs(query) {
26
+ const startTime = Date.now();
27
+ const results = node_core_library_1.JsonFile.load(path_1.default.join(__dirname, './rush-doc-fragment.mock.json'));
28
+ return {
29
+ query,
30
+ results,
31
+ count: results.length,
32
+ searchTimeMs: Date.now() - startTime
33
+ };
34
+ }
35
+ async executeAsync({ userQuery }) {
36
+ const docSearchResult = this._searchDocs(userQuery);
37
+ return {
38
+ content: [
39
+ {
40
+ type: 'text',
41
+ text: docSearchResult.results.map((item) => item.text).join('\n\n')
42
+ }
43
+ ]
44
+ };
45
+ }
46
+ }
47
+ exports.DocsTool = DocsTool;
48
+ //# sourceMappingURL=DocsTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocsTool.js","sourceRoot":"","sources":["../src/DocsTool.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;AAG3D,oEAAwD;AACxD,gDAAwB;AAcxB,MAAa,QAAQ;IAInB,YAAmB,MAAkB;QACnC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,6EAA6E;IAC7E,4EAA4E;IAC5E,IAAW,MAAM;QACf,MAAM,GAAG,GAAqB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;QAE/C,OAAO,GAAG,CAAC,MAAM,CAAC;YAChB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+DAA+D,CAAC;SAClG,CAAC,CAAC;IACL,CAAC;IAED,yCAAyC;IACjC,WAAW,CAAC,KAAa;QAC/B,MAAM,SAAS,GAAW,IAAI,CAAC,GAAG,EAAE,CAAC;QAErC,MAAM,OAAO,GAA2B,4BAAQ,CAAC,IAAI,CACnD,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,+BAA+B,CAAC,CACtD,CAAC;QAEF,OAAO;YACL,KAAK;YACL,OAAO;YACP,KAAK,EAAE,OAAO,CAAC,MAAM;YACrB,YAAY,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;SACrC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,EAAE,SAAS,EAAuC;QAC1E,MAAM,eAAe,GAAgB,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAEjE,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;iBACpE;aACF;SACF,CAAC;IACJ,CAAC;CACF;AA/CD,4BA+CC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { IRushMcpTool, RushMcpPluginSession, CallToolResult, zodModule } from '@rushstack/mcp-server';\nimport { JsonFile } from '@rushstack/node-core-library';\nimport path from 'path';\n\nimport type { DocsPlugin } from './DocsPlugin';\n\ninterface IDocsResult {\n query: string;\n results: {\n score: number;\n text: string;\n }[];\n count: number;\n searchTimeMs: number;\n}\n\nexport class DocsTool implements IRushMcpTool<DocsTool['schema']> {\n public readonly plugin: DocsPlugin;\n public readonly session: RushMcpPluginSession;\n\n public constructor(plugin: DocsPlugin) {\n this.plugin = plugin;\n this.session = plugin.session;\n }\n\n // ZOD relies on type inference generate a messy expression in the .d.ts file\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n public get schema() {\n const zod: typeof zodModule = this.session.zod;\n\n return zod.object({\n userQuery: zod.string().describe('The user query to search for relevant documentation sections.')\n });\n }\n\n // TODO: replace with Microsoft's service\n private _searchDocs(query: string): IDocsResult {\n const startTime: number = Date.now();\n\n const results: IDocsResult['results'] = JsonFile.load(\n path.join(__dirname, './rush-doc-fragment.mock.json')\n );\n\n return {\n query,\n results,\n count: results.length,\n searchTimeMs: Date.now() - startTime\n };\n }\n\n public async executeAsync({ userQuery }: zodModule.infer<DocsTool['schema']>): Promise<CallToolResult> {\n const docSearchResult: IDocsResult = this._searchDocs(userQuery);\n\n return {\n content: [\n {\n type: 'text',\n text: docSearchResult.results.map((item) => item.text).join('\\n\\n')\n }\n ]\n };\n }\n}\n"]}
package/lib/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import type { RushMcpPluginSession } from '@rushstack/mcp-server';
2
+ import { DocsPlugin, type IDocsPluginConfigFile } from './DocsPlugin';
3
+ declare function createPlugin(session: RushMcpPluginSession, configFile: IDocsPluginConfigFile | undefined): DocsPlugin;
4
+ declare const _default: typeof createPlugin;
5
+ export default _default;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAwB,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAEtE,iBAAS,YAAY,CACnB,OAAO,EAAE,oBAAoB,EAC7B,UAAU,EAAE,qBAAqB,GAAG,SAAS,GAC5C,UAAU,CAEZ;;AAED,wBAAkF"}
package/lib/index.js ADDED
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
+ // See LICENSE in the project root for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ const DocsPlugin_1 = require("./DocsPlugin");
6
+ function createPlugin(session, configFile) {
7
+ return new DocsPlugin_1.DocsPlugin(session, configFile);
8
+ }
9
+ exports.default = createPlugin;
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AAG3D,6CAAsE;AAEtE,SAAS,YAAY,CACnB,OAA6B,EAC7B,UAA6C;IAE7C,OAAO,IAAI,uBAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAC7C,CAAC;AAED,kBAAe,YAAkE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { RushMcpPluginSession, RushMcpPluginFactory } from '@rushstack/mcp-server';\nimport { DocsPlugin, type IDocsPluginConfigFile } from './DocsPlugin';\n\nfunction createPlugin(\n session: RushMcpPluginSession,\n configFile: IDocsPluginConfigFile | undefined\n): DocsPlugin {\n return new DocsPlugin(session, configFile);\n}\n\nexport default createPlugin satisfies RushMcpPluginFactory<IDocsPluginConfigFile>;\n"]}
@@ -0,0 +1,18 @@
1
+ [
2
+ {
3
+ "text": "---\ntitle: rush install-autoinstaller\n---\n\n```\nusage: rush install-autoinstaller [-h] --name AUTOINSTALLER_NAME\n\nUse this command to install dependencies for an autoinstaller folder.\n\nOptional arguments:\n -h, --help Show this help message and exit.\n --name AUTOINSTALLER_NAME\n The name of the autoinstaller, which must be one of\n the folders under common/autoinstallers.\n```\n\n## See also\n\n- [rush update-autoinstaller](../commands/rush_update-autoinstaller.md)\n- [rush init-autoinstaller](../commands/rush_init-autoinstaller.md)",
4
+ "score": 0.7231232
5
+ },
6
+ {
7
+ "text": "---\ntitle: rush install-autoinstaller\n---\n\n```\n用法:rush install-autoinstaller [-h] --name AUTOINSTALLER_NAME\n\n使用该指令给一个项目安装依赖。\n\n可选参数:\n -h, --help 展示帮助信息并退出\n --name AUTOINSTALLER_NAME\n 指定自动安装的包名,它必须是 common/autoinstallers\n 下的一个文件夹。\n```\n\n## See also\n\n- [rush update-autoinstaller](../commands/rush_update-autoinstaller.md)\n- [rush init-autoinstaller](../commands/rush_init-autoinstaller.md)",
8
+ "score": 0.7132133
9
+ },
10
+ {
11
+ "text": "---\ntitle: rush update-autoinstaller\n---\n\n```\nusage: rush update-autoinstaller [-h] --name AUTOINSTALLER_NAME\n\nUse this command to regenerate the shrinkwrap file for an autoinstaller\nfolder.\n\nOptional arguments:\n -h, --help Show this help message and exit.\n --name AUTOINSTALLER_NAME\n The name of the autoinstaller, which must be one of\n the folders under common/autoinstallers.\n```\n\n## See also\n\n- [rush install-autoinstaller](../commands/rush_install-autoinstaller.md)\n- [rush init-autoinstaller](../commands/rush_init-autoinstaller.md)",
12
+ "score": 0.6632131
13
+ },
14
+ {
15
+ "text": "---\ntitle: rush update-autoinstaller\n---\n\n```\nusage: rush update-autoinstaller [-h] --name AUTOINSTALLER_NAME\n\nUse this command to regenerate the shrinkwrap file for an autoinstaller\nfolder.\n\nOptional arguments:\n -h, --help Show this help message and exit.\n --name AUTOINSTALLER_NAME\n The name of the autoinstaller, which must be one of\n the folders under common/autoinstallers.\n```\n\n## See also\n\n- [rush install-autoinstaller](../commands/rush_install-autoinstaller.md)\n- [rush init-autoinstaller](../commands/rush_init-autoinstaller.md)",
16
+ "score": 0.6528328
17
+ }
18
+ ]
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@rushstack/rush-mcp-docs-plugin",
3
+ "version": "0.1.0",
4
+ "description": "Docs plugin for @rushstack/mcp-server",
5
+ "repository": {
6
+ "url": "https://github.com/microsoft/rushstack.git",
7
+ "type": "git",
8
+ "directory": "rush-plugins/rush-mcp-docs-plugin"
9
+ },
10
+ "homepage": "https://rushjs.io",
11
+ "main": "lib/index.js",
12
+ "types": "lib/index.d.ts",
13
+ "license": "MIT",
14
+ "dependencies": {
15
+ "@rushstack/mcp-server": "0.2.2",
16
+ "@rushstack/node-core-library": "5.13.1"
17
+ },
18
+ "devDependencies": {
19
+ "@rushstack/heft": "0.73.6",
20
+ "local-node-rig": "1.0.0",
21
+ "local-eslint-config": "1.0.0"
22
+ },
23
+ "scripts": {
24
+ "build": "heft build --clean",
25
+ "_phase:build": "heft run --only build -- --clean",
26
+ "_phase:test": "heft run --only test -- --clean"
27
+ }
28
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Every plugin package must contain a "rush-mcp-plugin.json" manifest in the top-level folder
3
+ * (next to package.json).
4
+ */
5
+ {
6
+ /**
7
+ * A name that uniquely identifies your plugin. Generally this should be the same name as
8
+ * the NPM package. If two NPM packages have the same pluginName, they cannot be loaded together.
9
+ */
10
+ "pluginName": "rush-mcp-docs-plugin",
11
+
12
+ /**
13
+ * (OPTIONAL) Indicates that your plugin accepts a config file. The MCP server will load this
14
+ * file and provide it to the plugin.
15
+ *
16
+ * The config file path will be `<rush-repo>/common/config/rush-mcp/<plugin-name>.json`.
17
+ */
18
+ // "configFileSchema": "./lib/rush-mcp-example-plugin.schema.json",
19
+
20
+ /**
21
+ * The entry point, whose default export should be a class that implements
22
+ */
23
+ "entryPoint": "./lib/index.js"
24
+ }