| 161 | } |
| 162 | |
| 163 | func (c *Client) MCPServerConfigByID(ctx context.Context, id uuid.UUID) (MCPServerConfig, error) { |
| 164 | res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/experimental/mcp/servers/%s", id), nil) |
| 165 | if err != nil { |
| 166 | return MCPServerConfig{}, err |
| 167 | } |
| 168 | defer res.Body.Close() |
| 169 | if res.StatusCode != http.StatusOK { |
| 170 | return MCPServerConfig{}, ReadBodyAsError(res) |
| 171 | } |
| 172 | var config MCPServerConfig |
| 173 | return config, json.NewDecoder(res.Body).Decode(&config) |
| 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) |