Repository navigation
fix: validate MCP plugin variable declarations - #648
Open
rudycelekli wants to merge 1 commit into
Open
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
rudycelekli
force-pushed
the
fix/mcp-variable-declarations-20261016
branch
from
October 24, 2026 02:03
2e215fa to
d66927e
Compare
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.
Plain
${VAR}references in MCP configuration currently pass validation even when the plugin has no matchingvariables.propertiesdeclaration. A typo can therefore ship through the marketplace validator and leave a required connection token unconfigurable.Validate placeholders in default
mcp.json, explicitly referenced files, inline configurations and mixed arrays. Preserve Cursor runtime interpolation (${env:NAME}, workspace/home/path values and plugin roots), as well as existing shell/default expressions. Report missing or invalid MCP files with plugin context.Refs #531 (MCP variable declaration portion only). This does not duplicate the path/trigger work in #582 or the dependency/frontmatter/unlisted-directory/script-package work in #618; these touch the same validator and may require rebasing.
Validation:
node --test scripts/validate-plugins.test.mjspasses all 12 tests; the same tests against current main fail 8 and pass 4. Both main and this candidate validate all 104 current marketplace plugins successfully. Tests exercise actual validator subprocesses, including declared variables, builtins, explicit discovery overrides and absent MCP configurations.Run validation on every PR so edits to referenced MCP configuration files also receive checks, and run the new regression suite in CI. This trigger change overlaps #582; the validator and workflow will need a rebase if #582 or #618 lands first. Windows fixtures use directory junctions.
Note
Low Risk
Changes are limited to marketplace validation scripts and CI; no runtime plugin or MCP behavior is modified.
Overview
Plugin validation now enforces that plain
${VAR}placeholders in MCP configs are declared invariables.properties, so typos or missing declarations fail CI instead of shipping broken connection settings.validate-plugins.mjswalks MCP configuration whether it comes from defaultmcp.json, explicit file paths, inline objects, or mixed arrays. It flags undeclared identifier-style variables while still allowing Cursor runtime tokens (CURSOR_PLUGIN_ROOT, workspace/home/path helpers),${env:…}, and shell/default forms. Missing or invalid MCP JSON files are reported with plugin name and path context.A new
scripts/validate-plugins.test.mjssuite runs the validator in isolated temp fixtures (12 cases), and.github/workflows/validate-plugins.ymlruns those tests before the full marketplace validation step.Reviewed by Cursor Bugbot for commit d66927e. Bugbot is set up for automated code reviews on this repo. Configure here.