Rush MCP server
Agent context files provide a simple way to improve artificial intelligence (AI) coding assistants by publishing additional information about your Rush repository. The Model Context Protocol (MCP) takes this to the next level, by providing a live service that can answer queries and perform actions in your monorepo.
How does it work?
An MCP host is typically a coding assistant such as GitHub Copilot, VS Code, Trae, or Cursor. But any kind of software tool could act as a client by implementing the MCP client protocol.
An MCP server advertises a menu of capabilities to the client, which the client invokes using the protocol while performing its tasks. According to the specification, the server can run locally or as a remote cloud service. Its capabilities include resources (for example reading file contents, querying databases, reading log files, capturing screenshots), tools (for example running shell commands, modifying files, performing calculations), and prompts (exposing specific input forms to be shown to the end user).
Rush provides a ready-made MCP server @rushstack/mcp-server that you can install in your monorepo. Its design goals were specifically tailored for large teams:
- Easy for everyone to install, minimizing the learning curve for casual contributors.
- Centrally managed, so the monorepo maintainers can control its configuration and upgrades, ensuring everyone gets a predictable experience.
- Extensible via Rush MCP plugins, so you can add company-specific capabilities without having to build your own MCP server.
Setting up the MCP server
The @rushstack/mcp-server
server is a local process on the developer's computer, which gets launched by an MCP host such as Cursor or GitHub Copilot. The MCP host is responsible for starting/killing this process. The inter-process communication uses stdio
transport, which means you can easily test the server by invoking its CLI manually from your shell.
Typically there are two ways to configure launching of the server: globally for your entire machine (e.g. ~/.cursor/mcp.json
) or locally for a specific repository (e.g. <your-repo>/.cursor/mcp.json
). The @rushstack/mcp-server
service is designed to have a local configuration file that is committed to Git. This simplifies setup for users, and provides a deterministic behavior by ensuring everyone uses the same version of @rushstack/mcp-server
for a given branch, which avoids compatibility problems when loading custom plugins.
After you get it working, consider implementing a Rush MCP plugin to expose specific capabilities for your company's systems.
If your coding assistant isn't mentioned below: please create a pull request to add a setup recipe!
Cursor
For Cursor, add this file to your monorepo:
<your-repo>/.cursor/mcp.json
{
"$schema": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/refs/heads/main/schema/2025-03-26/schema.json",
"mcpServers": {
"rush-mcp-server": {
"command": "node",
"args": [
"./common/scripts/install-run.js",
"@rushstack/mcp-server@0.2.1",
"mcp-server",
"."
]
}
}
}
Replace @rushstack/mcp-server@0.2.1
with the latest version from CHANGELOG.md.
Cursor Caveats
- In the above file, Cursor will magically replace
"."
with the absolute path of the workspace folder.- Cursor lacks support for
//
comments in JSON files.- Cursor has neglected to publish their JSON schema file, therefore the
$schema
IntelliSense will not work.