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

Function createMCPServerConfig

coderd/mcp_test.go:42–61  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

40// createMCPServerConfig is a helper that creates a minimal enabled
41// MCP server config with auth_type=none.
42func 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
63func TestMCPServerConfigsCRUD(t *testing.T) {
64 t.Parallel()

Callers 3

TestChatWithMCPServerIDsFunction · 0.70

Calls 3

ContextFunction · 0.92
CreateMCPServerConfigMethod · 0.80
HelperMethod · 0.65

Tested by

no test coverage detected