Commit graph mcpb/src/node
Author SHA1 Message Date
Samuel Attard
5f6b15bc81
remove da bad tings 2025-11-04 10:33:16 -08:00
Samuel Attard
98126b777e
feat: use 0.2 as the default schema (#145) 2025-11-01 12:31:25 -07:00
Bryan Thompson
55e3c3cfd8
fix: resolve linting errors
- Remove duplicate node:path import in test/icon-validation.test.ts
- Replace 4 instances of 'any' type with 'unknown' in error handlers
- Auto-format code with prettier (27 formatting fixes)

Addresses review feedback from PR #136
All 6 errors and 27 warnings resolved
2025-10-30 07:53:06 -05:00
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
Joan Xie
4c100e26da
refactor: rename CURRENT_MANIFEST_VERSION to LATEST_MANIFEST_VERSION
- Rename CURRENT_MANIFEST_VERSION to LATEST_MANIFEST_VERSION
- Rename CURRENT_MANIFEST_SCHEMA to LATEST_MANIFEST_SCHEMA
- Rename CURRENT_MANIFEST_SCHEMA_LOOSE to LATEST_MANIFEST_SCHEMA_LOOSE
- Update all references throughout codebase and tests
2025-09-24 14:26:55 -07:00
Joan Xie
fefd9e1d21
fix: add schemas re-export file and update tests to use correct manifest version
- Create src/schemas.ts to re-export from schemas/index.ts for test imports
- Update test manifests to use manifest_version "0.2" instead of "1.0" or "1.0.0"
- Fix import sorting and formatting issues in schema files
- Export McpbManifestSchema from schemas/index.ts
2025-09-24 14:12:10 -07:00
Joan Xie
3a0d4a8635
feat: create schema version map with CURRENT_MANIFEST_SCHEMA selector 2025-09-24 13:57:19 -07:00
Joan Xie
a43769d94b
feat: restructure schemas into versioned folders
- Move schemas.ts and schemas-loose.ts into separate versioned folders
- Create schemas/0.1.ts and schemas/0.2.ts for strict validation
- Create schemas_loose/0.1.ts and schemas_loose/0.2.ts for loose validation
- Add index files to export all historical schema versions
- Update all imports to use schemas/0.2.ts
- Enforce exact version values using z.literal() for both v0.1 and v0.2
- Remove dxt_version support from v0.2 schemas
- Remove all passthrough() from v0.2 strict schemas
- Validate privacy_policies as URLs in v0.2

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 13:42:03 -07:00
Joan Xie
232e6b3f91
improve schema validation logs 2025-09-22 15:17:16 -07:00
Joan Xie
e1938b9933
rename dxt -> mcpb 2025-08-21 14:56:54 -07:00
Felix Rieseberg
bf01918080
fix: allow repeat runs of "dxt clean" (#83) 2025-07-31 13:07:28 -07:00
Samuel Attard
505c81a258
feat: add clean command to clean manifest and trip dev deps for node (#67)
* feat: add clean command to clean manifest and trip dev deps for node

* fix: lazy import no loop

* Update src/cli/cli.ts

Co-authored-by: Felix Rieseberg <f@anthropic.com>

---------

Co-authored-by: Felix Rieseberg <f@anthropic.com>
2025-07-11 15:30:08 -07:00
Felix Rieseberg
3c1bb1c25e
chore: 0.2.1 (#53)
* chore: Lint

* chore: 0.2.1
2025-07-08 16:22:47 -07:00
Samuel Attard
9ce2d6fd0e
fix: move to standard ignore implementation (#50) 2025-07-06 16:35:24 -07:00
Suyog Sonwalkar
2c1d058085
Adding unpack as cli command and exposing via index.ts for typescript usage. (#5) 2025-06-28 16:41:53 -07:00
Andrew A. Johnson
b22675cef9
fix: maintain unix file permissions from file read to zip options (#14) 2025-06-28 16:41:10 -07:00
Felix Rieseberg
3a2984409e
feat: Ignore .env files, too (#23) 2025-06-28 16:11:39 -07:00
Felix Rieseberg
e192e488c3
feat: Negation patterns (#24) 2025-06-28 16:11:32 -07:00
Felix Rieseberg
0172c07623
🚀 Hello World 2025-06-26 08:38:59 -07:00