(t *testing.T)
| 137 | } |
| 138 | |
| 139 | func TestConnectAll_ToolAllowList(t *testing.T) { |
| 140 | t.Parallel() |
| 141 | ctx := context.Background() |
| 142 | logger := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true}) |
| 143 | |
| 144 | ts := newTestMCPServer(t, echoTool(), greetTool()) |
| 145 | |
| 146 | cfg := makeConfig("filtered", ts.URL) |
| 147 | // Only allow the "echo" tool. |
| 148 | cfg.ToolAllowList = []string{"echo"} |
| 149 | |
| 150 | tools, cleanup := mcpclient.ConnectAll(ctx, logger, []database.MCPServerConfig{cfg}, nil, uuid.Nil, nil, nil) |
| 151 | t.Cleanup(cleanup) |
| 152 | |
| 153 | require.Len(t, tools, 1) |
| 154 | assert.Equal(t, "filtered__echo", tools[0].Info().Name) |
| 155 | } |
| 156 | |
| 157 | func TestConnectAll_ToolDenyList(t *testing.T) { |
| 158 | t.Parallel() |
nothing calls this directly
no test coverage detected