* Add npm publish workflow - Add .github/workflows/npm-publish.yml triggered on GitHub releases - Runs build and test jobs before publishing - Uses NPM_TOKEN secret with OIDC provenance - Smart npm tagging: latest, beta, or release-X.Y - Add prepack hook to package.json for automatic builds - Move bun from dependencies to devDependencies - Add npm test step to CI workflow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Add CONTRIBUTING.md with maintainer publishing guide - Getting started and development process for contributors - Pull request guidelines - Maintainer section with: - Repository setup (NPM_TOKEN, release environment) - Step-by-step release publishing instructions - npm tag documentation (latest, beta, release-X.Y) - Maintenance release workflow - Pre-release testing via pkg-pr-new 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * ... * Potential fix for code scanning alert no. 9: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
4.3 KiB
Contributing to MCP Apps SDK
We welcome contributions to the MCP Apps SDK! This document outlines the process for contributing to the project.
Getting Started
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR-USERNAME/ext-apps.git - Install dependencies:
npm install - Build the project:
npm run build - Run tests:
npm test
Development Process
- Create a new branch for your changes
- Make your changes
- Run
npm run prettierto ensure code style compliance - Run
npm testto verify all tests pass - Submit a pull request
Pull Request Guidelines
- Follow the existing code style
- Include tests for new functionality
- Update documentation as needed
- Keep changes focused and atomic
- Provide a clear description of changes
Running Examples
Start the development environment with hot reloading:
npm run examples:dev
Or build and run examples:
npm run examples:start
Code of Conduct
This project follows our Code of Conduct. Please review it before contributing.
Reporting Issues
- Use the GitHub issue tracker
- Search existing issues before creating a new one
- Provide clear reproduction steps
Security Issues
Please review our Security Policy for reporting security vulnerabilities.
For Maintainers
Repository Setup
Before publishing releases, ensure the following are configured:
-
NPM_TOKEN secret: Add an npm automation token to the repository secrets
- Go to Settings <20> Secrets and variables <20> Actions
- Create a new secret named
NPM_TOKEN - Value: an npm automation token with publish permissions for
@modelcontextprotocol/ext-apps
-
releaseenvironment (optional): Create a protected environment for additional safeguards- Go to Settings <20> Environments <20> New environment
- Name it
release - Add required reviewers or other protection rules as needed
Publishing a Release
Releases are published automatically via GitHub Actions when a GitHub Release is created.
Steps to publish:
-
Update the version in
package.json:# For a regular release npm version patch # or minor, or major # For a beta release npm version prerelease --preid=beta -
Commit the version bump (if not done by
npm version):git add package.json git commit -m "Bump version to X.Y.Z" git push origin main -
Create a GitHub Release:
- Go to Releases
- Click "Draft a new release"
- Create a new tag matching the version (e.g.,
v0.1.0) - Set the target branch (usually
main) - Write release notes describing the changes
- Click "Publish release"
-
Monitor the workflow:
- The npm-publish workflow will trigger automatically
- It runs build and test jobs before publishing
- On success, the package is published to npm with provenance
npm Tags
The workflow automatically determines the npm dist-tag:
| Version Pattern | npm Tag | Install Command |
|---|---|---|
X.Y.Z (from main) |
latest |
npm install @modelcontextprotocol/ext-apps |
X.Y.Z-beta.N |
beta |
npm install @modelcontextprotocol/ext-apps@beta |
X.Y.Z (from release branch) |
release-X.Y |
npm install @modelcontextprotocol/ext-apps@release-X.Y |
Maintenance Releases
To release a patch for an older version:
- Create a release branch from the tag:
git checkout -b release-0.1 v0.1.0 - Cherry-pick or apply fixes
- Bump the patch version
- Create a GitHub Release targeting the release branch
- The package will be published with tag
release-0.1
Testing Pre-releases
Every commit and PR automatically publishes a preview package via pkg-pr-new. Check the PR comments or workflow logs for the install command.
License
By contributing, you agree that your contributions will be licensed under the MIT License.