Skip to content

Commit f0d4d9c

Browse files
committed
Add 'mcp' tag support in TagsProcessor and corresponding test case
1 parent 5be7b39 commit f0d4d9c

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/package.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@ export class TagsProcessor extends BaseProcessor {
673673
const remoteMenu = doesContribute('menus', 'statusBar/remoteIndicator') ? ['remote-menu'] : [];
674674
const chatParticipants = doesContribute('chatParticipants') ? ['chat-participant'] : [];
675675
const languageModelTools = doesContribute('languageModelTools') ? ['tools', 'language-model-tools'] : [];
676+
const mcp = doesContribute('modelContextServerCollections') ? ['mcp'] : [];
676677

677678
const localizationContributions = ((contributes && contributes['localizations']) ?? []).reduce<string[]>(
678679
(r, l) => [...r, `lp-${l.languageId}`, ...toLanguagePackTags(l.translations, l.languageId)],
@@ -715,6 +716,7 @@ export class TagsProcessor extends BaseProcessor {
715716
...remoteMenu,
716717
...chatParticipants,
717718
...languageModelTools,
719+
...mcp,
718720
...localizationContributions,
719721
...languageContributions,
720722
...languageActivations,

src/test/package.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,6 +1365,22 @@ describe('toVsixManifest', () => {
13651365
.then(result => assert.deepEqual(result.PackageManifest.Metadata[0].Tags[0], 'tools,language-model-tools,__web_extension'));
13661366
});
13671367

1368+
it('should automatically add mcp tag', () => {
1369+
const manifest = {
1370+
name: 'test',
1371+
publisher: 'mocha',
1372+
version: '0.0.1',
1373+
engines: Object.create(null),
1374+
contributes: {
1375+
modelContextServerCollections: [{ label: 'test', id: 'test' }],
1376+
},
1377+
};
1378+
1379+
return _toVsixManifest(manifest, [])
1380+
.then(parseXmlManifest)
1381+
.then(result => assert.deepEqual(result.PackageManifest.Metadata[0].Tags[0], 'mcp,__web_extension'));
1382+
});
1383+
13681384
it('should remove duplicate tags', () => {
13691385
const manifest = {
13701386
name: 'test',

0 commit comments

Comments
 (0)