@@ -66,14 +66,6 @@ func (g *Gateway) Run(ctx context.Context) error {
66
66
}
67
67
defer func () { _ = stopConfigWatcher () }()
68
68
69
- // Which servers are enabled in the registry.yaml?
70
- serverNames := configuration .ServerNames ()
71
- if len (serverNames ) == 0 {
72
- log ("- No server is enabled" )
73
- } else {
74
- log ("- Those servers are enabled:" , strings .Join (serverNames , ", " ))
75
- }
76
-
77
69
// Which docker images are used?
78
70
// Pull them and verify them if possible.
79
71
if ! g .Static {
@@ -91,6 +83,21 @@ func (g *Gateway) Run(ctx context.Context) error {
91
83
}
92
84
}
93
85
86
+ // Build a list of interceptors.
87
+ customInterceptors , err := interceptors .Parse (g .Interceptors )
88
+ if err != nil {
89
+ return fmt .Errorf ("parsing interceptors: %w" , err )
90
+ }
91
+ toolCallbacks := interceptors .Callbacks (g .LogCalls , g .BlockSecrets , customInterceptors )
92
+
93
+ // Which servers are enabled in the registry.yaml?
94
+ serverNames := configuration .ServerNames ()
95
+ if len (serverNames ) == 0 {
96
+ log ("- No server is enabled" )
97
+ } else {
98
+ log ("- Those servers are enabled:" , strings .Join (serverNames , ", " ))
99
+ }
100
+
94
101
// List all the available tools.
95
102
startList := time .Now ()
96
103
log ("- Listing MCP tools..." )
@@ -100,13 +107,6 @@ func (g *Gateway) Run(ctx context.Context) error {
100
107
}
101
108
log (">" , len (capabilities .Tools ), "tools listed in" , time .Since (startList ))
102
109
103
- // Build a list of interceptors.
104
- customInterceptors , err := interceptors .Parse (g .Interceptors )
105
- if err != nil {
106
- return fmt .Errorf ("parsing interceptors: %w" , err )
107
- }
108
- toolCallbacks := interceptors .Callbacks (g .LogCalls , g .BlockSecrets , customInterceptors )
109
-
110
110
// TODO: cleanup stopped servers. That happens in stdio over TCP mode.
111
111
var (
112
112
lock sync.Mutex
0 commit comments