Skip to content

Conversation

@maxisbey
Copy link
Contributor

Add support for the title and description fields in the Implementation type, allowing servers to provide human-readable metadata during initialization.

Changes:

  • Add description field to types.Implementation
  • Add server_title and server_description to InitializationOptions
  • Wire up title/description through Server constructor and session
  • Add test for title and description passthrough

Github-Issue:#1783

Motivation and Context

How Has This Been Tested?

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Add support for the `title` and `description` fields in the
`Implementation` type, allowing servers to provide human-readable
metadata during initialization.

Changes:
- Add `description` field to `types.Implementation`
- Add `server_title` and `server_description` to `InitializationOptions`
- Wire up title/description through `Server` constructor and session
- Add test for title and description passthrough

Github-Issue:#1783
Comment on lines +142 to +143
title: str | None = None,
description: str | None = None,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to bottom to avoid positional kwarg errors

),
) as server_session:
async for message in server_session.incoming_messages: # pragma: no branch
if isinstance(message, Exception): # pragma: no cover
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove pragma, instead just fail if there's an exception


if isinstance(message, ClientNotification) and isinstance(
message.root, InitializedNotification
): # pragma: no branch
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all pragmas if possible, use asserts with failures instead

tg.start_soon(run_server)

result = await client_session.initialize()
except anyio.ClosedResourceError: # pragma: no cover
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove exception catching and either accept it through asserts or fail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants