UNPKG

mushcode-mcp-server

Version:

A specialized Model Context Protocol server for MUSHCODE development assistance. Provides AI-powered code generation, validation, optimization, and examples for MUD development.

287 lines (212 loc) โ€ข 6.5 kB
# NPM Publishing Guide This guide explains how to publish the MushcodeMCP server as an npm package. ## ๐Ÿš€ Quick Publish ### Prerequisites 1. **npm account**: Create account at [npmjs.com](https://www.npmjs.com) 2. **npm login**: `npm login` 3. **Built project**: `npm run build` 4. **Tests passing**: `npm test` ### Publish Steps ```bash # 1. Update version (choose one) npm version patch # 1.0.0 -> 1.0.1 npm version minor # 1.0.0 -> 1.1.0 npm version major # 1.0.0 -> 2.0.0 # 2. Build and test npm run build npm run test:unit # 3. Publish to npm npm publish # 4. Verify publication npm view mushcode-mcp-server ``` ## ๐Ÿ“‹ Pre-Publish Checklist ### Required Files - โœ… `package.json` - Complete with all metadata - โœ… `README.md` - Comprehensive documentation - โœ… `LICENSE` - MIT license file - โœ… `dist/` - Compiled TypeScript code - โœ… `docs/` - Documentation files - โœ… `examples/` - Usage examples - โœ… `mushcode-mcp.config.json` - Default configuration ### Package.json Validation - โœ… **name**: Unique npm package name - โœ… **version**: Semantic versioning - โœ… **description**: Clear, detailed description - โœ… **main**: Entry point (`dist/server/index.js`) - โœ… **types**: TypeScript definitions - โœ… **bin**: CLI command mapping - โœ… **files**: Files to include in package - โœ… **keywords**: Relevant search terms - โœ… **author**: Your information - โœ… **license**: MIT - โœ… **repository**: GitHub URL - โœ… **homepage**: Project homepage - โœ… **bugs**: Issue tracker URL ### Code Quality - โœ… **TypeScript compilation**: No errors - โœ… **Unit tests**: All passing - โœ… **Linting**: No errors or warnings - โœ… **Dependencies**: Only production deps in dependencies - โœ… **Security**: No known vulnerabilities ## ๐Ÿ”ง Configuration Updates ### Update Repository URLs ```bash # Update package.json with your actual GitHub URLs sed -i 's/your-username/YOUR_GITHUB_USERNAME/g' package.json sed -i 's/your-email@domain.com/YOUR_EMAIL/g' package.json ``` ### Update README ```bash # Copy npm-specific README cp README.npm.md README.md ``` ## ๐Ÿ“ฆ Package Contents When published, your package will include: ``` mushcode-mcp-server/ โ”œโ”€โ”€ dist/ # Compiled JavaScript โ”‚ โ”œโ”€โ”€ cli/ # CLI interface โ”‚ โ”œโ”€โ”€ server/ # Server components โ”‚ โ”œโ”€โ”€ tools/ # MCP tools โ”‚ โ”œโ”€โ”€ types/ # Type definitions โ”‚ โ””โ”€โ”€ utils/ # Utilities โ”œโ”€โ”€ data/ # Knowledge base data โ”œโ”€โ”€ docs/ # Documentation โ”œโ”€โ”€ examples/ # Usage examples โ”œโ”€โ”€ mushcode-mcp.config.json # Default config โ”œโ”€โ”€ README.md # Package documentation โ”œโ”€โ”€ LICENSE # MIT license โ””โ”€โ”€ package.json # Package metadata ``` ## ๐ŸŽฏ Usage After Publishing ### Global Installation ```bash npm install -g mushcode-mcp-server mushcode-mcp-server --help ``` ### Local Installation ```bash npm install mushcode-mcp-server npx mushcode-mcp-server --help ``` ### Programmatic Usage ```javascript import { MushcodeProtocolHandler } from 'mushcode-mcp-server'; ``` ## ๐Ÿ”„ Version Management ### Semantic Versioning - **PATCH** (1.0.X): Bug fixes, small improvements - **MINOR** (1.X.0): New features, backwards compatible - **MAJOR** (X.0.0): Breaking changes ### Version Update Process ```bash # Patch version (bug fixes) npm version patch git push origin main --tags npm publish # Minor version (new features) npm version minor git push origin main --tags npm publish # Major version (breaking changes) npm version major git push origin main --tags npm publish ``` ## ๐Ÿš€ Automated Publishing ### GitHub Actions Workflow Create `.github/workflows/publish.yml`: ```yaml name: Publish to NPM on: push: tags: - 'v*' jobs: publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Setup Node.js uses: actions/setup-node@v3 with: node-version: '20' registry-url: 'https://registry.npmjs.org' - name: Install dependencies run: npm ci - name: Build run: npm run build - name: Test run: npm run test:unit - name: Publish to NPM run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} ``` ### Setup Secrets 1. Get npm token: `npm token create` 2. Add to GitHub Secrets: `NPM_TOKEN` ## ๐Ÿ“Š Package Analytics ### Monitor Your Package - **npm stats**: `npm view mushcode-mcp-server` - **Download stats**: [npmjs.com/package/mushcode-mcp-server](https://npmjs.com/package/mushcode-mcp-server) - **npm trends**: [npmtrends.com](https://npmtrends.com) ### Package Health ```bash # Check for vulnerabilities npm audit # Check for outdated dependencies npm outdated # Update dependencies npm update ``` ## ๐Ÿ” Testing Published Package ### Test Installation ```bash # Create test directory mkdir test-mushcode-mcp cd test-mushcode-mcp # Install your published package npm install mushcode-mcp-server # Test CLI npx mushcode-mcp-server --help npx mushcode-mcp-server tools # Test programmatic usage node -e "import('mushcode-mcp-server').then(console.log)" ``` ### Integration Tests ```bash # Test with Claude Desktop mushcode-mcp-server init mushcode-mcp-server config mushcode-mcp-server start # Test network mode mushcode-mcp-server network --port 3001 & curl http://localhost:3001/health ``` ## ๐Ÿ“ˆ Promotion ### Documentation - โœ… **README.md**: Comprehensive usage guide - โœ… **API docs**: Generated from TypeScript - โœ… **Examples**: Real-world usage scenarios - โœ… **Changelog**: Version history ### Community - ๐Ÿ“ **Blog post**: Announce your package - ๐Ÿฆ **Social media**: Share on Twitter, Reddit - ๐Ÿ“ง **MUD communities**: Share in relevant forums - ๐ŸŽฅ **Demo video**: Show the package in action ## ๐Ÿ› ๏ธ Maintenance ### Regular Tasks - ๐Ÿ”„ **Update dependencies**: Monthly - ๐Ÿงช **Run tests**: Before each release - ๐Ÿ“Š **Check analytics**: Monitor usage - ๐Ÿ› **Fix issues**: Respond to bug reports - โœจ **Add features**: Based on user feedback ### Support - ๐Ÿ“ง **Issue tracking**: GitHub Issues - ๐Ÿ’ฌ **Discussions**: GitHub Discussions - ๐Ÿ“š **Documentation**: Keep updated - ๐Ÿค **Community**: Engage with users --- **Your npm package is ready for the world! ๐ŸŒ**