7.9 KiB
7.9 KiB
CLI Help Menu Snapshot
mcporter mcp
Usage: mcporter mcp [options] <command>
Manage configured MCP servers, imports, and ad-hoc discoveries.
Commands:
list [options] [filter] Show merged servers (local + imports + ad-hoc cache)
get <name> Inspect a single server with resolved source info
add [options] <name> [target] Persist a server definition (URL or stdio command)
remove [options] <name> Delete a local entry or copy from an import
import <kind> [options] Copy entries from cursor/claude/codex/etc. into config
login <name|url> Complete OAuth/auth flows for a server
logout <name> Clear cached credentials for a server
doctor [options] Validate config files and report common mistakes
help [command] Show CLI or subcommand help
Global Options:
--config <path> Use an explicit config file (default: config/mcporter.json)
--root <dir> Set project root for import discovery (default: cwd)
--json Emit machine-readable output when supported
-h, --help Display help for mcporter mcp
Run `mcporter mcp help add` to see transport flags, ad-hoc persistence tips, and schema docs.
See https://github.com/sweetistics/mcporter/blob/main/docs/config.md for config anatomy, import precedence, and troubleshooting guidance.
Configuration Documentation Plan
Entry: CLI Help Experience
- Help Menu Blueprint
- Show
mcporter mcp --helpfirst: include short blurb on automatic discovery and where config files live. - Each subcommand help (
list,add,remove,import,login,logout,doctor) should include:- Inputs (positional + flags), default sources (local config, imports, ad-hoc), and whether the command mutates disk.
- Examples combining Codex-style positional syntax and Claude-style explicit transports.
- Add a shared “See also” footer pointing to docs sections for schema, imports, and ad-hoc workflows.
- Show
- In-CLI Guidance Hooks
- When
mcporter mcp addruns without args, the help text should reference the relevant doc anchors (e.g.,docs/config.md#server-entry-anatomy). - Error messages should include short
mcporter mcp help <verb>hints so the CLI stays self-documenting.
- When
Subcommand Parameters
- list [filter]
filter: optional server name, slug, or import source (source:cursor) to narrow results.- Flags:
--source <local|import|adhoc>,--include-schema,--json,--auto-authorize/--no-auto-authorize,--timeout <ms>, plus ad-hoc selectors shared with other verbs (--http-url,--stdio,--stdio-arg,--allow-http,--env KEY=VAL,--cwd <dir>,--name <slug>,--persist <path>).
- get
name: required server identifier (local or imported). Accepts URL/stdio descriptors for ad-hoc entries.- Flags:
--json,--show-source(reveal path and import stack),--include-schema,--reveal-secrets(requires explicit confirmation), ad-hoc selectors (--http-url,--stdio,--stdio-arg,--allow-http,--env,--cwd,--name,--persist).
- add [target]
name: slug to persist. Required.target: optional URL or stdio command shortcut; positional to match Codex UX.- Flags:
--transport <http|sse|stdio>(default auto-detect fromtarget).--url <https://…>or--command <bin>with trailing-- args;--stdio,--stdio-arg,--cwd,--allow-httpmirror today’s ad-hoc flags.--env KEY=VAL,--header KEY=VAL,--token-cache-dir,--description,--tag label,--client-name,--oauth-redirect-url.--persist(explicit path),--dry-run,--yesto skip prompts,--copy-from <importKind:name>.
- remove
name: required; supportsimportKind:namesyntax to remove a copied entry.- Flags:
--source <local|import>,--dry-run,--json,--yes.
- import
kind: one ofcursor,claude-code,claude-desktop,codex,windsurf,vscode.- Flags:
--path <file>(override auto-detected file),--filter <glob>(select subset),--copy(write into local config),--json.
- login <name|url>
- Argument accepts registered server names or ad-hoc descriptors (URL/stdio).
- Flags:
--browser <default|none>,--json,--forceto re-run OAuth,--persistto save inferred settings, ad-hoc selectors (--http-url,--stdio,--stdio-arg,--env,--cwd,--allow-http,--name).
- logout
name: server slug.- Flags:
--json,--allto clear every cached token.
- doctor
- Flags:
--fix(auto-correct schema issues),--json,--include-imports,--warn-only.
- Flags:
Detailed Explanation
Purpose and Audience
- Equip contributors with a mental model for mcporter’s auto-detect stack: repo config, imported editor configs, and ad-hoc CLI selectors.
- Outline how persistence, OAuth promotion, and token caching behave so engineers can move from experimentation to committed JSON confidently.
- Highlight differences vs. Cursor/Claude/Codex semantics to ease migration.
Proposed Content Flow
- Orientation & Quick Start
- Minimal
config/mcporter.jsonsample. - Bullet summary of discovery sources and when each is used.
- Link to
docs/adhoc.mdfor live experimentation.
- Minimal
- Discovery & Precedence
- Search order (
--config, repo defaults,$MCPORTER_CONFIG, imports, ad-hoc has highest priority for the current session). - Table marking read-only vs writable layers and how tie-breaking works.
- Search order (
- Ad-hoc & Auto-Persistence
- Behavior of
--http-url,--stdio, bare URLs, slug derivation, OAuth upgrades, and--persist. - How persisted entries fold back into
mcpServers.
- Behavior of
- Schema Overview
- Top-level keys with descriptions (
mcpServers,imports,tokenCacheDir, tags). - Interpolation syntax and inheritance.
- Top-level keys with descriptions (
- Server Entry Anatomy
- Transport-specific fields with validation cues.
- Security recommendations for env/header usage and token cache placement.
- Imports & Auto-Merge
- Source paths per import kind, priority ordering, and override semantics.
- Guidance on copying import entries locally (new CLI helper).
- CLI Management (
mcporter mcp …)- Summaries of each verb, including help snippets and examples reflecting both concise and explicit styles.
- Project vs. Machine Layers
- Repo layout advice, machine-specific overrides, CI considerations, and token storage.
- Validation & Troubleshooting
- Runtime warnings,
autoAuthorizebehavior, and the envisionedmcporter config doctor.
- Runtime warnings,
- Appendix & References
- Links to schema files, migration docs, call syntax, and adhoc references.
Implementation Plan
- Finalize help menu copy directly in the CLI, ensuring anchors exist in
docs/config.md. - Draft the detailed sections per the flow above, pulling examples from
config/mcporter.jsonanddocs/adhoc.md. - Cross-link README,
docs/call-syntax.md, and CLI help to the new doc. - Add regression tests (snapshot or golden files) to keep help text and docs in sync once the CLI verbs land.
Outstanding Coverage Items
- Document how
--persistreuses the same merge pipeline (pathsForImport) so users understand which file is mutated when persisting ad-hoc or imported servers. - Emphasize that
--allow-httpis mandatory for cleartext URLs and that--env KEY=VALentries merge with (and override) config-definedenv. - Spell out the automatic OAuth promotion for ad-hoc HTTP servers (see
docs/adhoc.md) and ensuremcporter mcp loginhelp text reflects that behavior.
Import Locations Reference
- Codex (
codex): mcporter reads Codex servers exclusively from.codex/config.toml—first from the project root, then from the user’s home directory (e.g.,~/.codex/config.toml). The legacy.codex/mcp.tomlfilename is no longer consulted, so users must follow Codex’s documented default.