modelcontextprotocol / modelcontextprotocol/registry

Allow for templated variable cascading scenarios across packages and remotes

Open
#656 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

v1
Dominant language
Go
Stars
7.3k
Forks
994
Avg merge
4d 12h
Merged PRs (30d)
19

Description

Follow on to https://github.com/modelcontextprotocol/registry/pull/570

See https://github.com/modelcontextprotocol/registry/pull/570#issuecomment-3367417636 for the starting point

My rough understanding of what we want to accomplish here is to, at minimum:

  1. Collect nested variables in the validators so that parametrized schemas like this are allowed:
{
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-16/server.schema.json",
  "name": "io.github.SamYuan1990/i18n-agent-action",
  "description": "An i18n github action for language translate",
  "version": "mcp",
  "packages": [
    {
      "registryType": "oci",
      "registryBaseUrl": "https://ghcr.io",
      "identifier": "SamYuan1990/i18n-agent-action",
      "version": "mcp",
      "runtimeHint": "docker",
      "transport": {
        "type": "sse",
        "url": "https://example.com:{host_port}/sse"
      },
      "runtimeArguments": [
        {
          "description": "Port mapping from host to container",
          "value": "{host_port}:8080",
          "type": "named",
          "name": "-p",
          "variables": {
            "host_port": {
              "description": "The host (local) port",
              "isRequired": true,
              "format": "number",
              "default": "8080"
            }
          }
        }
      ]
    }
  ]
}
  1. Properly document the scenarios where these template variables cascade (and what to do in case of conflicts / which layers have precedence).

(2) Might potentially deserve an extension to syntax to do things like {-p.host_port} or {p.host_port} in order to disambiguate more explicitly. But my inclination is to not add the extra syntax (just do blind {host_port} with some precedence order of where to look), as this won't be a commonly used feature and some reasonable precedence cascade would be sufficiently intuitive that users don't have to learn the syntax and can just intuit how variables would cascade.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pull request #570 and its linked comment, then trace the validators that process nested package and runtime variables. Define and document precedence and conflict behavior for cascading template variables, and verify the parametrized schema example. Whether to add explicit variable syntax remains an open design question.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.