To generate a VSIX file that can be manually uploaded or shared:
-
Make sure you have the VSCE tool installed:
npm install -g @vscode/vsce
-
Navigate to your extension's root directory in the terminal
-
Generate the VSIX file:
vsce package --no-dependencies
This will create a
.vsixfile in your project root (e.g.,vscode-mcp-client-0.1.0.vsix) -
For subsequent builds, you can increment the version in
package.jsonto create versioned packages
To install the VSIX manually in VS Code:
- Open VS Code
- Go to the Extensions view (Ctrl+Shift+X)
- Click the "..." (More Actions) button at the top of the Extensions view
- Select "Install from VSIX..."
- Browse to and select your
.vsixfile - Restart VS Code if prompted
You can distribute your VSIX file through:
- Direct download links on your website or documentation
- GitHub Releases
- Internal package repositories
- Email for private distribution
If you encounter extraneous dependency errors when packaging your extension, follow these steps:
The quickest solution is to use the --no-dependencies flag when packaging:
vsce package --no-dependenciesThis will skip dependency validation during packaging.
Perform a clean reinstallation of dependencies:
npm run clean-reinstallThis script removes node_modules and package-lock.json, then reinstalls all dependencies cleanly.
If you continue to have issues, manually update your package.json:
- Add all extraneous dependencies to either
dependenciesordevDependencies - Make sure the versions match those installed in node_modules
- Run
npm installto update package-lock.json
- Create a publisher account on the VS Code Marketplace
- Create a Personal Access Token (PAT) with publishing rights
-
Login to your publisher account:
vsce login christian237
Enter your PAT when prompted.
-
Package your extension:
npm run package
-
Publish your extension:
npm run publish
Or specify the version:
vsce publish [major|minor|patch]
- Update version in package.json
- Update CHANGELOG.md with new version details
- Commit changes
- Tag the release:
git tag v0.1.0 - Push changes and tags:
git push && git push --tags - Publish the extension:
npm run publish
To publish to Open VSX Registry (for VSCodium and other VS Code forks):
npx ovsx publish -p <open-vsx-pat>- Always test your extension thoroughly before publishing
- Use semantic versioning (major.minor.patch)
- Keep your README.md updated with the latest information
- Add a proper icon to make your extension more discoverable
- Specify meaningful tags in package.json
If you see an error like:
ReferenceError: File is not defined
at .../node_modules/undici/lib/web/webidl/index.js
Cause:
- Some tooling (including vsce and OpenAI SDK) pulls in undici v6+, which expects a global File implementation that is present in Node 20 but not reliably available in Node 18.
Fix in this repo:
- package.json includes an npm "overrides" entry that forces undici to a Node 18–compatible 5.x release.
What you need to do:
- Run a clean install so the override takes effect:
rm -rf node_modules package-lock.json
npm installAlternative options:
- Use Node 20+ when running packaging tools; or
- Package with no dependency checks:
npx vsce package --no-dependencies