Skip to content

Conversation

jspahrsummers
Copy link
Member

@jspahrsummers jspahrsummers commented Oct 11, 2024

This PR standardizes on a Transport.start() method, which Client and Server classes now call automatically. This fixes a race condition between starting the transport (which causes data to start flowing) and being ready to process messages in the client or server.

Calling code should no longer call Transport.start() unless doing low-level things like proxying.

Resolves #2.

To do

  • Figure out how await client.connect() is gonna work

@jspahrsummers jspahrsummers marked this pull request as ready for review October 16, 2024 12:17
@jspahrsummers jspahrsummers merged commit e665be0 into main Oct 16, 2024
2 checks passed
@jspahrsummers jspahrsummers deleted the justin/fix-race-condition branch October 16, 2024 17:24
Pizzaface pushed a commit to RewstApp/mcp-inspector that referenced this pull request May 2, 2025
…ashwin/sse

Add support for SSE transport
Pizzaface pushed a commit to RewstApp/mcp-inspector that referenced this pull request May 2, 2025
e665be0 Merge pull request modelcontextprotocol#14 from modelcontextprotocol/justin/fix-race-condition
be9c1fe Merge branch 'main' into justin/fix-race-condition
36ba802 Merge pull request modelcontextprotocol#17 from modelcontextprotocol/ashwin/capabilities
a1b8886 yarn build
7b718de Report errors when start() is called multiple times
83a43fd Protocol.connect() can automatically call Transport.start()
8d80cc5 Merge branch 'main' into justin/fix-race-condition
bcb4b21 add server capabilities derivation
e9c64fb Update tests and CLI
2b0599e Update server SSE transport
c39f808 Update client transports
87ae7ff Add start() to Transport interface

git-subtree-dir: packages/mcp-typescript
git-subtree-split: e665be0
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.

Race condition between transport start and server connection
2 participants