summaryrefslogtreecommitdiff
path: root/internal/hexaimcp/run.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-19 08:57:03 +0300
committerPaul Buetow <paul@buetow.org>2026-06-19 08:57:03 +0300
commit3b0816f11504ac9ef8f55b91b99371fbb55bb040 (patch)
tree38a6e4239fc2ac0f23977a69065468880ec70b07 /internal/hexaimcp/run.go
parent426068b0ea1fff4e2bfc708d8a3914379f084ad8 (diff)
fix mcp protocol test cleanup (7k0)
Diffstat (limited to 'internal/hexaimcp/run.go')
-rw-r--r--internal/hexaimcp/run.go20
1 files changed, 19 insertions, 1 deletions
diff --git a/internal/hexaimcp/run.go b/internal/hexaimcp/run.go
index 7043ed2..25897c6 100644
--- a/internal/hexaimcp/run.go
+++ b/internal/hexaimcp/run.go
@@ -67,6 +67,20 @@ func RunWithFactory(
stderr io.Writer,
factory ServerFactory,
) error {
+ loadOpts := appconfig.LoadOptions{ConfigPath: configPath}
+ return runWithFactoryLoadOptions(ctx, logPath, loadOpts, overrides, stdin, stdout, stderr, factory)
+}
+
+func runWithFactoryLoadOptions(
+ ctx context.Context,
+ logPath string,
+ loadOpts appconfig.LoadOptions,
+ overrides MCPOverrides,
+ stdin io.Reader,
+ stdout io.Writer,
+ stderr io.Writer,
+ factory ServerFactory,
+) error {
// Setup logger
logger, err := setupLogger(logPath)
if err != nil {
@@ -82,7 +96,7 @@ func RunWithFactory(
logger.Printf("WARNING: hexai-mcp-server is DEPRECATED and experimental - not actively maintained")
// Load configuration and apply CLI overrides
- cfg := loadConfig(ctx, logger, configPath)
+ cfg := loadConfigWithOptions(ctx, logger, loadOpts)
applyOverrides(&cfg, overrides)
return runServer(ctx, cfg, logger, stdin, stdout, factory)
@@ -148,6 +162,10 @@ func loadConfig(ctx context.Context, logger *log.Logger, configPath string) appc
ConfigPath: configPath,
IgnoreEnv: false,
}
+ return loadConfigWithOptions(ctx, logger, opts)
+}
+
+func loadConfigWithOptions(ctx context.Context, logger *log.Logger, opts appconfig.LoadOptions) appconfig.App {
return appconfig.LoadWithOptions(ctx, logger, opts)
}