MCP Server
Introduction
@rsdoctor/mcp-server is an MCP Server tool designed to help users more conveniently utilize Rsdoctor's build data. It works with Rsdoctor's local build analysis data and helps you quickly obtain build analysis results through a Q&A interface.
Core features
@rsdoctor/mcp-server provides four core analysis capabilities:
- Bundle Analysis: Analyzes bundle size, composition and other information
- Dependency Analysis: Analyzes project dependency relationships, duplicate dependencies, and Tree Shaking issues.
- Bundle Optimization Suggestions: Provides suggestions for bundle size optimization and code splitting
- Compilation Optimization Suggestions: Analyzes compilation time and provides compilation performance optimization suggestions
Usage examples
1. Bundle optimization analysis
By asking "Please help me to optimize the bundle or artifacts", the tool will analyze the build output and provide optimization suggestions.
Example video:
2. Dependency analysis
By asking "Please investigate the referrer dependency of node_modules/dayjs/index.js", the tool will analyze the dependency relationships of the specified module.
Example video:
3. Compilation performance analysis
By asking "Please help me find files or loaders with high compilation time and provide optimization suggestions", the tool will analyze compilation time and provide optimization suggestions.
Example video:
4. Tree Shaking Issues
By asking "Please help me to check why react-dom/client.js can not be tree-shaken?", the tool will help analyze why this module cannot be tree-shaken.
Note: Please use Rsdoctor plugin version 1.1.5 or above.
Quick start
💡 Version requirements
The following Rsdoctor plugin versions are required:
- @rsdoctor/rspack-plugin >= 1.1.2
- @rsdoctor/webpack-plugin >= 1.1.2
Note: Please ensure you are using the latest version for the best experience.
1. Plugin configuration
If you haven't added the Rsdoctor plugin yet, you need to configure it in your project. 👉🏻 Quick Start.
2. Enable Rsdoctor and run local build
Enable Rsdoctor and run the build. Do not use MCP Client to start the project, as Rsdoctor's local service will block the MCP Client's dialogue process.
- Note: If
disableClientServer: trueis configured, it needs to be modified todisableClientServer: false, anddisableClientServerdefaults to false.
3. Start MCP Server
Cursor
- Create a
.cursor/mcp.jsonfile in the project root directory:
- Restart the Cursor editor
- Start interaction in the MCP panel
VS Code / GitHub Copilot
- Create
.vscode/mcp.jsonin your project root directory. GitHub Copilot will automatically load the MCP Server configuration.
- In the Copilot Chat view, select Agent mode, then start interacting.
Claude
Add configuration in claude_desktop_config.json:
Cline
Add configuration in the configuration file:
Trae
You can configure and add it via "Create Agent" → "MCP" → "Add" → "Manual Add":
Configuration instructions
Command line parameters
Multi-compiler project configuration
In a multi-compiler project, each compiler will have a separate Rsdoctor build analysis data. Use the --compiler parameter to specify the compiler to analyze:
Port configuration
- Configure the MCP Server port:
- Configure the Rsdoctor local service port:
Tools list
Product analysis tool
Dependency analysis tool
Performance analysis tool
Q&A
1. Connection issues
Issue: Unable to connect to Rsdoctor MCP Server or no data returned successfully
Solution:
- Ensure the Rsdoctor local Server has been successfully started.
- Manually start the local Server, do not use MCP Client to start the project, as the local service of Rsdoctor will block the dialogue process of MCP Client.
- If the Rsdoctor MCP server uses the
--portparameter, please ensure the Rsdoctor startup port configuration is correct. - Check if the Rsdoctor plugin version meets the requirements. Version requirements

