| 174 | } |
| 175 | |
| 176 | func (c *Client) CreateMCPServerConfig(ctx context.Context, req CreateMCPServerConfigRequest) (MCPServerConfig, error) { |
| 177 | res, err := c.Request(ctx, http.MethodPost, "/api/experimental/mcp/servers", req) |
| 178 | if err != nil { |
| 179 | return MCPServerConfig{}, err |
| 180 | } |
| 181 | defer res.Body.Close() |
| 182 | if res.StatusCode != http.StatusCreated { |
| 183 | return MCPServerConfig{}, ReadBodyAsError(res) |
| 184 | } |
| 185 | var config MCPServerConfig |
| 186 | return config, json.NewDecoder(res.Body).Decode(&config) |
| 187 | } |
| 188 | |
| 189 | func (c *Client) UpdateMCPServerConfig(ctx context.Context, id uuid.UUID, req UpdateMCPServerConfigRequest) (MCPServerConfig, error) { |
| 190 | res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/experimental/mcp/servers/%s", id), req) |