Skip to content

Commit 2fbafff

Browse files
committed
fix: improve error messages for MCP file handling in server commands
1 parent f607202 commit 2fbafff

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cmd/server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func runServer(ctx context.Context, logger *slog.Logger, argsToPass []string) er
139139
acpMCPFile := viper.GetString(FlagMCPFile)
140140

141141
if acpMCPFile != "" && !experimentalACP {
142-
return xerrors.Errorf("--mcp-file requires --experimental-acp requires to be set")
142+
return xerrors.Errorf("--mcp-file requires --experimental-acp")
143143
}
144144

145145
if experimentalACP && (saveState || loadState) {

x/acpio/acpio.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,20 +194,20 @@ func getSupportedMCPConfig(mcpFilePath string, logger *slog.Logger, initResp *ac
194194

195195
mcpFile, err := os.Open(mcpFilePath)
196196
if err != nil {
197-
return nil, xerrors.Errorf("Failed to open mcp file: %v", err)
197+
return nil, xerrors.Errorf("Failed to open mcp file: %w", err)
198198
}
199199

200200
defer func() {
201201
if closeErr := mcpFile.Close(); closeErr != nil {
202-
logger.Error("Failed to close mcp file", "error", err)
202+
logger.Error("Failed to close mcp file", "path", mcpFilePath, "error", closeErr)
203203
}
204204
}()
205205

206206
var allMcpList McpConfig
207207
decoder := json.NewDecoder(mcpFile)
208208

209209
if err = decoder.Decode(&allMcpList); err != nil {
210-
return nil, xerrors.Errorf("Failed to decode mcp file: %v", err)
210+
return nil, xerrors.Errorf("Failed to decode mcp file: %w", err)
211211
}
212212

213213
// Only send the MCPs that are supported by the agents

0 commit comments

Comments
 (0)