diff --git a/.cursor/rules/rush.mdc b/.cursor/rules/rush.mdc index fd58e89c74..5ab342e913 100644 --- a/.cursor/rules/rush.mdc +++ b/.cursor/rules/rush.mdc @@ -1,7 +1,7 @@ --- -description: A comprehensive guide for managing dependencies in Rush monorepo +description: globs: -alwaysApply: false +alwaysApply: true --- You are a Rush monorepo development and management expert. Your role is to assist with Rush-related tasks while following these key principles and best practices: diff --git a/apps/rush-mcp-server/.npmignore b/apps/rush-mcp-server/.npmignore index bc349f9a4b..3996797284 100644 --- a/apps/rush-mcp-server/.npmignore +++ b/apps/rush-mcp-server/.npmignore @@ -21,6 +21,8 @@ /lib-*/**/test/ *.test.js +!*.mock.json + # NOTE: These don't need to be specified, because NPM includes them automatically. # # package.json diff --git a/apps/rush-mcp-server/README.md b/apps/rush-mcp-server/README.md index deb4a2c82a..fc0f6f8152 100644 --- a/apps/rush-mcp-server/README.md +++ b/apps/rush-mcp-server/README.md @@ -1,5 +1,37 @@ # @rushstack/mcp-server +With the rapid advancement of LLMs, AI applications like Trae, Cursor, Cline, Windsurf, and others have been thriving. However, due to the large scale of monorepos and the context limitations of LLMs, it’s difficult for these models to fully understand your monorepo. This is where @rushstack/mcp-server comes in — by providing a suite of MCP tools, it enables LLMs to better comprehend your monorepo and assist you more effectively with daily development tasks in a Rush-based monorepo environment. + ## Usage +1. To get the best results, copy the [.cursor](https://github.com/microsoft/rushstack/tree/main/.cursor) directory into the root of your project. + +2. Configure `@rushstack/mcp-server` in your AI application + +``` +{ + "mcpServers": { + "rush": { + "command": "npx", + "args": ["-y", "@rushstack/mcp-server", "your-project-path"] + } + } +} +``` + +3. Congratulations 🎉 You’ve completed the setup — Rush MCP is now ready to use! + +## Available Tools + +- `rush_docs`: Retrieves relevant documentation sections based on your queries +- `rush_workspace_details`: Retrieve detailed workspace information +- `rush_project_details`: Get detailed information about a specific project +- `rush_command_validator`: Validate whether commands are compliant and follow best practices +- `rush_migrate_project`: Migrate a project from one directory to another or into a different subspace +- `rush_pnpm_lock_file_conflict_resolver`: Resolve pnpm-lock.yaml conflicts + ## Links + +- [CHANGELOG.md]( + https://github.com/microsoft/rushstack/blob/main/apps/rush-mcp-server/CHANGELOG.md) - Find + out what's new in the latest version diff --git a/apps/rush-mcp-server/package.json b/apps/rush-mcp-server/package.json index 1d7f9e60eb..ea73a710f5 100644 --- a/apps/rush-mcp-server/package.json +++ b/apps/rush-mcp-server/package.json @@ -2,6 +2,13 @@ "name": "@rushstack/mcp-server", "version": "0.1.7", "description": "A Model Context Protocol server implementation for Rush", + "keywords": [ + "rush", + "modelcontextprotocol", + "mcp", + "monorepo", + "server" + ], "repository": { "type": "git", "url": "https://github.com/microsoft/rushstack.git", diff --git a/apps/rush-mcp-server/rush-doc-fragment.mock.json b/apps/rush-mcp-server/src/rush-doc-fragment.mock.json similarity index 100% rename from apps/rush-mcp-server/rush-doc-fragment.mock.json rename to apps/rush-mcp-server/src/rush-doc-fragment.mock.json diff --git a/apps/rush-mcp-server/src/start.ts b/apps/rush-mcp-server/src/start.ts index 93ab38d285..f131357c2b 100644 --- a/apps/rush-mcp-server/src/start.ts +++ b/apps/rush-mcp-server/src/start.ts @@ -20,6 +20,6 @@ const main = async (): Promise => { }; main().catch((error) => { - log('Fatal error running server:', error); + log('Fatal error running server:', error instanceof Error ? error.message : error); process.exit(1); }); diff --git a/apps/rush-mcp-server/src/utilities/log.ts b/apps/rush-mcp-server/src/utilities/log.ts index 26bfa27b80..c0595baec7 100644 --- a/apps/rush-mcp-server/src/utilities/log.ts +++ b/apps/rush-mcp-server/src/utilities/log.ts @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { Terminal, ConsoleTerminalProvider } from '@rushstack/terminal'; +import { Terminal, ConsoleTerminalProvider, type TerminalWriteParameters } from '@rushstack/terminal'; export const terminal: Terminal = new Terminal(new ConsoleTerminalProvider({ verboseEnabled: true })); -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function log(message?: any, ...optionalParams: any[]): void { - terminal.writeErrorLine(message, ...optionalParams); +export function log(...messageParts: TerminalWriteParameters): void { + terminal.writeErrorLine(...messageParts); } diff --git a/common/changes/@rushstack/mcp-server/feat-update-rush-mcp-server-readme_2025-05-14-12-35.json b/common/changes/@rushstack/mcp-server/feat-update-rush-mcp-server-readme_2025-05-14-12-35.json new file mode 100644 index 0000000000..3cd73776d0 --- /dev/null +++ b/common/changes/@rushstack/mcp-server/feat-update-rush-mcp-server-readme_2025-05-14-12-35.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/mcp-server", + "comment": "Update the rush mcp server README.md document", + "type": "patch" + } + ], + "packageName": "@rushstack/mcp-server" +}