Skip to content

Commit

Permalink
Merge pull request #90 from restlessronin/issue-87
Browse files Browse the repository at this point in the history
feat: add version string parameter to 'create_initialization_options'
  • Loading branch information
dsp-ant authored Jan 2, 2025
2 parents e691c51 + 3de4dc1 commit 312e9da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mcp/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ def __init__(


class Server:
def __init__(self, name: str):
def __init__(self, name: str, version: str | None = None):
self.name = name
self.version = version
self.request_handlers: dict[
type, Callable[..., Awaitable[types.ServerResult]]
] = {
Expand Down Expand Up @@ -133,7 +134,7 @@ def pkg_version(package: str) -> str:

return InitializationOptions(
server_name=self.name,
server_version=pkg_version("mcp"),
server_version=self.version if self.version else pkg_version("mcp"),
capabilities=self.get_capabilities(
notification_options or NotificationOptions(),
experimental_capabilities or {},
Expand Down

0 comments on commit 312e9da

Please sign in to comment.