Skip to content

Question: version in create_initialization_options is the pkg_ver for "mcp" #87

Closed

Description

@restlessronin

This is more in the nature of a request for clarification.

The sample code in the SDK here:

https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/servers/simple-prompt/mcp_simple_prompt/server.py

shows the use of create_initialization_options to set the initialization options. However this function is setting the version to 'pkg_ver("mcp")' which seems to indicate that it is the protocol version that is being indicated.

In the sqlite example, the version is manually set to 0.1.0, so it won't use the protocol version. Is this a mistake?

Is the version meant to record the version of whatever the actual server program is? or is it mean to be the protocol version.

Activity

  1. dsp-ant commented on Dec 4, 2024

    @dsp-ant
    Member

    This version is pure informational and for debugging purposes. The protocol version is exchanged differently and hardcoded into the current version of the SDK.

  2. restlessronin commented on Dec 4, 2024

    @restlessronin
    ContributorAuthor

    If it's for user visible debugging, perhaps the create_initialization_options could take the version as a parameter? it could be set to the pkg_ver of the server, that's more useful in the Claude Desktop UX than the the mcp version, which is relatively static. it's a small change, but i can submit the PR if that's of interest.

  3. dsp-ant commented on Dec 4, 2024

    @dsp-ant
    Member

    I think that would be an improvement. If you are so kind and create a PR @restlessronin

  4. restlessronin commented on Dec 5, 2024

    @restlessronin
    ContributorAuthor

    @dsp-ant here it is: #90

  5. added
    questionFurther information is requested
    documentationImprovements or additions to documentation
    on Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationquestionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions