diff --git a/README.md b/README.md index 867da0ed8c6..72a536d7159 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ These GitHub repositories provide supplementary resources for Rush Stack: | [/apps/lockfile-explorer](./apps/lockfile-explorer/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Flockfile-explorer.svg)](https://badge.fury.io/js/%40rushstack%2Flockfile-explorer) | [changelog](./apps/lockfile-explorer/CHANGELOG.md) | [@rushstack/lockfile-explorer](https://www.npmjs.com/package/@rushstack/lockfile-explorer) | | [/apps/rundown](./apps/rundown/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Frundown.svg)](https://badge.fury.io/js/%40rushstack%2Frundown) | [changelog](./apps/rundown/CHANGELOG.md) | [@rushstack/rundown](https://www.npmjs.com/package/@rushstack/rundown) | | [/apps/rush](./apps/rush/) | [![npm version](https://badge.fury.io/js/%40microsoft%2Frush.svg)](https://badge.fury.io/js/%40microsoft%2Frush) | [changelog](./apps/rush/CHANGELOG.md) | [@microsoft/rush](https://www.npmjs.com/package/@microsoft/rush) | +| [/apps/rush-mcp-server](./apps/rush-mcp-server/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Fmcp-server.svg)](https://badge.fury.io/js/%40rushstack%2Fmcp-server) | [changelog](./apps/rush-mcp-server/CHANGELOG.md) | [@rushstack/mcp-server](https://www.npmjs.com/package/@rushstack/mcp-server) | | [/apps/trace-import](./apps/trace-import/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Ftrace-import.svg)](https://badge.fury.io/js/%40rushstack%2Ftrace-import) | [changelog](./apps/trace-import/CHANGELOG.md) | [@rushstack/trace-import](https://www.npmjs.com/package/@rushstack/trace-import) | | [/eslint/eslint-bulk](./eslint/eslint-bulk/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Feslint-bulk.svg)](https://badge.fury.io/js/%40rushstack%2Feslint-bulk) | [changelog](./eslint/eslint-bulk/CHANGELOG.md) | [@rushstack/eslint-bulk](https://www.npmjs.com/package/@rushstack/eslint-bulk) | | [/eslint/eslint-config](./eslint/eslint-config/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Feslint-config.svg)](https://badge.fury.io/js/%40rushstack%2Feslint-config) | [changelog](./eslint/eslint-config/CHANGELOG.md) | [@rushstack/eslint-config](https://www.npmjs.com/package/@rushstack/eslint-config) | diff --git a/apps/rush-mcp-server/.eslintrc.js b/apps/rush-mcp-server/.eslintrc.js new file mode 100644 index 00000000000..27dc0bdff95 --- /dev/null +++ b/apps/rush-mcp-server/.eslintrc.js @@ -0,0 +1,12 @@ +// This is a workaround for https://github.com/eslint/eslint/issues/3458 +require('local-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution'); +// This is a workaround for https://github.com/microsoft/rushstack/issues/3021 +require('local-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names'); + +module.exports = { + extends: [ + 'local-node-rig/profiles/default/includes/eslint/profile/node-trusted-tool', + 'local-node-rig/profiles/default/includes/eslint/mixins/friendly-locals' + ], + parserOptions: { tsconfigRootDir: __dirname } +}; diff --git a/apps/rush-mcp-server/.npmignore b/apps/rush-mcp-server/.npmignore new file mode 100644 index 00000000000..bc349f9a4be --- /dev/null +++ b/apps/rush-mcp-server/.npmignore @@ -0,0 +1,32 @@ +# THIS IS A STANDARD TEMPLATE FOR .npmignore FILES IN THIS REPO. + +# Ignore all files by default, to avoid accidentally publishing unintended files. +* + +# Use negative patterns to bring back the specific things we want to publish. +!/bin/** +!/lib/** +!/lib-*/** +!/dist/** + +!CHANGELOG.md +!CHANGELOG.json +!heft-plugin.json +!rush-plugin-manifest.json +!ThirdPartyNotice.txt + +# Ignore certain patterns that should not get published. +/dist/*.stats.* +/lib/**/test/ +/lib-*/**/test/ +*.test.js + +# NOTE: These don't need to be specified, because NPM includes them automatically. +# +# package.json +# README.md +# LICENSE + +# --------------------------------------------------------------------------- +# DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. +# --------------------------------------------------------------------------- diff --git a/apps/rush-mcp-server/LICENSE b/apps/rush-mcp-server/LICENSE new file mode 100644 index 00000000000..6f51ef8b200 --- /dev/null +++ b/apps/rush-mcp-server/LICENSE @@ -0,0 +1,24 @@ +@rushstack/mcp-server + +Copyright (c) Microsoft Corporation. All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/apps/rush-mcp-server/README.md b/apps/rush-mcp-server/README.md new file mode 100644 index 00000000000..deb4a2c82a7 --- /dev/null +++ b/apps/rush-mcp-server/README.md @@ -0,0 +1,5 @@ +# @rushstack/mcp-server + +## Usage + +## Links diff --git a/apps/rush-mcp-server/bin/mcp-server b/apps/rush-mcp-server/bin/mcp-server new file mode 100644 index 00000000000..aee68e80224 --- /dev/null +++ b/apps/rush-mcp-server/bin/mcp-server @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('../lib/start.js'); diff --git a/apps/rush-mcp-server/config/jest.config.json b/apps/rush-mcp-server/config/jest.config.json new file mode 100644 index 00000000000..d1749681d90 --- /dev/null +++ b/apps/rush-mcp-server/config/jest.config.json @@ -0,0 +1,3 @@ +{ + "extends": "local-node-rig/profiles/default/config/jest.config.json" +} diff --git a/apps/rush-mcp-server/config/rig.json b/apps/rush-mcp-server/config/rig.json new file mode 100644 index 00000000000..165ffb001f5 --- /dev/null +++ b/apps/rush-mcp-server/config/rig.json @@ -0,0 +1,7 @@ +{ + // The "rig.json" file directs tools to look for their config files in an external package. + // Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + + "rigPackageName": "local-node-rig" +} diff --git a/apps/rush-mcp-server/package.json b/apps/rush-mcp-server/package.json new file mode 100644 index 00000000000..24ccd1d4e27 --- /dev/null +++ b/apps/rush-mcp-server/package.json @@ -0,0 +1,33 @@ +{ + "name": "@rushstack/mcp-server", + "version": "0.0.1", + "description": "A Model Context Protocol server implementation for Rush", + "repository": { + "type": "git", + "url": "https://github.com/microsoft/rushstack.git", + "directory": "apps/rush-mcp-server" + }, + "engines": { + "node": ">=10.0.0" + }, + "engineStrict": true, + "homepage": "https://rushstack.io", + "scripts": { + "build": "heft build --clean", + "_phase:build": "heft run --only build -- --clean" + }, + "bin": { + "mcp-server": "./bin/mcp-server" + }, + "license": "MIT", + "dependencies": { + "@rushstack/node-core-library": "workspace:*", + "@rushstack/terminal": "workspace:*", + "@rushstack/ts-command-line": "workspace:*" + }, + "devDependencies": { + "@rushstack/heft": "workspace:*", + "local-node-rig": "workspace:*", + "typescript": "~5.8.2" + } +} diff --git a/apps/rush-mcp-server/src/start.ts b/apps/rush-mcp-server/src/start.ts new file mode 100644 index 00000000000..b2d2e4d1b84 --- /dev/null +++ b/apps/rush-mcp-server/src/start.ts @@ -0,0 +1,2 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. diff --git a/apps/rush-mcp-server/tsconfig.json b/apps/rush-mcp-server/tsconfig.json new file mode 100644 index 00000000000..dac21d04081 --- /dev/null +++ b/apps/rush-mcp-server/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json" +} diff --git a/common/changes/@rushstack/mcp-server/feat-init-rush-mcp-server_2025-04-15-11-41.json b/common/changes/@rushstack/mcp-server/feat-init-rush-mcp-server_2025-04-15-11-41.json new file mode 100644 index 00000000000..6b9a374501b --- /dev/null +++ b/common/changes/@rushstack/mcp-server/feat-init-rush-mcp-server_2025-04-15-11-41.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/mcp-server", + "comment": "Init rush mcp server project", + "type": "minor" + } + ], + "packageName": "@rushstack/mcp-server" +} \ No newline at end of file diff --git a/common/config/subspaces/default/pnpm-lock.yaml b/common/config/subspaces/default/pnpm-lock.yaml index fd3695f48d5..dce21eb77bc 100644 --- a/common/config/subspaces/default/pnpm-lock.yaml +++ b/common/config/subspaces/default/pnpm-lock.yaml @@ -345,6 +345,28 @@ importers: specifier: workspace:* version: link:../../rigs/local-node-rig + ../../../apps/rush-mcp-server: + dependencies: + '@rushstack/node-core-library': + specifier: workspace:* + version: link:../../libraries/node-core-library + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal + '@rushstack/ts-command-line': + specifier: workspace:* + version: link:../../libraries/ts-command-line + devDependencies: + '@rushstack/heft': + specifier: workspace:* + version: link:../heft + local-node-rig: + specifier: workspace:* + version: link:../../rigs/local-node-rig + typescript: + specifier: ~5.8.2 + version: 5.8.2 + ../../../apps/trace-import: dependencies: '@rushstack/node-core-library': diff --git a/rush.json b/rush.json index ab9d9360930..c6f332c3d97 100644 --- a/rush.json +++ b/rush.json @@ -429,6 +429,12 @@ "reviewCategory": "libraries", "shouldPublish": true }, + { + "packageName": "@rushstack/mcp-server", + "projectFolder": "apps/rush-mcp-server", + "reviewCategory": "libraries", + "shouldPublish": true + }, { "packageName": "@microsoft/api-extractor", "projectFolder": "apps/api-extractor",