Skip to content

Latest commit

 

History

History
254 lines (162 loc) · 4.14 KB

File metadata and controls

254 lines (162 loc) · 4.14 KB

🚀 Quick Start: Publishing MCP to NPM

✅ Current Status

Your MCP package is ready to publish! ✨

✅ Package: @coolver/home-assistant-mcp
✅ Version: 1.0.0
✅ Size: 10.8 kB (unpacked: 46.5 kB)
✅ Files: 15 files (source, types, README, LICENSE)
✅ Git: Initialized with 2 commits
✅ Build: Successful

📋 Before Publishing

1. Create GitHub Repository

Go to: https://github.com/new

  • Repository name: home-assistant-mcp
  • Description: MCP server for Home Assistant integration with Cursor AI
  • Public (important for NPM!)
  • DON'T add README, .gitignore, or LICENSE (we already have them)

2. Push to GitHub

cd /Users/Coolver_1/Projects/smart-home/home-assistant-mcp

# Add remote
git remote add origin https://github.com/Coolver/home-assistant-mcp.git

# Push
git branch -M main
git push -u origin main

# Create first release tag
git tag v1.0.0
git push origin v1.0.0

📦 Publishing to NPM

Step 1: Login to NPM

If you don't have an NPM account:

  1. Go to https://www.npmjs.com/signup
  2. Create account

Then login:

npm login
# Enter your credentials

Step 2: Publish!

cd /Users/Coolver_1/Projects/smart-home/home-assistant-mcp

# Publish to NPM
npm publish --access public

That's it! 🎉


🧪 Test Installation

After publishing, test that it works:

# Install globally
npm install -g @coolver/home-assistant-mcp

# Or use with npx (no installation needed)
npx @coolver/home-assistant-mcp

👥 User Installation (After Publishing)

Users will be able to install with:

Option 1: Using npx (Recommended)

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "home-assistant": {
      "command": "npx",
      "args": ["-y", "@coolver/home-assistant-mcp"],
      "env": {
        "HA_AGENT_URL": "http://homeassistant.local:8099",
        "HA_TOKEN": "their_token_here"
      }
    }
  }
}

Option 2: Global Install

npm install -g @coolver/home-assistant-mcp

Then in ~/.cursor/mcp.json:

{
  "mcpServers": {
    "home-assistant": {
      "command": "npx",
      "args": ["-y", "@coolver/home-assistant-mcp@latest"],
      "env": {
        "HA_AGENT_URL": "http://homeassistant.local:8099",
        "HA_TOKEN": "their_token_here"
      }
    }
  }
}

📊 After Publishing

Check Your Package

Create GitHub Release

  1. Go to: https://github.com/Coolver/home-assistant-mcp/releases/new
  2. Tag: v1.0.0
  3. Title: MCP Home Assistant v1.0.0
  4. Description: Copy from CHANGELOG.md
  5. Publish release

🔄 Future Updates

When you want to update:

cd /Users/Coolver_1/Projects/smart-home/home-assistant-mcp

# Make your changes...

# Update version
npm version patch  # 1.0.0 -> 1.0.1

# Build
npm run build

# Commit
git add -A
git commit -m "v1.0.1: Description of changes"
git push

# Publish
npm publish --access public

# Tag
git tag v1.0.1
git push origin v1.0.1

🎯 Summary

What you have:

  • ✅ Complete MCP package ready for NPM
  • ✅ Professional README with examples
  • ✅ MIT License
  • ✅ TypeScript with type definitions
  • ✅ Git repository initialized
  • ✅ Build scripts configured
  • ✅ Package size optimized (10.8 kB)

What's needed:

  1. Create GitHub repository
  2. Push code to GitHub
  3. Publish to NPM (npm publish --access public)

Time needed: 5-10 minutes ⏱️


💡 Pro Tips

  • NPM 2FA: Enable for security (npm profile enable-2fa)
  • Watch downloads: Use npm-stat.com
  • GitHub Actions: Set up CI/CD for auto-publishing
  • Badges: Add download/version badges to README

Ready to publish? 🚀

# 1. Create GitHub repo (web)
# 2. Push to GitHub
git remote add origin https://github.com/Coolver/home-assistant-mcp.git
git push -u origin main
git tag v1.0.0 && git push origin v1.0.0

# 3. Publish to NPM
npm login
npm publish --access public

# Done! 🎉