使用说明
MCPB Build Action
A GitHub Action for building Model Context Protocol (MCP) packages using the MCPB CLI.
Features
- Validates
manifest.jsonbefore building - Builds
.mcpbpackages from your MCP server - Supports multiple package managers (pnpm, npm, yarn)
- Optionally uploads built package as workflow artifact
- Outputs package metadata (name, version, size, SHA256)
- Marketplace-ready with branding
Usage
Basic Usage
- name: Build MCPB Package
uses: entro314-labs/mcpb-build-action@v1
With Custom Options
- name: Build MCPB Package
id: mcpb
uses: entro314-labs/mcpb-build-action@v1
with:
manifest: 'manifest.json'
output: 'my-mcp-server'
package-manager: 'pnpm'
node-version: '22'
- name: Use Build Outputs
run: |
echo "Package: ${{ steps.mcpb.outputs.package-name }}@${{ steps.mcpb.outputs.package-version }}"
echo "Size: ${{ steps.mcpb.outputs.package-size }}"
echo "SHA256: ${{ steps.mcpb.outputs.shasum }}"
Validate Only (No Build)
- name: Validate Manifest
uses: entro314-labs/mcpb-build-action@v1
with:
validate-only: 'true'
Without Artifact Upload
- name: Build MCPB Package
uses: entro314-labs/mcpb-build-action@v1
with:
upload-artifact: 'false'
Inputs
| Input | Description | Required | Default |
|---|---|---|---|
manifest |
Path to manifest.json file | No | manifest.json |
output |
Output filename for the .mcpb package (without extension) | No | Uses manifest name |
working-directory |
Working directory for the build | No | . |
validate-only |
Only validate the manifest without building | No | false |
node-version |
Node.js version to use | No | 22 |
package-manager |
Package manager to use (pnpm, npm, yarn) | No | pnpm |
upload-artifact |
Upload the built package as a workflow artifact | No | true |
artifact-name |
Name for the uploaded artifact | No | mcpb-package |
artifact-retention-days |
Number of days to retain the artifact | No | 30 |
Outputs
| Output | Description |
|---|---|
package-path |
Absolute path to the built .mcpb package |
package-name |
Name of the built package |
package-version |
Version of the built package |
package-size |
Human-readable size of the built package |
shasum |
SHA256 checksum of the package |
Example Workflows
Release with MCPB Package
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build MCPB Package
id: mcpb
uses: entro314-labs/mcpb-build-action@v1
with:
output: 'my-package'
upload-artifact: 'false'
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
${{ steps.mcpb.outputs.package-name }}.mcpb
CI Validation
name: CI
on:
pull_request:
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate MCPB Manifest
uses: entro314-labs/mcpb-build-action@v1
with:
validate-only: 'true'
Build with Different Package Managers
# Using npm
- uses: entro314-labs/mcpb-build-action@v1
with:
package-manager: 'npm'
# Using yarn
- uses: entro314-labs/mcpb-build-action@v1
with:
package-manager: 'yarn'
# Using pnpm (default)
- uses: entro314-labs/mcpb-build-action@v1
with:
package-manager: 'pnpm'
Requirements
- Node.js 24.19.0+ (configurable via
node-versioninput) - A valid
manifest.jsonfollowing the MCPB specification - One of: pnpm, npm, or yarn
Versioning
This action uses semantic versioning. We recommend pinning to a major version:
uses: entro314-labs/mcpb-build-action@v1 # Recommended
uses: entro314-labs/mcpb-build-action@v1.0.0 # Pin to specific version
uses: entro314-labs/mcpb-build-action@main # Latest (not recommended for production)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE for details.
Related
- MCPB CLI - The CLI tool this action wraps
- Model Context Protocol - The protocol specification
- AI Changelog Generator - An MCP server built with this action