Skip to content

[Server] Uncaught Error: Typed property Mcp\Server\Session\Session::$data must not be accessed before initialization #266

@ineersa

Description

@ineersa

Describe the bug
Trying to setup Streamable HTTP server and testing things.
might be minor issue or non-existent, but getting it when cancelling tool call.
Also this might be connected to actual PHAR and sessions, haven't dig it yet.

To Reproduce
Steps to reproduce the behavior:

  1. Run HTTP Streamable server
  2. Cancel tool call while it's running

Expected behavior
No errors

Logs

PHP Fatal error:  Uncaught Error: Typed property Mcp\Server\Session\Session::$data must not be accessed before initialization in phar:///home/ineersa/mcp/browser-mcp/browser-mcp.phar/vendor/mcp/sdk/src/Server/Session/Session.php:54
Stack trace:
#0 phar:///home/ineersa/mcp/browser-mcp/browser-mcp.phar/vendor/mcp/sdk/src/Server/Protocol.php(144): Mcp\Server\Session\Session->save()
#1 phar:///home/ineersa/mcp/browser-mcp/browser-mcp.phar/vendor/mcp/sdk/src/Server/Transport/BaseTransport.php(133): Mcp\Server\Protocol->processInput()
#2 phar:///home/ineersa/mcp/browser-mcp/browser-mcp.phar/vendor/mcp/sdk/src/Server/Transport/StreamableHttpTransport.php(112): Mcp\Server\Transport\BaseTransport->handleMessage()
#3 phar:///home/ineersa/mcp/browser-mcp/browser-mcp.phar/vendor/mcp/sdk/src/Server/Transport/StreamableHttpTransport.php(295): Mcp\Server\Transport\StreamableHttpTransport->handlePostRequest()
#4 phar:///home/ineersa/mcp/browser-mcp/browser-mcp.phar/vendor/mcp/sdk/src/Server/Transport/Http/MiddlewareRequestHandler.php(42): Mcp\Server\Transport\StreamableHttpTransport->handleRequest()
#5 phar:///home/ineersa/mcp/browser-mcp/browser-mcp.phar/vendor/mcp/sdk/src/Server/Transport/StreamableHttpTransport.php(101): Mcp\Server\Transport\Http\MiddlewareRequestHandler->handle()
#6 phar:///home/ineersa/mcp/browser-mcp/browser-mcp.phar/vendor/mcp/sdk/src/Server.php(53): Mcp\Server\Transport\StreamableHttpTransport->listen()
#7 /tmp/mcp/browser-mcp/browser-mcp-e1da33004e005e4e88a9c08aba15280789c3df6e-http-worker.php(96): Mcp\Server->run()
#8 {main}
  thrown in phar:///home/ineersa/mcp/browser-mcp/browser-mcp.phar/vendor/mcp/sdk/src/Server/Session/Session.php on line 54

Additional context
Add any other context about the problem here.

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