- Change MCP_SERVER in .env.example to use port 7123 - Add USE_STDIO_TRANSPORT flag in .env.example for stdio transport mode - Update bun.lock to include new dependencies: cors, express, ajv, and their type definitions - Add new scripts for building and running the MCP server with stdio transport - Introduce PUBLISHING.md for npm publishing guidelines - Enhance README with detailed setup instructions and tool descriptions
2.0 KiB
2.0 KiB
Publishing to npm
This document outlines the steps to publish the Home Assistant MCP server to npm.
Prerequisites
- You need an npm account. Create one at npmjs.com if you don't have one.
- You need to be logged in to npm on your local machine:
npm login - You need to have all the necessary dependencies installed:
npm install
Before Publishing
-
Make sure all tests pass:
npm test -
Build all the necessary files:
npm run build # Build for Bun npm run build:node # Build for Node.js npm run build:stdio # Build the stdio server -
Update the version number in
package.jsonfollowing semantic versioning:- MAJOR version for incompatible API changes
- MINOR version for new functionality in a backward-compatible manner
- PATCH version for backward-compatible bug fixes
-
Update the CHANGELOG.md file with the changes in the new version.
Publishing
-
Publish to npm:
npm publishIf you want to publish a beta version:
npm publish --tag beta -
Verify the package is published:
npm view homeassistant-mcp
After Publishing
-
Create a git tag for the version:
git tag -a v1.0.0 -m "Version 1.0.0" git push origin v1.0.0 -
Create a GitHub release with the same version number and include the changelog.
Testing the Published Package
To test the published package:
# Install globally
npm install -g homeassistant-mcp
# Run the MCP server
homeassistant-mcp
# Or use npx without installing
npx homeassistant-mcp
Unpublishing
If you need to unpublish a version (only possible within 72 hours of publishing):
npm unpublish homeassistant-mcp@1.0.0
Publishing a New Version
- Update the version in package.json
- Update CHANGELOG.md
- Build all files
- Run tests
- Publish to npm
- Create a git tag
- Create a GitHub release