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 <noreply@anthropic.com>
This commit is contained in:
parent
6246b88bd5
commit
35487b996c
3 changed files with 16 additions and 32 deletions
2
go.mod
2
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
|
||||
)
|
||||
|
|
|
|||
4
go.sum
4
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=
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue