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

Method MCPServerConfigs

codersdk/mcp.go:150–161  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

148}
149
150func (c *Client) MCPServerConfigs(ctx context.Context) ([]MCPServerConfig, error) {
151 res, err := c.Request(ctx, http.MethodGet, "/api/experimental/mcp/servers", nil)
152 if err != nil {
153 return nil, err
154 }
155 defer res.Body.Close()
156 if res.StatusCode != http.StatusOK {
157 return nil, ReadBodyAsError(res)
158 }
159 var configs []MCPServerConfig
160 return configs, json.NewDecoder(res.Body).Decode(&configs)
161}
162
163func (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)

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65