Skip to content

Plan for schema version changes in the ServerDetail model #139

Description

@joelverhagen

Is your feature request related to a problem? Please describe.

If I am missing a bigger vision here, feel free to close the issue.

The server.json request body provided to the /v0/publish endpoint is minimally versioned. The shape of the JSON appears to the follow the ServerDetail model and the related model in the OpenAPI YAML.

There appears to be a coupling between the "input" (publish), "output" (get-by-ID), and DB models in the code (ServerDetail).

After the initial launch, I wonder how schema changes will be handled, whether breaking (e.g. property rename) or non-breaking (e.g. new optional property).

Suppose someone publishes a JSON to the registry at the very beginning, then we later introduce a new, required property. The existing JSON in MongoDB will not have the new property but will be returned as-is to the end user (or perhaps break on unmarshal). This could lead to variety on the schema returned to reads of the API.

If the intent is to flow the original schema (as the MCP extension author provided it) to the consumer, then I the current code will work as long as we don't introduce breaking changes.

But what about a property rename? Will a data fix-up/backfill be performed?

Describe the solution you'd like

Without trying to fix the whole schema versioning thing at once I propose a schema version be provided at publish time so the publish code/scripts can express concretely "I am giving you a server detail of version X". The server could reject or map the input if the version differs from what is expected. Or this could be included in MongoDB and used for smarter unmarshal at query/read time.

This schema version could be a root JSON property, a query parameter, or an api-version=0.1 in the Content-Type (many options).

Given this is v0 of the API I think we could allow ourselves to have breaking changes but accept a schema version as input and reject/map old schema versions that could come in to the publish endpoint.

Describe alternatives you've considered

Declare /v0/publish shape will never change (or never have breaking changes) and describe what "non-breaking changes" might look like.

Additional context

I want to describe the current server.json schema version in my NuGet + MCP authoring docs so that it's easy for authors to see that they are using an old docs/template version and to check MCP registry docs for what they need to fix up in their server.json.

In other words, I'm planning for potential schema changes :)

