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

Method updateState

mcp/server.go:1123–1131  ·  view source on GitHub ↗
(mut func(*ServerSessionState))

Source from the content-addressed store, hash-verified

1121}
1122
1123func (ss *ServerSession) updateState(mut func(*ServerSessionState)) {
1124 ss.mu.Lock()
1125 mut(&ss.state)
1126 copy := ss.state
1127 ss.mu.Unlock()
1128 if c, ok := ss.mcpConn.(serverConnection); ok {
1129 c.sessionUpdated(copy)
1130 }
1131}
1132
1133// hasInitialized reports whether the server has received the initialized
1134// notification.

Callers 3

initializedMethod · 0.95
initializeMethod · 0.95
setLevelMethod · 0.95

Calls 1

sessionUpdatedMethod · 0.65

Tested by

no test coverage detected