Commit b47f127
fix: add input validation for non-interactive
- Validate server name is non-empty (reject whitespace-only)
- Use `trim().split(/\s+/).filter(Boolean)` for command parsing
instead of naive `split(" ")` that breaks on multiple spaces
- Add `URL.canParse()` validation for remote server URLs,
matching interactive mode's validation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>mcp add
1 parent 8b7ab63 commit b47f127
1 file changed
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
456 | 461 | | |
457 | 462 | | |
458 | 463 | | |
| |||
462 | 467 | | |
463 | 468 | | |
464 | 469 | | |
465 | | - | |
| 470 | + | |
466 | 471 | | |
467 | 472 | | |
468 | 473 | | |
469 | 474 | | |
470 | 475 | | |
471 | | - | |
| 476 | + | |
472 | 477 | | |
473 | 478 | | |
474 | 479 | | |
475 | 480 | | |
476 | 481 | | |
477 | 482 | | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
478 | 487 | | |
479 | 488 | | |
480 | 489 | | |
| |||
0 commit comments