createMCPServerConfig is a helper that creates a minimal enabled MCP server config with auth_type=none.
(t testing.TB, client *codersdk.Client, slug string, enabled bool)
| 40 | // createMCPServerConfig is a helper that creates a minimal enabled |
| 41 | // MCP server config with auth_type=none. |
| 42 | func createMCPServerConfig(t testing.TB, client *codersdk.Client, slug string, enabled bool) codersdk.MCPServerConfig { |
| 43 | t.Helper() |
| 44 | |
| 45 | ctx := testutil.Context(t, testutil.WaitLong) |
| 46 | config, err := client.CreateMCPServerConfig(ctx, codersdk.CreateMCPServerConfigRequest{ |
| 47 | DisplayName: "Test Server " + slug, |
| 48 | Slug: slug, |
| 49 | Description: "A test MCP server.", |
| 50 | IconURL: "https://example.com/icon.png", |
| 51 | Transport: "streamable_http", |
| 52 | URL: "https://mcp.example.com/" + slug, |
| 53 | AuthType: "none", |
| 54 | Availability: "default_on", |
| 55 | Enabled: enabled, |
| 56 | ToolAllowList: []string{}, |
| 57 | ToolDenyList: []string{}, |
| 58 | }) |
| 59 | require.NoError(t, err) |
| 60 | return config |
| 61 | } |
| 62 | |
| 63 | func TestMCPServerConfigsCRUD(t *testing.T) { |
| 64 | t.Parallel() |
no test coverage detected