-
Notifications
You must be signed in to change notification settings - Fork 97
Closed
Description
-p option within the shell is not working as intended and it causes shell to crash.
Steps to Reproduce
echo "Hello, World" > ~/file.txtmcp shell npx -y @modelcontextprotocol/server-filesystem ~- mcp > call read_file --params {"path":"~/file.txt"}
Hello, World - Try to call read_file using the short parameter flag
mcp > call read_file -p {"path":"~/file.txt"} panic: runtime error: index out of range [4] with length 3 goroutine 1 [running]: main.main.newShellCmd.func8(0xc0000fe500?, {0xc0000ae500, 0x4, 0x5e6de76?}) github.com/f/mcptools/cmd/mcptools/main.go:687 +0x176f github.com/spf13/cobra.(*Command).execute(0xc000103808, {0xc0000ae500, 0x4, 0x4}) github.com/spf13/cobra@v1.9.1/command.go:1019 +0xa7b github.com/spf13/cobra.(*Command).ExecuteC(0xc000102008) github.com/spf13/cobra@v1.9.1/command.go:1148 +0x40c github.com/spf13/cobra.(*Command).Execute(...) github.com/spf13/cobra@v1.9.1/command.go:1071 main.main() github.com/f/mcptools/cmd/mcptools/main.go:64 +0x307
I believe this is caused by incorrect variable usage in this for loop commandArgs[i] == flagParamsShort should be replaced with ii
for ii := 1; ii < len(commandArgs); ii++ {
if commandArgs[ii] == flagParams || commandArgs[i] == flagParamsShort {
.
.
.
Metadata
Metadata
Assignees
Labels
No labels