mcpb/examples
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Bryan Thompson ccf9470979
feat: add comprehensive icon validation to mcpb validate command
Implements icon validation to catch common issues that prevent icons from
displaying in Claude Desktop. Uses a non-blocking warning approach for
remote URLs to maintain flexibility for MCPB's evolving multi-platform
ecosystem.

## Changes

### Core Implementation (src/node/validate.ts)
- Add `isPNG()` helper to validate PNG file signatures via magic bytes
- Add `validateIcon()` function with comprehensive checks:
  - **Warn** about remote URLs (non-blocking, best practice guidance)
  - **Reject** ${__dirname} variable usage in icon field (doesn't work)
  - **Reject** absolute paths (not portable)
  - Verify icon file exists at specified path
  - Verify icon file is valid PNG format
  - Recommend 512×512 size for Claude Desktop
- Integrate icon validation into `validateManifest()` after schema validation

### Test Coverage
- Update `test/icon-validation.test.ts` - Remote URL test now expects warning
- Update `test/cli.test.ts` - Integration test updated for warnings
- All 109 tests passing

### Documentation Updates
- Update examples/hello-world-node/manifest.json to v0.3

## Validation Behavior

**Remote URLs (WARNING - non-blocking):**
```
Icon path uses a remote URL. Best practice for local MCP servers:
Use local files like "icon": "icon.png" for maximum compatibility.
Claude Desktop currently only supports local icon files in bundles.
```
**Result:** Validation passes, developer is informed

**Other Issues (ERROR - blocking):**
- ${__dirname} usage: Rejects (doesn't work)
- Absolute paths: Rejects (not portable)
- Missing files: Rejects (broken reference)
- Non-PNG files: Rejects (wrong format)

## Rationale

**Non-Blocking Approach:**
- Doesn't prevent valid bundles from being created
- Educates developers about best practices
- Maintains flexibility as MCPB evolves beyond Claude Desktop
- Future-proof if remote URL support is added

**Still Protective:**
- Blocks truly broken configurations (missing files, wrong formats)
- Provides actionable error messages for fixable issues

Based on real-world findings from investigating icon display issues in
Claude Desktop with production MCPB bundles.
2025-10-28 09:14:12 -05:00
..
chrome-applescript feat: add privacy_policies field to manifest schema 2025-09-12 11:53:11 -07:00
file-manager-python feat: add privacy_policies field to manifest schema 2025-09-12 11:53:11 -07:00
file-system-node feat: add privacy_policies field to manifest schema 2025-09-12 11:53:11 -07:00
hello-world-node feat: add comprehensive icon validation to mcpb validate command 2025-10-28 09:14:12 -05:00
README.md rename dxt -> mcpb 2025-08-21 14:56:54 -07:00

MCPB Examples

This directory contains example MCP Bundles that demonstrate the MCPB format and manifest structure. These are reference implementations designed to illustrate how to build MCPB extensions.

⚠️ Not Production Ready

Important: These examples are NOT intended for production use. They serve as:

  • Demonstrations of the MCPB manifest format
  • Templates for building your own extensions
  • Simple MCP server implementations for testing

But, the MCP servers themselves are not robust secure production ready servers and should not be relied upon for production use.

Examples Included

Example Type Demonstrates
hello-world-node Node.js Basic MCP server with simple time tool
chrome-applescript Node.js Browser automation via AppleScript
file-manager-python Python File system operations and path handling

Usage

Each example includes its own manifest.json and can be packed with:

dxt pack examples/hello-world-node

Use these as starting points for your own extensions, but ensure you implement proper security measures before deploying to users.