Add create
command to publisher CLI for generating server.json files
#152
+409
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new
create
command to the MCP Registry Publisher CLI tool that generates properly formattedserver.json
files from command-line flags, addressing the difficulty of manually creating these files.Changes Made
Core Implementation
main.go
to support subcommands (publish
andcreate
)publish
command functionality remains unchangedCreate Command Features
Required Flags
--name
,-n
: Server name (e.g.,io.github.owner/repo-name
)--description
,-d
: Server description--repo-url
: Repository URLOptional Flags
--execute
,-e
: Command invocation that generates runtime arguments--version
,-v
: Server version (default: "1.0.0")--env-var
: Environment variables in formatNAME:DESCRIPTION
(repeatable)--package-arg
: Package arguments in formatVALUE:DESCRIPTION
(repeatable)--runtime-hint
: Runtime hint (e.g., "docker")--registry
: Package registry name (default: "npm")--output
,-o
: Output file path (default: "server.json")Smart Command Parsing
The
--execute
flag intelligently parses command invocations:Generates runtime arguments with context-aware descriptions:
--rm
,--config
)/path/config.json
for--config
)Generated Output
Creates complete
server.json
files with:Documentation
Example Usage
The generated files provide a solid foundation that users can then edit to fine-tune descriptions, set argument requirements, and add remote server configurations.
Fixes #151.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.