Activity

  1. tadasant commented on Jun 25, 2025

    @tadasant
    Member

    Yes, we should definitely version this schema. Thanks for flagging and writing this up.

    I'm going to close this but reference it here #90 - let's make sure to incorporate as we push that.

  2. tadasant commented on Jun 30, 2025

    @tadasant
    Member

    Re-opening as a separate issue since it was more than we needed to squeeze into #90

  3. domdomegg commented on Aug 20, 2025

    @domdomegg
    Member

    Idea: do we want to add a $schema property, which has a value like https://registry.modelcontextprotocol.io/schemas/2025-08-20/server.json. Then if we do make breaking changes, we can have a new value https://registry.modelcontextprotocol.io/schemas/2028-09-01/server.json.

    This would have multiple benefits:

    • Makes it very explicit what schema version they are following, in a way that still allows us to add non-breaking changes
    • File is now self-describing, so it's easier to crawl on the internet to detect server.json definitions, or in a code repository it's a lot more obvious to contributors what that file is supposed to be / what spec it follows
    • Common IDEs get great type hinting, validation, etc. automatically for free
    • Over other versioning methods, I think this feels 'nice' that we're using an open standard that is well known and supported by many tools

    (the exact versioning could be whatever, e.g. v0 and v1, if people prefer that to date based versioning. I was going date based because I've seen it elsewhere e.g. GitHub and AWS but don't know what's best practice here and don't have a strong opinion)

  4. joelverhagen commented on Aug 20, 2025

    @joelverhagen
    ContributorAuthor

    Tadas and I spoke a bit about versioning here: #167 (comment)
    I think date based versioning is good. The JSON schema metaschema uses dates most recently (month, not day, but day seems good to me just in case we have multiple in a month).

    Currently, the .mcp/server.json that is included in the template for NuGet MCP servers includes the $schema URI matching the $id in the schema:
    https://github.com/dotnet/extensions/blob/77859cb87c33bcda7187871a683c5779557cb2ef/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/McpServer/McpServer-CSharp/.mcp/server.json#L2

    "$id": "https://modelcontextprotocol.io/schemas/draft/2025-07-09/server.json",

    It would be great if this URI was actually a URL so we have the benefit you suggest (hinting from IDEs).

    I am not sure who controls modelcontextprotocol.io, but if we could upload the current schema to that location (or change it to a place we can upload) it would light up!

  5. domdomegg commented on Aug 20, 2025

    @domdomegg
    Member

    Ah nice, I hadn't seen that thread. Seems like we're aligned on using JSON schema and maybe adding $schema to to server.json :)

    For what it's worth, I think it might be better to keep the versioning of schema.json separate to the MCP spec? Because I think the MCP version will evolve much more rapidly than we'll make breaking changes in schema.json, and I think the fewer versions clients have to worry about / deal with the better.

    I am not sure who controls modelcontextprotocol.io, but if we could upload the current schema to that location (or change it to a place we can upload) it would light up!

    tldr: I think hosting it at registry.modelcontextprotocol.io/... might be quite easy. Hosting it at https://modelcontextprotocol.io/schemas/draft/2025-07-09/server.json is probably possible, but more hassle. Not sure which is semantically nicer.

    At the moment the domains are owned by Anthropic, but I'm working on the site to transition them to community-based governance. modelcontextprotocol.io points at a Mintlify site that hosts the docs, so it might be a bit painful to host something at a specific path there (but dooable if we setup a reverse proxy with something like nginx etc.).

    Currently registry.modelcontextprotocol.io points at a GKE cluster that is fully controlled by this (the registry) repo, in the deploy folder. At the moment just hosts the go registry binary. I see two fairly easy ways to host the spec:

    • Add a route to registry to server the json schema. This I think should be a fairly small easy change.
    • Add a route in our k8s config in the deploy folder, probably to point to some new container that just hosts schemas using a pathprefix. This can be a single self-contained change that we own in this repo, but is a little more complex.

    Semantically I don't know if server.json is a 'part' of registry. At the moment I think it is mainly owned by the registry maintainers and we're developing it in this repo, so maybe yes? But maybe we should be preparing for it to be wider.

    Another alternative to all of the above is to host it at something like https://www.schemastore.org/, which Anthropic already hosts some things in like the claude code settings schema, and several other open source projects kinda rely on e.g. tsconfig schema. They can provide codeowners permissions so we could have the MCP maintainers own changes to the file, although it does mean it's slightly more outside the control of the MCP community.

  6. tadasant commented on Aug 20, 2025

    @tadasant
    Member

    Just jumping in on this specific note:

    Semantically I don't know if server.json is a 'part' of registry. At the moment I think it is mainly owned by the registry maintainers and we're developing it in this repo, so maybe yes? But maybe we should be preparing for it to be wider.

    The vision for server.json is up-to-date here: https://github.com/modelcontextprotocol/registry/tree/main/docs/server-json

    tl;dr is that yes, Registry is the first use case, but it has several more use cases (some of which I expect to eventually be significantly more important than Registry for the ecosystem). After we feel good about MVP of the shape for the registry, we should submit it as a SEP w/ the registry as an implementation example, and I expect that will bring together a lot of different stakeholders with many opinions, but hopefully by then we'll have kicked the tires enough that we won't need significant changes to get it formalized

  7. joelverhagen commented on Aug 20, 2025

    @joelverhagen
    ContributorAuthor

    For what it's worth, I think it might be better to keep the versioning of schema.json separate to the MCP spec?

    Seems reasonable to me. If there is confusion about how the two versions relate, perhaps we could provide a mapping/relationship doc in this repo if the question comes up. My 2c.

    Semantically I don't know if server.json is a 'part' of registry. At the moment I think it is mainly owned by the registry maintainers and we're developing it in this repo, so maybe yes? But maybe we should be preparing for it to be wider.

    Good question, I don't know. I think one consideration is that the schema is a static asset, universal to all deployments of the MCP registry (private or community) and that it probably should be CDN fronted, perhaps blob store backed. My mental model is the registry.modelcontextprotocol.io is the community instance and less about universal assets for the registry protocol.

    I don't know much about schemastore, but I have heard of it and perhaps used it unknowingly in my IDE. It appears one of the main contributors (Mads) is in my org. I'll run this by him.

    Switching to another domain makes sense. Perhaps schema.modelcontextprotocol.io so that it can be decoupled from the running community instance (and availability issues therein).

    Generally I think it's very nice when schema URIs are also URLs. I have had to explain so many times to teammates why that XML XSD they are looking at has a "broken link it in" (when in reality it is a URI not a URL). It's just highly convenient to have the schema located publicly and followable in any server.json you might be looking at.

    If the URI/URL changes I will update the stuff on the NuGet/.NET side.

  8. domdomegg commented on Aug 20, 2025

    @domdomegg
    Member

    Switching to another domain makes sense. Perhaps schema.modelcontextprotocol.io so that it can be decoupled from the running community instance (and availability issues therein).

    I think I could get this spun up easily if we're happy with this?

    Or an even more generic domain like static.modelcontextprotocol.io where the MVP is just just GitHub Pages serving a GitHub repo we can put files in.

    @tadasant @joelverhagen would you be happy to vote on:

    1. registry.modelcontextprotocol.io
    2. schema.modelcontextprotocol.io
    3. static.modelcontextprotocol.io
    4. put the effort in to get it on root modelcontextprotocol.io
    5. other proposed domain

    (personally my preference would be for 3, then 2. mainly because I imagine there might be other random static assets we want to host, and having a general static files host seems useful so maybe we should name it that way from the start.)

  9. domdomegg commented on Aug 21, 2025

    @domdomegg
    Member

    To experiment a bit more, I tried uploading some static files to mintlify and it seems like it does process at least .txt files. It does seem to apply transforms/do weird things to HTML and CSS though, so don't know if it'll do the same for JSON.

    This makes me a bit more optimistic for hosting on the root domain. Although I'm still maybe leaning to just having a simple static assets host that we put these schema files on.

  10. tadasant commented on Aug 21, 2025

    @tadasant
    Member

    I think static.modelcontextprotocol.io makes sense, though I might run that by the wider contributor Discord community to gather some opinions before making the jump.

    I think it might be better to keep the versioning of schema.json separate to the MCP spec? Because I think the MCP version will evolve much more rapidly than we'll make breaking changes in schema.json, and I think the fewer versions clients have to worry about / deal with the better.

    I think pre-go-live, we should keep them separate. However when we propose a SEP to enshrine server.json as the thing being used in a lot of places (including, for example, InitializeResult), we may have strong incentive to keep everything aligned and keep it in lockstep with the core MCP spec. Hopefully by then server.json is relatively stable and that's not really a problem.

  11. domdomegg commented on Aug 21, 2025

    @domdomegg
    Member

    I might run that by the wider contributor Discord community

    Sounds like a good idea! Have posted in https://discord.com/channels/1358869848138059966/1358869848138059969/1408161807549333790

  12. added
    tech requirements workProduct requirements are clear, but needs technical review before implementation
    and removed on Aug 21, 2025
  13. domdomegg commented on Aug 21, 2025

    @domdomegg
    Member

    Based on the discussion in this issue so far, and the chat we had in the maintainers meeting today we are agreed on the approach above. Moving to tech requirements work to figure out which domain exactly we host the schema on (likely will agree on this in next 24 hours), then should be good to head on to implementation work soon :)

  14. domdomegg commented on Aug 26, 2025

    @domdomegg
    Member

    From Discord:


    Adam Jones (Anthropic) — 8/21/25, 7:52 PM
    Static Hosting Domain for MCP Assets

    On the registry project, we're keen to set up a domain to host static files for the MCP ecosystem, starting with the server.json JSON schema. This came up in registry issue #139.

    Why we want public hosting:
    JSON schemas use a $schema property that points to a URL - when this URL is actually accessible, IDEs automatically provide type hinting, validation, and autocomplete
    Makes server.json files self-describing - anyone finding one immediately knows what spec it follows
    Enables tooling to discover and validate MCP server definitions across the internet

    Current proposal:
    Host at static.modelcontextprotocol.io as a general-purpose static asset host for MCP:
    Start with the server.json schema at something like /schemas/2025-08-20/server.json
    Available for other MCP static assets the community might need
    Initially start by just creating a GitHub repo, that is served via GitHub pages

    Looking for input:
    Do you have preferences on the subdomain? E.g.: static., cdn., schemas., registry.
    We considered just putting it on registry, but prefer a generic name so this can be used for other things. We imagine a static file serving domain is probably generally useful.
    Are there other static files/assets the MCP ecosystem needs hosted?
    Any concerns about this approach?


    Jonathan Hefner — 8/21/25, 8:49 PM
    At first glance, I liked the simple generality of static.. But, for $schema values that might be replicated across tens or hundreds of thousands of user's files, I think I would prefer a URL that looks more dedicated to the purpose, so schemas. (or schema.) would be my choice.

    I think cdn. is worse than static. in that regard. I think registry. would be okay, but might preclude other use cases.


    David Soria Parra (Anthropic) — 8/22/25, 7:29 AM
    static. is fine unless it's specifically only for the registry, in which case it probably should live under registry.


    Jonathan Hefner — 8/22/25, 4:22 PM
    I don't feel strongly about it, but if we are looking for precedents, here are some search results from GitHub:

    /"$schema": "https?://static/: 546 files
    /"$schema": "https?://schema/: 408k files
    /"$schema": "https?://schemas?.[^m]/ (excludes schema.management.azure.com): 86.5k files

  15. domdomegg commented on Aug 26, 2025

    @domdomegg
    Member

    I think I am leaning towards just using static: I can really imagine wanting basic file hosting for other MCP stuff in the future.

    I think it's mostly ~fine that static has less use than schema on GitHub for JSON schemas specifically, and also obvious enough that $schema is the schema property without schema being the beginning of the URL as well.

    I will get a repository and the DNS set up for this.

  16. self-assigned this
    on Aug 26, 2025
  17. added a commit that references this issue on Aug 27, 2025
    5fb6ee2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestgo-live blockerThis issue is one we need to address prior to initial go-liveserver.jsontech requirements workProduct requirements are clear, but needs technical review before implementation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions