Commit graph

127 commits

Author SHA1 Message Date
Joan Xie
98fc900d5a
WIP 2025-11-01 15:07:43 -07:00
joan-anthropic
8c543a32f6
Merge pull request #141 from asklar/user/asklar/single-size-per-icon v1.1.5
fix: update icon size property from 'sizes' to 'size'
2025-10-30 16:54:44 -07:00
Alexander Sklar
bc2d083d18
chore: update version from 1.1.4 to 1.1.5 in package.json 2025-10-30 16:44:19 -07:00
Alexander Sklar
86e641c0b5
chore: update version from 1.1.3 to 1.1.4 in package.json 2025-10-30 16:43:59 -07:00
Alexander Sklar
257af30812
fix: update icon size property from 'sizes' to 'size' in manifest and schema files 2025-10-30 16:43:54 -07:00
Samuel Attard
406e7bb5bd
feat: add CI job to validate JSON schema generation (#139)
Add a new validate-schemas job to the CI workflow that ensures the
committed JSON schemas in the schemas/ directory are up-to-date with
the schema generation script. This prevents drift between the source
code and generated schemas.

The job:
- Runs the schema generation script (yarn build:schema)
- Checks if any schemas were modified
- Fails if changes are detected, prompting developers to regenerate
  and commit the schemas

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-30 16:31:10 -07:00
joan-anthropic
82b12a406e
Merge pull request #140 from anthropics/feat/use-latest-schema-only v1.1.4
feat: export McpbManifestAny type, use latest MCPB schema for BUILD manifest validation
2025-10-30 14:26:23 -07:00
Joan Xie
7ecb050280
cleanup 2025-10-30 14:19:34 -07:00
joan-anthropic
ba74af5217
Merge pull request #136 from bthompson-sys/feat/icon-validation
feat: add comprehensive icon validation to mcpb validate command
2025-10-30 10:40:02 -07:00
Joan Xie
8bea47f0b7
chore: bump version to 1.1.4 2025-10-30 10:00:13 -07:00
Joan Xie
a2bb7589b6
fix: sort imports in types.ts 2025-10-30 09:57:16 -07:00
Joan Xie
184173e342
fix: use correct manifest types for reading vs building
Apply proper type distinction:
- Reading/validating existing manifests: Use McpbManifest (any version)
- Building/creating new manifests: Use McpbManifestLatest (latest only)

Changes:
- src/shared/config.ts: Revert to McpbManifest for config operations
- src/cli/init.ts: Use McpbManifestLatest for new manifest creation
- test/config.test.ts: Use McpbManifest for testing config operations

This ensures backward compatibility when reading existing manifests
while enforcing latest schema for new builds.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 09:47:08 -07:00
Joan Xie
ddad8064ef
feat: use latest MCPB schema for BUILD manifest validation
Update manifest type usage in config and packaging to strictly enforce
the latest schema version (0.3) instead of accepting any version.

Changes:
- src/shared/config.ts: Use McpbManifestLatest instead of McpbManifest
- src/types.ts: Add McpbManifestLatest type export
- test/config.test.ts: Update tests to use McpbManifestLatest

This ensures BUILD manifests are validated against the latest schema
only during packaging, preventing use of older schema versions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 09:40:32 -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
joan-anthropic
11d1397ee8
Merge pull request #138 from anthropics/feat/export-versioned-schemas v1.1.3
feat: export versioned schemas in package.json
2025-10-29 17:20:17 -07:00
Joan Xie
c29d1000f3
feat: add any schema 2025-10-29 17:06:55 -07:00
Joan Xie
1660697588
refactor: remove legacy mcpb-manifest.schema.json
Removed the non-versioned mcpb-manifest.schema.json from schemas/
directory. All schemas are now explicitly versioned.

Available schemas:
- mcpb-manifest-v0.1.schema.json
- mcpb-manifest-v0.2.schema.json
- mcpb-manifest-v0.3.schema.json
- mcpb-manifest-latest.schema.json

Consumers should use -latest or specific version to be explicit
about which schema version they're validating against.
2025-10-29 17:01:04 -07:00
Joan Xie
789b37087c
revert: restore McpbManifest type to use latest schema
Reverted the discriminated union type change. McpbManifest now uses
the latest schema as before. Consumers can use versioned schemas
directly if they need to validate specific versions.
2025-10-29 16:59:06 -07:00
Joan Xie
db5d6be33c
Reapply "chore: bump version to 1.1.3"
This reverts commit ae3d9614e2.
2025-10-29 16:58:41 -07:00
Joan Xie
ae3d9614e2
Revert "chore: bump version to 1.1.3"
This reverts commit 48232bf64e.
2025-10-29 16:58:15 -07:00
Joan Xie
48232bf64e
chore: bump version to 1.1.3 2025-10-29 16:57:49 -07:00
Joan Xie
e7282946b6
fix: lint errors - remove unused import and format files
- Remove unused McpbManifestSchema import from types.ts
- Run prettier on modified files
2025-10-29 16:51:27 -07:00
Joan Xie
eeb9dca819
refactor: remove non-versioned mcpb-manifest.schema.json export
Remove the generic mcpb-manifest.schema.json export from package.json
in favor of explicit versioned exports.

Changes:
- Removed ./mcpb-manifest.schema.json from package exports
- Stop generating mcpb-manifest.schema.json in dist/
- Keep mcpb-manifest.schema.json in schemas/ for backward compatibility

Consumers should now use:
- mcpb-manifest-latest.schema.json (for latest version)
- mcpb-manifest-v0.1.schema.json (for specific version)
- etc.

This makes versioning explicit and prevents ambiguity about which
schema version is being used.
2025-10-29 16:49:41 -07:00
Joan Xie
b5fa7df6eb
feat: generate JSON schemas for all manifest versions
Updated build script to generate JSON schemas for all historical manifest
versions (v0.1, v0.2, v0.3) in addition to the latest version.

Changes:
- Generate mcpb-manifest-v0.1.schema.json
- Generate mcpb-manifest-v0.2.schema.json
- Generate mcpb-manifest-v0.3.schema.json
- Generate mcpb-manifest-latest.schema.json
- Keep mcpb-manifest.schema.json as alias for latest
- All schemas generated to both dist/ and schemas/ directories
- Added exports in package.json for all versioned schemas

Benefits:
- Tools can validate against specific manifest versions
- Backwards compatibility for all historical versions
- Latest schema always available at predictable path
- JSON schema files match the Zod schema versions

Usage:
import manifestSchema from '@anthropic-ai/mcpb/mcpb-manifest-v0.2.schema.json'
import latestSchema from '@anthropic-ai/mcpb/mcpb-manifest-latest.schema.json'
2025-10-29 16:39:57 -07:00
Joan Xie
faafd4523a
feat: make McpbManifest a discriminated union of all versions
Changed McpbManifest type from a single version to a discriminated union
of all historical manifest versions (0.1, 0.2, 0.3).

This allows the type system to properly handle manifests from any version
while maintaining type safety through the manifest_version/dxt_version
discriminator field.

Benefits:
- Type-safe handling of multiple manifest versions
- TypeScript can narrow types based on version field
- No need for type assertions when working with versioned manifests
- Maintains backward compatibility with all historical versions
2025-10-29 16:33:23 -07:00
Joan Xie
67938cdab9
feat: export versioned schemas in package.json
Add exports for versioned schemas to allow consumers to import:
- ./schemas: All versioned schemas (v0_1, v0_2, v0_3, latest)
- ./schemas/*: Specific schema versions (./schemas/0.1, ./schemas/any, etc.)
- ./schemas-loose: Loose validation schemas

This enables cleaner imports like:
import { McpbManifestSchema } from '@anthropic-ai/mcpb/schemas/any'
import * as v0_2 from '@anthropic-ai/mcpb/schemas/0.2'
import * as schemas from '@anthropic-ai/mcpb/schemas'
2025-10-29 16:30:32 -07:00
joan-anthropic
7961b32cfc
Merge pull request #137 from anthropics/chore/1.1.2 v1.1.2
chore: update to 1.1.2
2025-10-29 15:49:49 -07:00
Joan Xie
f37496928b
chore: update to 1.1.2 2025-10-29 15:47:25 -07: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-anthropic
49c68b0452
Merge pull request #132 from asklar/user/asklar/localization
[0.3] Add localization/theming
2025-10-27 14:23:32 -07:00
Alexander Sklar
55154fa6fb
fix linting 2025-10-27 14:06:11 -07:00
Alexander Sklar
d929b8c33c
add default for resources property 2025-10-27 11:33:35 -07:00
joan-anthropic
ef6908e612
Merge pull request #117 from anthropics/fix/json-schema-generation
fix: restore JSON schema generation
2025-10-27 10:38:16 -07:00
Alexander Sklar
18d096526e
fix typo 2025-10-27 09:57:53 -07:00
Alexander Sklar
bdcfeadac5
. 2025-10-27 09:43:54 -07:00
Alexander Sklar
1640adefe8
Add localization/theming feature to 0.3 version 2025-10-24 15:48:46 -07:00
Joan Xie
2a0ba89918
fix: improve JSON schema generation and publishing
- Refactor JSON schema generation to use zod-to-json-schema
- Publish manifest schema to schemas/ directory
- Update package.json exports for schema files
- Add WIP version 0.3 support
- Clean up schema generation scripts

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 17:16:06 -07:00
joan-anthropic
d595dd66dc
Merge pull request #114 from anthropics/feat/versioned-schemas
feat: versioned schemas
2025-10-20 17:12:19 -07:00
Joan Xie
f7efd3a444
add WIP 0.3 2025-10-20 17:07:44 -07:00
Joan Xie
143aa9a63c
test: skip _meta tests for v0.3 2025-10-20 17:07:44 -07:00
joan-anthropic
2b193ac391
Merge pull request #127 from anthropics/docs/license-and-contributing
chore: Add CONTRIBUTING.md
2025-10-20 16:49:03 -07:00
Joan Xie
0496e93851
add req for commit signing 2025-10-20 08:41:45 -07:00
Joan Xie
ec05e897c7
Add CONTRIBUTING.md and rename LICENSE.md to LICENSE
- Add comprehensive contributing guidelines with setup instructions, workflow, and code standards
- Rename LICENSE.md to LICENSE to follow standard naming convention and fix README link

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-18 11:16:27 -07:00
Joan Xie
e2d6836622
Merge branch 'main' into feat/versioned-schemas 2025-10-17 16:05:16 -07:00
joan-anthropic
d12057eefd
Merge pull request #124 from asklar/user/asklar/static_responses_and_extensions
Add _meta to manifest schema and tests
2025-10-10 16:46:02 -07:00
Alexander Sklar
443d849420
Refactor manifest schema to replace static_responses and client_extensions with _meta for improved organization 2025-10-10 16:43:33 -07:00
Alexander Sklar
caa61bcc49
Update example to be more real 2025-10-10 16:43:18 -07:00
Alexander Sklar
90c18ca9fb
Add static_responses and client_extensions to manifest schema and tests 2025-10-10 16:43:03 -07:00
Samuel Attard
e9aa4d0029
build: use yarn v4 (#125) 2025-10-10 14:43:35 -07:00
Joan Xie
6c05338904
refactor: remove schemas.ts re-export, use explicit imports in tests
- Remove src/schemas.ts file
- Update tests to import directly from src/schemas/index.js
2025-09-24 14:28:06 -07:00