MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / Sessions

Method Sessions

mcp/server.go:694–699  ·  view source on GitHub ↗

Sessions returns an iterator that yields the current set of server sessions. There is no guarantee that the iterator observes sessions that are added or removed during iteration.

()

Source from the content-addressed store, hash-verified

692// There is no guarantee that the iterator observes sessions that are added or
693// removed during iteration.
694func (s *Server) Sessions() iter.Seq[*ServerSession] {
695 s.mu.Lock()
696 clients := slices.Clone(s.sessions)
697 s.mu.Unlock()
698 return slices.Values(clients)
699}
700
701func (s *Server) listPrompts(_ context.Context, req *ListPromptsRequest) (*ListPromptsResult, error) {
702 s.mu.Lock()

Callers 4

TestEndToEndFunction · 0.95

Calls

no outgoing calls

Tested by 4

TestEndToEndFunction · 0.76