From 35487b996c8dfa7e76d010cc85c4480393a5a566 Mon Sep 17 00:00:00 2001 From: thibaud-leclere Date: Tue, 12 May 2026 10:39:41 +0200 Subject: [PATCH] chore: upgrade mcp-framework to v1.11.0, revert to bootstrap.Run v1.11.0 auto-disables commands whose hooks are nil, so the custom dispatcher is no longer needed. Co-Authored-By: Claude Sonnet 4.6 --- go.mod | 2 +- go.sum | 4 ++-- internal/app/app.go | 42 +++++++++++++----------------------------- 3 files changed, 16 insertions(+), 32 deletions(-) diff --git a/go.mod b/go.mod index a7ee011..1e5fa2c 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module forge.lclr.dev/AI/xdebug-mcp go 1.25.5 require ( - forge.lclr.dev/AI/mcp-framework v1.10.0 + forge.lclr.dev/AI/mcp-framework v1.11.0 github.com/mark3labs/mcp-go v0.52.0 github.com/stretchr/testify v1.11.1 ) diff --git a/go.sum b/go.sum index 6ed9b8e..92e59de 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -forge.lclr.dev/AI/mcp-framework v1.10.0 h1:RrTy7K/hSruaVS9Z/oaRpkLs2U5WGs4H3tox7PiErak= -forge.lclr.dev/AI/mcp-framework v1.10.0/go.mod h1:2xzmFEHGLQzT5PORq35j10pRhsOm0CDwivUZTHvxgh4= +forge.lclr.dev/AI/mcp-framework v1.11.0 h1:Yon3n1YghlUn0g2tdkUEoLVlpHUR9ijELdl3d2xiyvM= +forge.lclr.dev/AI/mcp-framework v1.11.0/go.mod h1:2xzmFEHGLQzT5PORq35j10pRhsOm0CDwivUZTHvxgh4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/99designs/keyring v1.2.2 h1:pZd3neh/EmUzWONb35LxQfvuY7kiSXAq3HQd97+XBn0= diff --git a/internal/app/app.go b/internal/app/app.go index 7daf2f6..38744ff 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -2,45 +2,29 @@ package app import ( "context" - "fmt" - "io" - "os" - "strings" "github.com/mark3labs/mcp-go/server" + "forge.lclr.dev/AI/mcp-framework/bootstrap" "forge.lclr.dev/AI/xdebug-mcp/internal/cache" "forge.lclr.dev/AI/xdebug-mcp/internal/tools" "forge.lclr.dev/AI/xdebug-mcp/mcpgen" ) -func Run(_ context.Context, args []string, version string) error { +func Run(ctx context.Context, args []string, version string) error { c := cache.New(cache.DefaultCapacity) - return dispatch(args, version, c, os.Stdout) -} -func dispatch(args []string, version string, c *cache.Cache, stdout io.Writer) error { - cmd := "mcp" - if len(args) > 0 { - cmd = strings.TrimSpace(args[0]) - } - - switch cmd { - case "", "mcp": - return runMCP(c, version) - case "version": - _, err := fmt.Fprintln(stdout, version) - return err - case "help", "-h", "--help": - _, err := fmt.Fprintf(stdout, - "%s\n\nUsage:\n %s [command]\n\nCommands:\n mcp Run the MCP server (default)\n version Print the version\n\nOptions:\n -h, --help Show this help\n", - mcpgen.DefaultDescription, - mcpgen.BinaryName, - ) - return err - default: - return fmt.Errorf("unknown command %q — run '%s --help' for usage", cmd, mcpgen.BinaryName) - } + return bootstrap.Run(ctx, bootstrap.Options{ + BinaryName: mcpgen.BinaryName, + Description: mcpgen.DefaultDescription, + Version: version, + Args: args, + Hooks: bootstrap.Hooks{ + MCP: func(ctx context.Context, inv bootstrap.Invocation) error { + return runMCP(c, version) + }, + }, + }) } func runMCP(c *cache.Cache, version string) error {