MCPcopy Index your code
hub / github.com/coder/coder / CreateMCPServerConfig

Method CreateMCPServerConfig

codersdk/mcp.go:176–187  ·  view source on GitHub ↗
(ctx context.Context, req CreateMCPServerConfigRequest)

Source from the content-addressed store, hash-verified

174}
175
176func (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
189func (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)

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65