Simplify seed data configuration by removing command line flags and renaming environment variable (#175)

This PR simplifies the seed data import configuration based on
maintainer feedback by removing command line flags and using a clearer
environment variable name.

## Key Changes

### Configuration Simplification
- **Renamed**: `MCP_REGISTRY_SEED_FILE_PATH` → `MCP_REGISTRY_SEED_FROM`
- **Removed**: `--seed-file-path` command line flag to eliminate
configuration complexity

### Improved User Experience
Users now configure seed data import using a single, clear environment
variable:

```bash
# Before (multiple ways to configure)
MCP_REGISTRY_SEED_FILE_PATH=data/seed.json ./registry
./registry --seed-file-path=data/seed.json

# After (simplified single method)
MCP_REGISTRY_SEED_FROM=data/seed.json ./registry
```

### Registry Composability
The composability workflow is now simplified while maintaining all
functionality:

```bash
# Start first registry with seed data
MCP_REGISTRY_SEED_FROM=data/seed.json ./registry

# Start second registry importing from first via pagination
MCP_REGISTRY_SEED_FROM=http://localhost:8080 ./registry
```

## Technical Implementation
- Maintains full backward compatibility for import functionality
- All existing seed data sources continue to work (local files, HTTP
URLs, registry URLs)
- Automatic pagination through `/v0/servers` endpoint remains unchanged
- Configurable delays between requests preserved

## Benefits
- **Reduced complexity**: Single configuration method instead of
multiple
- **Clearer naming**: `SEED_FROM` better describes the source of seed
data
- **Easier maintenance**: Fewer configuration paths to test and document
- **Consistent patterns**: Aligns with other environment-variable-only
configuration

All existing functionality is preserved while providing a cleaner, more
maintainable configuration interface.

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 Share your feedback on Copilot coding agent for the chance to win a
$200 gift card! Click
[here](https://survey.alchemer.com/s3/8343779/Copilot-Coding-agent) to
start the survey.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Avinash Sridhar <sridharavinash@users.noreply.github.com>
Co-authored-by: Toby Padilla <toby@toby.sh>
Co-authored-by: toby <83556+toby@users.noreply.github.com>
This commit is contained in:
Copilot 2025-08-08 13:42:16 +01:00 • committed by GitHub
commit 9c49c8b9b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 570 additions and 152 deletions

View file

@ -103,7 +103,8 @@ func publishCommand() error {
publishFlags.StringVar(&registryURL, "registry-url", "", "URL of the registry (required)")
publishFlags.StringVar(&mcpFilePath, "mcp-file", "", "path to the MCP file (required)")
publishFlags.BoolVar(&forceLogin, "login", false, "force a new login even if a token exists")
publishFlags.StringVar(&authMethod, "auth-method", "github-oauth", "authentication method to use (default: github-oauth)")
publishFlags.StringVar(&authMethod, "auth-method", "github-oauth",
"authentication method to use (default: github-oauth)")
// Set custom usage function
publishFlags.Usage = func() {
@ -210,16 +211,20 @@ func createCommand() error {
createFlags.StringVar(&execute, "e", "", "Command to execute the server (shorthand)")
// Custom flag for environment variables
createFlags.Func("env-var", "Environment variable in format NAME:DESCRIPTION (can be repeated)", func(value string) error {
envVars = append(envVars, value)
return nil
})
createFlags.Func("env-var",
"Environment variable in format NAME:DESCRIPTION (can be repeated)",
func(value string) error {
envVars = append(envVars, value)
return nil
})
// Custom flag for package arguments
createFlags.Func("package-arg", "Package argument in format VALUE:DESCRIPTION (can be repeated)", func(value string) error {
packageArgs = append(packageArgs, value)
return nil
})
createFlags.Func("package-arg",
"Package argument in format VALUE:DESCRIPTION (can be repeated)",
func(value string) error {
packageArgs = append(packageArgs, value)
return nil
})
// Set custom usage function
createFlags.Usage = func() {
@ -240,7 +245,8 @@ func createCommand() error {
fmt.Fprint(os.Stdout, " --package-version string Package version (defaults to server version)\n")
fmt.Fprint(os.Stdout, " --runtime-hint string Runtime hint (e.g., docker)\n")
fmt.Fprint(os.Stdout, " --repo-source string Repository source (default: github)\n")
fmt.Fprint(os.Stdout, " --env-var string Environment variable in format NAME:DESCRIPTION (can be repeated)\n")
fmt.Fprint(os.Stdout, " --env-var string Environment variable in format "+
"NAME:DESCRIPTION (can be repeated)\n")
fmt.Fprint(os.Stdout, " --package-arg string Package argument in format VALUE:DESCRIPTION (can be repeated)\n")
}
@ -360,8 +366,11 @@ func publishToRegistry(registryURL string, mcpData []byte, token string) error {
return nil
}
func createServerStructure(name, description, version, repoURL, repoSource, registryName,
packageName, packageVersion, runtimeHint, execute string, envVars []string, packageArgs []string, status string) ServerJSON {
func createServerStructure(
name, description, version, repoURL, repoSource, registryName,
packageName, packageVersion, runtimeHint, execute string,
envVars []string, packageArgs []string, status string,
) ServerJSON {
// Parse environment variables
var environmentVariables []EnvironmentVariable
for _, envVar := range envVars {

View file

@ -14,7 +14,7 @@ import (
"regexp"
"strings"
"github.com/santhosh-tekuri/jsonschema/v5"
jsonschema "github.com/santhosh-tekuri/jsonschema/v5"
)
const (

View file

@ -13,7 +13,7 @@ import (
"path/filepath"
"strings"
"github.com/santhosh-tekuri/jsonschema/v5"
jsonschema "github.com/santhosh-tekuri/jsonschema/v5"
)
func main() {