mcp/server: expose InitializeParams to ServerSession (#336)
This CL enables the server session to see what capabilities the client has by introducing the InitializeParams() function. This CL also adds a test to ensure ClientCapabilities is accurate. Fixes #141
This commit is contained in:
parent
62d815922f
commit
48abccbf6b
1 changed files with 57 additions and 7 deletions
|
|
@ -849,6 +849,8 @@ func (ss *ServerSession) handle(ctx context.Context, req *jsonrpc.Request) (any,
|
|||
return handleReceive(ctx, ss, req)
|
||||
}
|
||||
|
||||
func (ss *ServerSession) InitializeParams() *InitializeParams { return ss.state.InitializeParams }
|
||||
|
||||
func (ss *ServerSession) initialize(ctx context.Context, params *InitializeParams) (*InitializeResult, error) {
|
||||
if params == nil {
|
||||
return nil, fmt.Errorf("%w: \"params\" must be be provided", jsonrpc2.ErrInvalidParams)
|
||||
|
|
|
|||
Loading…
Reference in a new issue