Skip to content

Commit 312e9da

Browse files
authored
Merge pull request #90 from restlessronin/issue-87
feat: add version string parameter to 'create_initialization_options'
2 parents e691c51 + 3de4dc1 commit 312e9da

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: src/mcp/server/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ def __init__(
101101

102102

103103
class Server:
104-
def __init__(self, name: str):
104+
def __init__(self, name: str, version: str | None = None):
105105
self.name = name
106+
self.version = version
106107
self.request_handlers: dict[
107108
type, Callable[..., Awaitable[types.ServerResult]]
108109
] = {
@@ -133,7 +134,7 @@ def pkg_version(package: str) -> str:
133134

134135
return InitializationOptions(
135136
server_name=self.name,
136-
server_version=pkg_version("mcp"),
137+
server_version=self.version if self.version else pkg_version("mcp"),
137138
capabilities=self.get_capabilities(
138139
notification_options or NotificationOptions(),
139140
experimental_capabilities or {},

0 commit comments

Comments
 (0)