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
Markdown
# 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! ๐**