@@ -131,6 +131,98 @@ type QuotaSnapshot struct {
131131 UsedRequests float64 `json:"usedRequests"`
132132}
133133
134+ type MCPConfigListResult struct {
135+ // All MCP servers from user config, keyed by name
136+ Servers map [string ]ServerValue `json:"servers"`
137+ }
138+
139+ // MCP server configuration (local/stdio or remote/http)
140+ type ServerValue struct {
141+ Args []string `json:"args,omitempty"`
142+ Command * string `json:"command,omitempty"`
143+ Cwd * string `json:"cwd,omitempty"`
144+ Env map [string ]string `json:"env,omitempty"`
145+ FilterMapping * FilterMappingUnion `json:"filterMapping"`
146+ IsDefaultServer * bool `json:"isDefaultServer,omitempty"`
147+ Timeout * float64 `json:"timeout,omitempty"`
148+ // Tools to include. Defaults to all tools if not specified.
149+ Tools []string `json:"tools,omitempty"`
150+ Type * ServerType `json:"type,omitempty"`
151+ Headers map [string ]string `json:"headers,omitempty"`
152+ OauthClientID * string `json:"oauthClientId,omitempty"`
153+ OauthPublicClient * bool `json:"oauthPublicClient,omitempty"`
154+ URL * string `json:"url,omitempty"`
155+ }
156+
157+ type MCPConfigAddParams struct {
158+ // MCP server configuration (local/stdio or remote/http)
159+ Config MCPConfigAddParamsConfig `json:"config"`
160+ // Unique name for the MCP server
161+ Name string `json:"name"`
162+ }
163+
164+ // MCP server configuration (local/stdio or remote/http)
165+ type MCPConfigAddParamsConfig struct {
166+ Args []string `json:"args,omitempty"`
167+ Command * string `json:"command,omitempty"`
168+ Cwd * string `json:"cwd,omitempty"`
169+ Env map [string ]string `json:"env,omitempty"`
170+ FilterMapping * FilterMappingUnion `json:"filterMapping"`
171+ IsDefaultServer * bool `json:"isDefaultServer,omitempty"`
172+ Timeout * float64 `json:"timeout,omitempty"`
173+ // Tools to include. Defaults to all tools if not specified.
174+ Tools []string `json:"tools,omitempty"`
175+ Type * ServerType `json:"type,omitempty"`
176+ Headers map [string ]string `json:"headers,omitempty"`
177+ OauthClientID * string `json:"oauthClientId,omitempty"`
178+ OauthPublicClient * bool `json:"oauthPublicClient,omitempty"`
179+ URL * string `json:"url,omitempty"`
180+ }
181+
182+ type MCPConfigUpdateParams struct {
183+ // MCP server configuration (local/stdio or remote/http)
184+ Config MCPConfigUpdateParamsConfig `json:"config"`
185+ // Name of the MCP server to update
186+ Name string `json:"name"`
187+ }
188+
189+ // MCP server configuration (local/stdio or remote/http)
190+ type MCPConfigUpdateParamsConfig struct {
191+ Args []string `json:"args,omitempty"`
192+ Command * string `json:"command,omitempty"`
193+ Cwd * string `json:"cwd,omitempty"`
194+ Env map [string ]string `json:"env,omitempty"`
195+ FilterMapping * FilterMappingUnion `json:"filterMapping"`
196+ IsDefaultServer * bool `json:"isDefaultServer,omitempty"`
197+ Timeout * float64 `json:"timeout,omitempty"`
198+ // Tools to include. Defaults to all tools if not specified.
199+ Tools []string `json:"tools,omitempty"`
200+ Type * ServerType `json:"type,omitempty"`
201+ Headers map [string ]string `json:"headers,omitempty"`
202+ OauthClientID * string `json:"oauthClientId,omitempty"`
203+ OauthPublicClient * bool `json:"oauthPublicClient,omitempty"`
204+ URL * string `json:"url,omitempty"`
205+ }
206+
207+ type MCPConfigRemoveParams struct {
208+ // Name of the MCP server to remove
209+ Name string `json:"name"`
210+ }
211+
212+ type SessionFSSetProviderResult struct {
213+ // Whether the provider was set successfully
214+ Success bool `json:"success"`
215+ }
216+
217+ type SessionFSSetProviderParams struct {
218+ // Path conventions used by this filesystem
219+ Conventions Conventions `json:"conventions"`
220+ // Initial working directory for sessions
221+ InitialCwd string `json:"initialCwd"`
222+ // Path within each session's SessionFs where the runtime stores files for that session
223+ SessionStatePath string `json:"sessionStatePath"`
224+ }
225+
134226type SessionModelGetCurrentResult struct {
135227 // Currently active model identifier
136228 ModelID * string `json:"modelId,omitempty"`
@@ -338,17 +430,17 @@ type SessionSkillsReloadResult struct {
338430
339431type SessionMCPListResult struct {
340432 // Configured MCP servers
341- Servers []Server `json:"servers"`
433+ Servers []ServerElement `json:"servers"`
342434}
343435
344- type Server struct {
436+ type ServerElement struct {
345437 // Error message if the server failed to connect
346438 Error * string `json:"error,omitempty"`
347439 // Server name (config key)
348440 Name string `json:"name"`
349441 // Configuration source: user, workspace, plugin, or builtin
350442 Source * string `json:"source,omitempty"`
351- // Connection status: connected, failed, pending, disabled, or not_configured
443+ // Connection status: connected, failed, needs-auth, pending, disabled, or not_configured
352444 Status ServerStatus `json:"status"`
353445}
354446
@@ -610,6 +702,31 @@ type SessionShellKillParams struct {
610702 Signal * Signal `json:"signal,omitempty"`
611703}
612704
705+ type FilterMappingEnum string
706+
707+ const (
708+ FilterMappingEnumHiddenCharacters FilterMappingEnum = "hidden_characters"
709+ FilterMappingEnumMarkdown FilterMappingEnum = "markdown"
710+ FilterMappingEnumNone FilterMappingEnum = "none"
711+ )
712+
713+ type ServerType string
714+
715+ const (
716+ ServerTypeHTTP ServerType = "http"
717+ ServerTypeLocal ServerType = "local"
718+ ServerTypeSse ServerType = "sse"
719+ ServerTypeStdio ServerType = "stdio"
720+ )
721+
722+ // Path conventions used by this filesystem
723+ type Conventions string
724+
725+ const (
726+ ConventionsPosix Conventions = "posix"
727+ ConventionsWindows Conventions = "windows"
728+ )
729+
613730// The current agent mode.
614731//
615732// The agent mode after switching.
@@ -623,11 +740,12 @@ const (
623740 ModePlan Mode = "plan"
624741)
625742
626- // Connection status: connected, failed, pending, disabled, or not_configured
743+ // Connection status: connected, failed, needs-auth, pending, disabled, or not_configured
627744type ServerStatus string
628745
629746const (
630747 ServerStatusConnected ServerStatus = "connected"
748+ ServerStatusNeedsAuth ServerStatus = "needs-auth"
631749 ServerStatusNotConfigured ServerStatus = "not_configured"
632750 ServerStatusPending ServerStatus = "pending"
633751 ServerStatusDisabled ServerStatus = "disabled"
@@ -721,6 +839,11 @@ const (
721839 SignalSIGTERM Signal = "SIGTERM"
722840)
723841
842+ type FilterMappingUnion struct {
843+ Enum * FilterMappingEnum
844+ EnumMap map [string ]FilterMappingEnum
845+ }
846+
724847type ResultUnion struct {
725848 ResultResult * ResultResult
726849 String * string
@@ -779,13 +902,31 @@ func (a *ServerAccountApi) GetQuota(ctx context.Context) (*AccountGetQuotaResult
779902 return & result , nil
780903}
781904
905+ type ServerMcpApi serverApi
906+
907+ type ServerSessionFsApi serverApi
908+
909+ func (a * ServerSessionFsApi ) SetProvider (ctx context.Context , params * SessionFSSetProviderParams ) (* SessionFSSetProviderResult , error ) {
910+ raw , err := a .client .Request ("sessionFs.setProvider" , params )
911+ if err != nil {
912+ return nil , err
913+ }
914+ var result SessionFSSetProviderResult
915+ if err := json .Unmarshal (raw , & result ); err != nil {
916+ return nil , err
917+ }
918+ return & result , nil
919+ }
920+
782921// ServerRpc provides typed server-scoped RPC methods.
783922type ServerRpc struct {
784923 common serverApi // Reuse a single struct instead of allocating one for each service on the heap.
785924
786- Models * ServerModelsApi
787- Tools * ServerToolsApi
788- Account * ServerAccountApi
925+ Models * ServerModelsApi
926+ Tools * ServerToolsApi
927+ Account * ServerAccountApi
928+ Mcp * ServerMcpApi
929+ SessionFs * ServerSessionFsApi
789930}
790931
791932func (a * ServerRpc ) Ping (ctx context.Context , params * PingParams ) (* PingResult , error ) {
@@ -806,6 +947,8 @@ func NewServerRpc(client *jsonrpc2.Client) *ServerRpc {
806947 r .Models = (* ServerModelsApi )(& r .common )
807948 r .Tools = (* ServerToolsApi )(& r .common )
808949 r .Account = (* ServerAccountApi )(& r .common )
950+ r .Mcp = (* ServerMcpApi )(& r .common )
951+ r .SessionFs = (* ServerSessionFsApi )(& r .common )
809952 return r
810953}
811954
0 commit comments