Skip to content

Commit b2e5a80

Browse files
author
LittleCoinCoin
committed
docs: update CLI reference for environment-scoped list hosts
Update 'hatch mcp list hosts' documentation: - Clarify environment-scoped behavior vs system detection - Add --env and --detailed flag documentation - Include example outputs for basic and detailed modes - Distinguish from 'hatch mcp discover hosts' functionality Update 'hatch mcp discover hosts' documentation: - Clarify system detection purpose and scope - Add example output showing availability status - Emphasize difference from environment-scoped listing Maintains accurate documentation aligned with implementation
1 parent 077c532 commit b2e5a80

File tree

1 file changed

+72
-7
lines changed

1 file changed

+72
-7
lines changed

docs/articles/users/CLIReference.md

Lines changed: 72 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ Syntax:
347347
| `--command` | string | Command to execute for local servers (mutually exclusive with --url) | none |
348348
| `--url` | string | URL for remote MCP servers (mutually exclusive with --command) | none |
349349
| `--args` | multiple | Arguments for MCP server command (only with --command) | none |
350-
| `--env`, `-e` | string | Environment variables format: KEY=VALUE | none |
350+
| `--env` | string | Environment variables format: KEY=VALUE (can be used multiple times) | none |
351351
| `--headers` | string | HTTP headers format: KEY=VALUE (only with --url) | none |
352352
| `--dry-run` | flag | Preview configuration without applying changes | false |
353353
| `--auto-approve` | flag | Skip confirmation prompts | false |
@@ -390,7 +390,7 @@ Syntax:
390390

391391
### `hatch mcp remove host`
392392

393-
Remove complete host configuration.
393+
Remove complete host configuration (all MCP servers from the specified host).
394394

395395
Syntax:
396396

@@ -405,36 +405,101 @@ Syntax:
405405

406406
### `hatch mcp list hosts`
407407

408-
List available MCP host platforms.
408+
List MCP hosts configured in the current environment.
409+
410+
**Purpose**: Shows hosts that have MCP servers configured in the specified environment, with package-level details.
409411

410412
Syntax:
411413

412-
`hatch mcp list hosts [--detailed]`
414+
`hatch mcp list hosts [--env ENV] [--detailed]`
413415

414416
| Flag | Type | Description | Default |
415417
|---:|---|---|---|
416-
| `--detailed` | flag | Show detailed host information | false |
418+
| `--env` | string | Environment to list hosts from | current environment |
419+
| `--detailed` | flag | Show detailed configuration information | false |
420+
421+
**Example Output**:
422+
423+
```text
424+
Configured hosts for environment 'my-project':
425+
claude-desktop (2 packages)
426+
cursor (1 package)
427+
```
428+
429+
**Detailed Output** (`--detailed`):
430+
431+
```text
432+
Configured hosts for environment 'my-project':
433+
claude-desktop (2 packages):
434+
- weather-toolkit: ~/.claude/config.json (configured: 2025-09-25T10:00:00)
435+
- news-aggregator: ~/.claude/config.json (configured: 2025-09-25T11:30:00)
436+
cursor (1 package):
437+
- weather-toolkit: ~/.cursor/config.json (configured: 2025-09-25T10:15:00)
438+
```
439+
440+
**Example Output**:
441+
442+
```text
443+
Available MCP Host Platforms:
444+
✓ claude-desktop Available /Users/user/.claude/config.json
445+
✓ cursor Available /Users/user/.cursor/config.json
446+
✗ vscode Not Found /Users/user/.vscode/settings.json
447+
✗ lmstudio Not Found /Users/user/.lmstudio/config.json
448+
```
417449

418450
### `hatch mcp list servers`
419451

420-
List configured MCP servers from environment.
452+
List MCP servers from environment with host configuration tracking information.
453+
454+
**Purpose**: Shows servers from environment packages with detailed host configuration tracking, including which hosts each server is configured on and last sync timestamps.
421455

422456
Syntax:
423457

424-
`hatch mcp list servers [--env ENV]`
458+
`hatch mcp list servers [--env ENV] [--host HOST]`
425459

426460
| Flag | Type | Description | Default |
427461
|---:|---|---|---|
428462
| `--env`, `-e` | string | Environment name (defaults to current) | current environment |
463+
| `--host` | string | Filter by specific host to show only servers configured on that host | none |
464+
465+
**Example Output**:
466+
467+
```text
468+
MCP servers in environment 'default':
469+
Server Name Package Version Command
470+
--------------------------------------------------------------------------------
471+
weather-server weather-toolkit 1.0.0 python weather.py
472+
Configured on hosts:
473+
claude-desktop: /Users/user/.claude/config.json (last synced: 2025-09-24T10:00:00)
474+
cursor: /Users/user/.cursor/config.json (last synced: 2025-09-24T09:30:00)
475+
476+
news-aggregator news-toolkit 2.1.0 python news.py
477+
Configured on hosts:
478+
claude-desktop: /Users/user/.claude/config.json (last synced: 2025-09-24T10:00:00)
479+
```
429480

430481
### `hatch mcp discover hosts`
431482

432483
Discover available MCP host platforms on the system.
433484

485+
**Purpose**: Shows ALL host platforms (both available and unavailable) with system detection status.
486+
434487
Syntax:
435488

436489
`hatch mcp discover hosts`
437490

491+
**Example Output**:
492+
493+
```text
494+
Available MCP host platforms:
495+
claude-desktop: ✓ Available
496+
Config path: ~/.claude/config.json
497+
cursor: ✓ Available
498+
Config path: ~/.cursor/config.json
499+
vscode: ✗ Not detected
500+
Config path: ~/.vscode/config.json
501+
```
502+
438503
### `hatch mcp discover servers`
439504

440505
Discover MCP servers in Hatch environments.

0 commit comments

Comments
 (0)