From 53f4d2fd8e3afe821889f38cccfbde19a13d4991 Mon Sep 17 00:00:00 2001 From: adam jones Date: Fri, 29 Aug 2025 14:45:36 +0100 Subject: [PATCH] Move publisher CLI from tools/ to cmd/ (#326) ## Summary Move the publisher CLI from `tools/publisher/` to `cmd/publisher/` as it's a proper application rather than a development utility. This addresses feedback from @rdimitrov in PR #324 that the publisher CLI should be under `cmd/` since it's not really a tool in the same sense as other helpers in the `tools/` folder. ## Changes - Moved `tools/publisher/` directory to `cmd/publisher/` - Updated Makefile build and clean targets - Updated README.md documentation links - Updated VS Code launch configuration - Updated integration test script - Updated FAQ documentation - Fixed Go import paths in publisher code --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: adam jones --- .vscode/launch.json | 4 ++-- Makefile | 4 ++-- README.md | 6 +++--- {tools => cmd}/publisher/README.md | 0 {tools => cmd}/publisher/auth/common.go | 0 {tools => cmd}/publisher/auth/dns.go | 0 {tools => cmd}/publisher/auth/github-at.go | 0 {tools => cmd}/publisher/auth/github-oidc.go | 0 {tools => cmd}/publisher/auth/http.go | 0 {tools => cmd}/publisher/auth/interface.go | 0 {tools => cmd}/publisher/auth/none.go | 0 {tools => cmd}/publisher/build.sh | 0 {tools => cmd}/publisher/commands/init.go | 0 {tools => cmd}/publisher/commands/login.go | 2 +- {tools => cmd}/publisher/commands/logout.go | 0 {tools => cmd}/publisher/commands/publish.go | 0 {tools => cmd}/publisher/main.go | 2 +- docs/faq.md | 2 +- tests/integration/run.sh | 2 +- 19 files changed, 11 insertions(+), 11 deletions(-) rename {tools => cmd}/publisher/README.md (100%) rename {tools => cmd}/publisher/auth/common.go (100%) rename {tools => cmd}/publisher/auth/dns.go (100%) rename {tools => cmd}/publisher/auth/github-at.go (100%) rename {tools => cmd}/publisher/auth/github-oidc.go (100%) rename {tools => cmd}/publisher/auth/http.go (100%) rename {tools => cmd}/publisher/auth/interface.go (100%) rename {tools => cmd}/publisher/auth/none.go (100%) rename {tools => cmd}/publisher/build.sh (100%) rename {tools => cmd}/publisher/commands/init.go (100%) rename {tools => cmd}/publisher/commands/login.go (97%) rename {tools => cmd}/publisher/commands/logout.go (100%) rename {tools => cmd}/publisher/commands/publish.go (100%) rename {tools => cmd}/publisher/main.go (95%) diff --git a/.vscode/launch.json b/.vscode/launch.json index aba7778..8038ebe 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -18,10 +18,10 @@ "type": "go", "request": "launch", "mode": "auto", - "program": "${workspaceFolder}/tools/publisher/main.go", + "program": "${workspaceFolder}/cmd/publisher/main.go", "args": [ "-registry-url=http://localhost:8080", - "-mcp-file=${workspaceFolder}/tools/publisher/server.json", + "-mcp-file=${workspaceFolder}/cmd/publisher/server.json", ], } ] diff --git a/Makefile b/Makefile index 69a7cfa..7d490f3 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ build: ## Build the registry application go build -o bin/registry ./cmd/registry publisher: ## Build the publisher tool - cd tools/publisher && ./build.sh + cd cmd/publisher && ./build.sh # Test targets test-unit: ## Run unit tests with coverage @@ -64,7 +64,7 @@ dev-local: ## Run registry locally clean: ## Clean build artifacts and coverage files rm -rf bin rm -f coverage.out coverage.html - cd tools/publisher && rm -f publisher + cd cmd/publisher && rm -f publisher .DEFAULT_GOAL := help diff --git a/README.md b/README.md index 9d39a19..b01d19a 100644 --- a/README.md +++ b/README.md @@ -103,10 +103,10 @@ To publish a server, we've built a simple CLI. You can use it with: make publisher # Use it! -./tools/publisher/bin/mcp-publisher --help +./cmd/publisher/bin/mcp-publisher --help ``` -See [the publisher README](./tools/publisher/README.md) for more details. +See [the publisher README](./cmd/publisher/README.md) for more details. #### Other commands @@ -127,6 +127,7 @@ For Claude and other AI tools: Always prefer make targets over custom commands w ``` ├── cmd/ # Application entry points +│ └── publisher/ # Server publishing tool ├── data/ # Seed data ├── deploy/ # Deployment configuration (Pulumi) ├── docs/ # Technical documentation @@ -147,7 +148,6 @@ For Claude and other AI tools: Always prefer make targets over custom commands w ├── scripts/ # Development and testing scripts ├── tests/ # Integration tests └── tools/ # CLI tools and utilities - ├── publisher/ # Server publishing tool └── validate-*.sh # Schema validation tools ``` diff --git a/tools/publisher/README.md b/cmd/publisher/README.md similarity index 100% rename from tools/publisher/README.md rename to cmd/publisher/README.md diff --git a/tools/publisher/auth/common.go b/cmd/publisher/auth/common.go similarity index 100% rename from tools/publisher/auth/common.go rename to cmd/publisher/auth/common.go diff --git a/tools/publisher/auth/dns.go b/cmd/publisher/auth/dns.go similarity index 100% rename from tools/publisher/auth/dns.go rename to cmd/publisher/auth/dns.go diff --git a/tools/publisher/auth/github-at.go b/cmd/publisher/auth/github-at.go similarity index 100% rename from tools/publisher/auth/github-at.go rename to cmd/publisher/auth/github-at.go diff --git a/tools/publisher/auth/github-oidc.go b/cmd/publisher/auth/github-oidc.go similarity index 100% rename from tools/publisher/auth/github-oidc.go rename to cmd/publisher/auth/github-oidc.go diff --git a/tools/publisher/auth/http.go b/cmd/publisher/auth/http.go similarity index 100% rename from tools/publisher/auth/http.go rename to cmd/publisher/auth/http.go diff --git a/tools/publisher/auth/interface.go b/cmd/publisher/auth/interface.go similarity index 100% rename from tools/publisher/auth/interface.go rename to cmd/publisher/auth/interface.go diff --git a/tools/publisher/auth/none.go b/cmd/publisher/auth/none.go similarity index 100% rename from tools/publisher/auth/none.go rename to cmd/publisher/auth/none.go diff --git a/tools/publisher/build.sh b/cmd/publisher/build.sh similarity index 100% rename from tools/publisher/build.sh rename to cmd/publisher/build.sh diff --git a/tools/publisher/commands/init.go b/cmd/publisher/commands/init.go similarity index 100% rename from tools/publisher/commands/init.go rename to cmd/publisher/commands/init.go diff --git a/tools/publisher/commands/login.go b/cmd/publisher/commands/login.go similarity index 97% rename from tools/publisher/commands/login.go rename to cmd/publisher/commands/login.go index 15397ef..964c675 100644 --- a/tools/publisher/commands/login.go +++ b/cmd/publisher/commands/login.go @@ -9,7 +9,7 @@ import ( "os" "path/filepath" - "github.com/modelcontextprotocol/registry/tools/publisher/auth" + "github.com/modelcontextprotocol/registry/cmd/publisher/auth" ) const ( diff --git a/tools/publisher/commands/logout.go b/cmd/publisher/commands/logout.go similarity index 100% rename from tools/publisher/commands/logout.go rename to cmd/publisher/commands/logout.go diff --git a/tools/publisher/commands/publish.go b/cmd/publisher/commands/publish.go similarity index 100% rename from tools/publisher/commands/publish.go rename to cmd/publisher/commands/publish.go diff --git a/tools/publisher/main.go b/cmd/publisher/main.go similarity index 95% rename from tools/publisher/main.go rename to cmd/publisher/main.go index fbfee7c..e84aa78 100644 --- a/tools/publisher/main.go +++ b/cmd/publisher/main.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/modelcontextprotocol/registry/tools/publisher/commands" + "github.com/modelcontextprotocol/registry/cmd/publisher/commands" ) func main() { diff --git a/docs/faq.md b/docs/faq.md index bd75cc9..548a2d9 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -41,7 +41,7 @@ See [roadmap.md](./roadmap.md). ### How do I publish my MCP server? -See the [publisher README](../tools/publisher/README.md) +See the [publisher README](../cmd/publisher/README.md) ### What namespaces are available? diff --git a/tests/integration/run.sh b/tests/integration/run.sh index f785a34..5a0718b 100755 --- a/tests/integration/run.sh +++ b/tests/integration/run.sh @@ -9,7 +9,7 @@ cleanup() { docker compose down -v } -go build -o ./bin/publisher ./tools/publisher +go build -o ./bin/publisher ./cmd/publisher docker build -t registry .