| Filename | Latest commit message | Latest commit date |
|---|---|---|
## Summary Addresses two related enhancements to `mcp-publisher init`: - **Copy `version` from `package.json`** (#736): When `package.json` is present and contains a `version` field, it is now used for both the top-level `version` and `packages[].version` in the generated `server.json`. Falls back to `"1.0.0"` when unavailable. This aligns with the recommended best practice of keeping server version in sync with package version. - **Prefer `mcpName` over `name`** (#737): The init command now checks for `mcpName` in `package.json` first, falling back to `name` if `mcpName` is not defined. This ensures the generated server name matches the required `mcpName` property. Closes #736 Closes #737 ## Changes - `cmd/publisher/commands/init.go`: - Added `getVersionFromPackageJSON()` helper to read version from `package.json` - Modified `InitCommand()` to use detected version with `"1.0.0"` fallback - Modified `getNameFromPackageJSON()` to prefer `mcpName` over `name` ## Test plan - [x] `go build ./cmd/publisher/...` compiles without errors - [x] `go test ./cmd/publisher/commands/...` passes all existing tests - [ ] Manual: run `mcp-publisher init` in a directory with `package.json` containing `version` and `mcpName` — verify both are copied to `server.json` - [ ] Manual: run `mcp-publisher init` in a directory with `package.json` without `mcpName` — verify `name` is used as fallback - [ ] Manual: run `mcp-publisher init` in a directory without `package.json` — verify defaults (`"1.0.0"`, directory name) are used ## AI Disclosure AI assistance (Claude) was used for initial code exploration and issue research. The implementation was written and reviewed by the author. Co-authored-by: Radoslav Dimitrov <radoslav@stacklok.com> |
||
| .. | ||
| auth | ||
| commands | ||
| main.go | ||
| README.md | ||
MCP Publisher Tool - Development
CLI tool for publishing MCP servers to the registry.
These docs are for contributors. See the Publisher User Guide for end-user documentation.
Quick Development Setup
# Build the tool
make publisher
# Test locally
make dev-compose # Start local registry
./bin/mcp-publisher init
./bin/mcp-publisher login none --registry=http://localhost:8080
./bin/mcp-publisher publish --registry=http://localhost:8080
Architecture
Commands
init- Generate server.json templates with auto-detectionlogin- Handle authentication (github, dns, http, none)publish- Validate and upload servers to registrystatus- Update server lifecycle status (active, deprecated, deleted)logout- Clear stored credentials
Authentication Providers
github- Interactive OAuth flowgithub-oidc- CI/CD with GitHub Actionsdns- Domain verification via DNS TXT recordshttp- Domain verification via HTTPS endpointsnone- No auth (testing only)
Signing Providers
Optional: enables dns and http methods to sign out-of-process without direct access to the private key.
google-kms- Google KMS signingazure-key-vault- Azure Key Vault signing
Key Files
main.go- CLI setup and command routingcommands/- Command implementations with auto-detection logicauth/- Authentication provider implementationsbuild.sh- Cross-platform build script