Skip to content

protocol overwriting transport hooks #586

Open
@nichtsam

Description

@nichtsam

Describe the bug
Protocol class currently hooks onto transports by completely overwriting them, which causes the originally hooked functions to be lost and not executed.

For example this code snippet in the README.md wouldn't be executed.
https://github.com/modelcontextprotocol/typescript-sdk/blob/main/README.md?plain=1#L258-L262

Expected behavior
Hooks on transports should be respected and preserved, allowing original hooked functions to run.

Additional context
The related PR #477 has been open for a while.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions