[mcp-server] Introduce a plugin system for custom MCP tools#5217
Closed
octogonz wants to merge 5 commits intomicrosoft:mainfrom
Closed
[mcp-server] Introduce a plugin system for custom MCP tools#5217octogonz wants to merge 5 commits intomicrosoft:mainfrom
octogonz wants to merge 5 commits intomicrosoft:mainfrom
Conversation
This was referenced May 2, 2025
… a package.json dependency for "zod" or "@rushstack/mcp-server"
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@L-Qun
Here's a design sketch for a plugin system for
@rushstack/mcp-server.Basic ideas:
An MCP plugin is an NPM package with an
rush-mcp-plugin.jsonmanifest file in its root folder.Example: build-tests/rush-mcp-example-plugin/rush-mcp-plugin.json
The plugin can optionally define a JSON config file with a schema. Its name will be
<rush-repo>/common/config/rush-mcp/<plugin-name>.json. This way each monorepo can configure its MCP plugins differently, for example different POC contact emails for each monorepo.@rushstack/mcp-servermanages loading of plugins: (1) ensure the autoinstaller is installed, (2) use the manifest to find the entry point, (3) if there is a config file, load it and validate its JSON schema, (4) callcreatePlugin()to create the plugin class, (5) finally callonInitializeAsync()so the plugin can initialize itself.It took me a while to realize that plugins can add/remove MCP tools interactively, as well as MCP resources etc. All the MCP API stuff will be exposed via
RushMcpPluginSession. The plugin calls it likethis.session.registerTool({ toolName: 'state_capital' }, new StateCapitalTool(this));.The key design requirements motivating
RushMcpPluginSession:@rushstack/mcp-serveris a devDependency for plugins, NOT a regular dependency.import typewhen importing from@rushstack/mcp-server.zodor@modelcontextprotocol/sdk. This ensures multiple plugins can be loaded without doppelgangers or dependency hell, and it will also greatly improve the backwards compatibility story.@rushstack/mcp-servershould have a different goal, to provide a premade configure that "just works" for each monorepo, with minimal setup/understanding required by end users.The draft PR microsoft/rush-example#24 illustrates a configuration.
TODO:
rush_docsplugin into a build-tests example