@@ -563,8 +563,13 @@ async function probeMcpServersOrFail(params: {
|
563 | 563 | } |
564 | 564 | } |
565 | 565 | |
| 566 | +const OPENCLAW_MCP_REGISTRY_SCOPE_NOTE = |
| 567 | +"Note: this command only shows OpenClaw-managed mcp.servers entries and does not include mcporter servers from config/mcporter.json."; |
| 568 | + |
566 | 569 | export function registerMcpCli(program: Command) { |
567 | | -const mcp = program.command("mcp").description("Manage OpenClaw MCP config and channel bridge"); |
| 570 | +const mcp = program |
| 571 | +.command("mcp") |
| 572 | +.description("Manage OpenClaw mcp.servers config and channel bridge"); |
568 | 573 | |
569 | 574 | mcp |
570 | 575 | .command("serve") |
@@ -610,7 +615,7 @@ export function registerMcpCli(program: Command) {
|
610 | 615 | |
611 | 616 | mcp |
612 | 617 | .command("list") |
613 | | -.description("List configured MCP servers") |
| 618 | +.description("List OpenClaw-managed MCP servers from mcp.servers") |
614 | 619 | .option("--json", "Print JSON") |
615 | 620 | .action(async (opts: { json?: boolean }) => { |
616 | 621 | const loaded = await listConfiguredMcpServers(); |
@@ -624,19 +629,22 @@ export function registerMcpCli(program: Command) {
|
624 | 629 | const names = Object.keys(loaded.mcpServers).toSorted(); |
625 | 630 | if (names.length === 0) { |
626 | 631 | defaultRuntime.log( |
627 | | -`No MCP servers configured in ${loaded.path}. Add one with ${formatCliCommand('openclaw mcp set <name> \'{"command":"uvx","args":["context7-mcp"]}\'')}.`, |
| 632 | +`No OpenClaw-managed MCP servers configured in ${loaded.path}. Add one with ${formatCliCommand('openclaw mcp set <name> \'{"command":"uvx","args":["context7-mcp"]}\'')}.`, |
628 | 633 | ); |
| 634 | +defaultRuntime.log(OPENCLAW_MCP_REGISTRY_SCOPE_NOTE); |
629 | 635 | return; |
630 | 636 | } |
631 | | -defaultRuntime.log(`MCP servers (${loaded.path}):`); |
| 637 | +defaultRuntime.log(`OpenClaw-managed MCP servers (${loaded.path}):`); |
632 | 638 | for (const name of names) { |
633 | 639 | defaultRuntime.log(`- ${name}`); |
634 | 640 | } |
| 641 | +defaultRuntime.log(""); |
| 642 | +defaultRuntime.log(OPENCLAW_MCP_REGISTRY_SCOPE_NOTE); |
635 | 643 | }); |
636 | 644 | |
637 | 645 | mcp |
638 | 646 | .command("show") |
639 | | -.description("Show one configured MCP server or the full MCP config") |
| 647 | +.description("Show one OpenClaw-managed MCP server or the full mcp.servers config") |
640 | 648 | .argument("[name]", "MCP server name") |
641 | 649 | .option("--json", "Print JSON") |
642 | 650 | .action(async (name: string | undefined, opts: { json?: boolean }) => { |
@@ -655,9 +663,9 @@ export function registerMcpCli(program: Command) {
|
655 | 663 | return; |
656 | 664 | } |
657 | 665 | if (name) { |
658 | | -defaultRuntime.log(`MCP server "${name}" (${loaded.path}):`); |
| 666 | +defaultRuntime.log(`OpenClaw-managed MCP server "${name}" (${loaded.path}):`); |
659 | 667 | } else { |
660 | | -defaultRuntime.log(`MCP servers (${loaded.path}):`); |
| 668 | +defaultRuntime.log(`OpenClaw-managed MCP servers (${loaded.path}):`); |
661 | 669 | } |
662 | 670 | printJson(value ?? {}); |
663 | 671 | }); |
@@ -983,7 +991,7 @@ export function registerMcpCli(program: Command) {
|
983 | 991 | |
984 | 992 | mcp |
985 | 993 | .command("set") |
986 | | -.description("Set one configured MCP server from a JSON object") |
| 994 | +.description("Set one OpenClaw-managed MCP server from a JSON object") |
987 | 995 | .argument("<name>", "MCP server name") |
988 | 996 | .argument("<value>", 'JSON object, for example {"command":"uvx","args":["context7-mcp"]}') |
989 | 997 | .action(async (name: string, rawValue: string) => { |
@@ -1309,7 +1317,7 @@ export function registerMcpCli(program: Command) {
|
1309 | 1317 | |
1310 | 1318 | mcp |
1311 | 1319 | .command("unset") |
1312 | | -.description("Remove one configured MCP server") |
| 1320 | +.description("Remove one OpenClaw-managed MCP server") |
1313 | 1321 | .argument("<name>", "MCP server name") |
1314 | 1322 | .action(async (name: string) => { |
1315 | 1323 | const loaded = await listConfiguredMcpServers(); |
|