Merge branch 'main' into feat/versioned-schemas
This commit is contained in:
commit
e2d6836622
11 changed files with 7474 additions and 4344 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
|
@ -34,7 +34,7 @@ jobs:
|
|||
node-version: "${{ matrix.node-version }}"
|
||||
cache: "yarn"
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
run: yarn install --immutable
|
||||
- name: Build
|
||||
run: yarn build
|
||||
- name: Test
|
||||
|
|
|
|||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -106,3 +106,5 @@ self-signed-key.pem
|
|||
*.mcpb
|
||||
invalid-json.json
|
||||
**/server/lib/**
|
||||
|
||||
.yarn/install-state.gz
|
||||
942
.yarn/releases/yarn-4.10.3.cjs
vendored
Executable file
942
.yarn/releases/yarn-4.10.3.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
3
.yarnrc.yml
Normal file
3
.yarnrc.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
nodeLinker: node-modules
|
||||
|
||||
yarnPath: .yarn/releases/yarn-4.10.3.cjs
|
||||
50
MANIFEST.md
50
MANIFEST.md
|
|
@ -155,6 +155,54 @@ A full `manifest.json` with most of the optional fields looks like this:
|
|||
"min": 1,
|
||||
"max": 100
|
||||
}
|
||||
},
|
||||
"_meta": {
|
||||
"com.microsoft.windows": {
|
||||
"package_family_name": "MyMcpMSIXPackage_51g09708xawrw",
|
||||
"static_responses": {
|
||||
"initialize": {
|
||||
"capabilities": {},
|
||||
"instructions": "When the user wants to search files, use the search_files tool but only after asking them whether the files are local.",
|
||||
"protocolVersion": "2025-06-18",
|
||||
"serverInfo": {
|
||||
"name": "MyMCPExtension",
|
||||
"title": "My MCP Extension - Pro Edition",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
},
|
||||
"tools/list": {
|
||||
"tools": [
|
||||
{
|
||||
"name": "search_files",
|
||||
"title": "File search",
|
||||
"description": "Search for files in a directory",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"fileSpec": {
|
||||
"type": "string",
|
||||
"description": "The file name to search for. Wildcards are supported"
|
||||
}
|
||||
},
|
||||
"required": ["fileSpec"]
|
||||
},
|
||||
"outputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"searchResults": {
|
||||
"type": "array",
|
||||
"description": "The list of file paths that were found",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
@ -189,6 +237,7 @@ A full `manifest.json` with most of the optional fields looks like this:
|
|||
- **privacy_policies**: Array of URLs to privacy policies for external services that handle user data. Required when the extension connects to external services (first- or third-party) that process user data. Each URL should link to the respective service's privacy policy document
|
||||
- **compatibility**: Compatibility requirements (client app version, platforms, and runtime versions)
|
||||
- **user_config**: User-configurable options for the extension (see User Configuration section)
|
||||
- **_meta**: Platform-specific client integration metadata (e.g., Windows `package_family_name`, macOS bundle identifiers) enabling tighter OS/app store integration. The keys in the `_meta` object are reverse-DNS namespaced, and the values are a dictionary of platform-specific metadata.
|
||||
|
||||
## Compatibility
|
||||
|
||||
|
|
@ -606,3 +655,4 @@ The `_generated` fields:
|
|||
- **prompts_generated**: Server generates additional prompts beyond those listed (default: false)
|
||||
|
||||
This helps implementing apps understand that querying the server at runtime will reveal more capabilities than what's declared in the manifest.
|
||||
|
||||
|
|
|
|||
|
|
@ -141,13 +141,13 @@ git clone https://github.com/anthropics/mcpb.git
|
|||
cd mcpb
|
||||
|
||||
# Install dependencies
|
||||
npm install
|
||||
yarn
|
||||
|
||||
# Build the project
|
||||
npm run build
|
||||
yarn build
|
||||
|
||||
# Run tests
|
||||
npm test
|
||||
yarn test
|
||||
```
|
||||
|
||||
## Release Process
|
||||
|
|
|
|||
|
|
@ -28,9 +28,7 @@
|
|||
"require": "./dist/cli.js"
|
||||
}
|
||||
},
|
||||
"bin": {
|
||||
"mcpb": "dist/cli/cli.js"
|
||||
},
|
||||
"bin": "dist/cli/cli.js",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
|
|
@ -79,5 +77,5 @@
|
|||
"@babel/helpers": "7.27.1",
|
||||
"@babel/parser": "7.27.3"
|
||||
},
|
||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
||||
"packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f"
|
||||
}
|
||||
|
|
@ -107,6 +107,7 @@ export const McpbManifestSchema = z
|
|||
user_config: z
|
||||
.record(z.string(), McpbUserConfigurationOptionSchema)
|
||||
.optional(),
|
||||
_meta: z.record(z.string(), z.record(z.string(), z.any())).optional(),
|
||||
})
|
||||
.refine((data) => !!(data.dxt_version || data.manifest_version), {
|
||||
message:
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ export const McpbManifestSchema = z
|
|||
user_config: z
|
||||
.record(z.string(), McpbUserConfigurationOptionSchema)
|
||||
.optional(),
|
||||
_meta: z.record(z.string(), z.record(z.string(), z.any())).optional(),
|
||||
})
|
||||
.refine((data) => !!(data.dxt_version || data.manifest_version), {
|
||||
message:
|
||||
|
|
|
|||
|
|
@ -136,4 +136,75 @@ describe("McpbManifestSchema", () => {
|
|||
expect(result.success).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("_meta", () => {
|
||||
const base = {
|
||||
manifest_version: "0.2",
|
||||
name: "client-ext-test",
|
||||
version: "1.0.0",
|
||||
description: "Test manifest",
|
||||
author: { name: "Author" },
|
||||
server: {
|
||||
type: "node" as const,
|
||||
entry_point: "server/index.js",
|
||||
mcp_config: { command: "node", args: ["server/index.js"] },
|
||||
},
|
||||
};
|
||||
|
||||
it("accepts valid _meta object with nested dictionaries", () => {
|
||||
const manifest = {
|
||||
...base,
|
||||
_meta: {
|
||||
"com.microsoft.windows": { package_family_name: "Pkg_123", channel: "stable" },
|
||||
"com.apple.darwin": { bundle_id: "com.example.app", notarized: true },
|
||||
},
|
||||
};
|
||||
const result = McpbManifestSchema.safeParse(manifest);
|
||||
expect(result.success).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects primitive value in _meta entry", () => {
|
||||
const manifest = {
|
||||
...base,
|
||||
_meta: {
|
||||
"com.microsoft.windows": "raw-string" as unknown as Record<string, unknown>,
|
||||
},
|
||||
};
|
||||
const result = McpbManifestSchema.safeParse(manifest);
|
||||
expect(result.success).toBe(false);
|
||||
if (!result.success) {
|
||||
const messages = result.error.issues.map((i) => i.message).join("\n");
|
||||
expect(messages).toMatch(/Expected object/);
|
||||
}
|
||||
});
|
||||
|
||||
it("rejects array value in _meta entry", () => {
|
||||
const manifest = {
|
||||
...base,
|
||||
_meta: {
|
||||
"com.apple.darwin": [] as unknown as Record<string, unknown>,
|
||||
},
|
||||
};
|
||||
const result = McpbManifestSchema.safeParse(manifest);
|
||||
expect(result.success).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects null value in _meta entry", () => {
|
||||
const manifest = {
|
||||
...base,
|
||||
_meta: {
|
||||
custom: null as unknown as Record<string, unknown>,
|
||||
},
|
||||
};
|
||||
const result = McpbManifestSchema.safeParse(manifest);
|
||||
expect(result.success).toBe(false);
|
||||
});
|
||||
|
||||
it("allows empty object for _meta", () => {
|
||||
const manifest = { ...base, _meta: {} };
|
||||
const result = McpbManifestSchema.safeParse(manifest);
|
||||
expect(result.success).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue