Commit 24d5345
committed
feat(cli): agent-first output — JSON default, compact index, search, human mode
v1.2.2
Changed:
- JSON is now the default output for list-tools and bare invocation
- Bare 'mcp-cli-ent' outputs compact index: {server: [{name, description}]}
- --human flag switches to terminal output (terse by default)
- --human --verbose expands to 4-line format (desc, params, call)
- All stdout pollution removed in JSON mode (headers, errors → stderr)
- Empty results return structured JSON error with error_code
Added:
- --search <query> filters tools by name/description (case-insensitive)
- --verbose in JSON mode includes full inputSchema
- Shared JSONTool, indexTool types and encodeErrorJSON helper
Fixed:
- Dead verbose branch removed (identical if/else output)
- Server count after search uses actual matching servers
- Deterministic output: server keys sorted alphabetically
- jsonServer dead code deleted
- desc/description field name consistency across commands1 parent 4370983 commit 24d5345
4 files changed
Lines changed: 257 additions & 77 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
5 | 28 | | |
6 | 29 | | |
7 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | 388 | | |
394 | 389 | | |
395 | 390 | | |
| |||
452 | 447 | | |
453 | 448 | | |
454 | 449 | | |
455 | | - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
456 | 455 | | |
457 | 456 | | |
458 | 457 | | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
474 | 464 | | |
475 | 465 | | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
481 | 469 | | |
482 | | - | |
| 470 | + | |
483 | 471 | | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
489 | 486 | | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
490 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
491 | 496 | | |
492 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
493 | 504 | | |
494 | 505 | | |
495 | 506 | | |
| |||
0 commit comments