Skip to content

feat(init): add mcp_config CLI options for reference mode#85

Merged
appcypher merged 2 commits intomainfrom
appcypher/init-mcp-config-cli-options
Feb 4, 2026
Merged

feat(init): add mcp_config CLI options for reference mode#85
appcypher merged 2 commits intomainfrom
appcypher/init-mcp-config-cli-options

Conversation

@appcypher
Copy link
Copy Markdown
Member

@appcypher appcypher commented Feb 3, 2026

Summary

  • Add CLI flags to tool init for directly specifying mcp_config values
  • Enable creating reference manifests without manual JSON editing
  • Support both stdio (--command, --args) and HTTP (--url, --headers, --oauth-*) transports
  • Add interactive prompts for command/args/url when selecting reference mode

This allows users to quickly create reference manifests pointing to external
MCP servers or commands without scaffolding code files.

Changes

  • lib/commands.rs: Add 9 new CLI arguments for mcp_config options (--command,
    --args, --env, --url, --header, --oauth-client-id, --oauth-authorization-url,
    --oauth-token-url, --oauth-scopes). Add clippy allow for large enum variant.
  • lib/handlers/tool/init.rs: Add McpConfigOptions struct for parsing CLI args,
    implement init_reference() function for creating reference manifests, add
    print_reference_success() for output formatting.
  • lib/prompt.rs: Add command/args/url fields to McpbPromptResult, prompt for
    these values in interactive mode when reference transport is selected.
  • bin/tool.rs: Wire new CLI arguments to init_mcpb handler.

Test Plan

  • Run tool init . --command npx --args "@scope/server --verbose" -y to verify
    stdio reference mode creates correct manifest
  • Run tool init . --url "https://api.example.com/mcp/" -y to verify HTTP
    reference mode
  • Run tool init . --url "https://example.com" --oauth-client-id abc -y to
    verify OAuth config
  • Run tool init interactively, select Reference mode, and verify prompts for
    command/args (stdio) or URL (http) appear
  • Run cargo test to ensure no regressions

fixes #86

Add new CLI flags to `tool init` for directly specifying mcp_config
values when creating reference manifests:

Stdio transport options:
- --command: executable to run (implies reference mode)
- --args: space-separated command arguments

HTTP transport options:
- --url: server URL (implies HTTP reference mode)
- --header: HTTP headers as KEY=VALUE (repeatable)
- --oauth-client-id, --oauth-authorization-url, --oauth-token-url,
  --oauth-scopes: OAuth configuration

Common options:
- --env: environment variables as KEY=VALUE (repeatable)

Interactive mode now prompts for command/args (stdio) or URL (http)
when reference mode is selected, enabling a complete workflow without
manual manifest editing.
Fixes RUSTSEC-2026-0007 integer overflow vulnerability in
BytesMut::reserve. While this project is not directly affected
(only uses immutable Bytes, no reserve calls), updating removes
the security advisory warning.
@appcypher appcypher merged commit 9d33b8b into main Feb 4, 2026
6 checks passed
@appcypher appcypher deleted the appcypher/init-mcp-config-cli-options branch February 4, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RUSTSEC-2026-0007: Integer overflow in BytesMut::reserve

1 participant