Skip to content

SessionID is blank / empty when read from mcp.ServerSession #98

@tylerwilliams

Description

@tylerwilliams

Describe the bug

First off: Thanks for your hard work. I'm aware this is early days and not production ready yet. I may just be holding things wrong, but I expected mcp.ServerSession.ID() to return some kind of unique ID associated with a session, and instead it returns an empty string.

I'm after a session ID so that I can store some data on behalf of the user and reference it in later calls (write some files to a user-specific workspace and read them later for example)

To Reproduce
Steps to reproduce the behavior:

  1. Run any of the SSE server demos.
  2. Log the value of mcp.ServerSession.ID() from a tool handler function
  3. Connect to the server using some agent, claude for example claude mcp add -t sse my_cool_mcp http://localhost:6270/sse, and trigger the tool

Expected behavior
Handler should print some unique session ID

Logs
N/A

Additional context
Thanks

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