Skip to content

Commit ee01aac

Browse files
committed
feat: update tasks and assets for improved Claude integration, enhance webview state management, and update version to 0.0.87
1 parent d06a9cf commit ee01aac

File tree

8 files changed

+60
-18
lines changed

8 files changed

+60
-18
lines changed

.vscode/tasks.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
{
77
"label": "watch",
88
"dependsOn": [
9-
"npm: watch:tsc",
109
"npm: watch:esbuild",
1110
"npm: watch:webview"
1211
],
@@ -32,11 +31,11 @@
3231
},
3332
{
3433
"type": "npm",
35-
"script": "watch:tsc",
34+
"script": "watch:esbuild",
3635
"group": "build",
37-
"problemMatcher": "$tsc-watch",
36+
"problemMatcher": "$esbuild-watch",
3837
"isBackground": true,
39-
"label": "npm: watch:tsc",
38+
"label": "npm: watch:esbuild",
4039
"presentation": {
4140
"group": "watch",
4241
"reveal": "never"

WHATS_NEW.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
*Sponsored by [Cloud MCP](https://cloudmcp.run?utm_source=copilot-mcp&utm_medium=vscode&utm_campaign=whats-new-0.0.84) - Try out Cloud MCP's [Router Mode](https://cloudmcp.run/blog/cloud-mcp-router?utm_referrer=copilot-mcp) that significantly improves tool calling success by AI agents!*
44

5-
## Version 0.0.86 – Clipboard-Friendly Claude Installs ✂️
5+
## Version 0.0.86 + 0.0.87 – Clipboard-Friendly Claude Installs ✂️
66

77
- Claude CLI installs now copy the generated command to your clipboard and surface a dedicated notification so you can rerun it quickly if the install fails.
88

esbuild.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async function main() {
3636
platform: 'node',
3737
outfile: 'dist/extension.js',
3838
external: ['vscode'],
39-
logLevel: 'silent',
39+
logLevel: 'verbose',
4040
plugins: [
4141
/* add to the end of plugins array */
4242
esbuildProblemMatcherPlugin,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"displayName": "Copilot MCP",
1414
"description": "Search, manage, and install open-source MCP servers",
15-
"version": "0.0.86",
15+
"version": "0.0.87",
1616
"icon": "logo.png",
1717
"engines": {
1818
"vscode": "^1.101.0"

src/panels/ExtensionPanel.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,12 +551,20 @@ export class CopilotMcpViewProvider implements vscode.WebviewViewProvider {
551551
"assets",
552552
"index.js",
553553
]);
554+
const assetBaseUri = getUri(webview, this._extensionUri, [
555+
"web",
556+
"dist",
557+
"assets",
558+
]);
554559
webview.options = {
555560
enableScripts: true,
556561
localResourceRoots: [this._extensionUri],
557562
};
558563

559564
const nonce = getNonce();
565+
const initialState = {
566+
assetBaseUri: assetBaseUri.toString(),
567+
};
560568
return /*html*/ `
561569
<!DOCTYPE html>
562570
<html lang="en">
@@ -569,6 +577,7 @@ export class CopilotMcpViewProvider implements vscode.WebviewViewProvider {
569577
</head>
570578
<body>
571579
<div id="root"></div>
580+
<script nonce="${nonce}">window.__MCP_WEBVIEW__ = ${JSON.stringify(initialState)};</script>
572581
<script type="module" nonce="${nonce}" src="${scriptUri}"></script>
573582
</body>
574583
</html>
File renamed without changes.

web/src/components/RegistryServerCard.tsx

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,32 @@ import {
3131
createClaudeAddJsonCommand,
3232
} from "@/utils/registryInstall";
3333

34+
import defaultVscodeIcon from "@/assets/vscode.svg?url";
35+
import defaultClaudeIcon from "@/assets/claude.svg?url";
36+
37+
declare global {
38+
interface Window {
39+
__MCP_WEBVIEW__?: {
40+
assetBaseUri?: string;
41+
};
42+
}
43+
}
44+
45+
const resolveIcon = (filename: string, fallback: string) => {
46+
if (typeof window === "undefined") return fallback;
47+
const base = window.__MCP_WEBVIEW__?.assetBaseUri;
48+
if (!base) return fallback;
49+
try {
50+
const normalizedBase = base.endsWith("/") ? base : `${base}/`;
51+
return new URL(filename, normalizedBase).toString();
52+
} catch {
53+
return fallback;
54+
}
55+
};
56+
57+
const vscodeIcon = resolveIcon("vscode.svg", defaultVscodeIcon);
58+
const claudeIcon = resolveIcon("claude.svg", defaultClaudeIcon);
59+
3460
const CLAUDE_DOCS_URL =
3561
"https://github.com/vikashloomba/copilot-mcp/blob/main/mcp.md#add-mcp-servers-from-json-configuration";
3662

@@ -123,6 +149,8 @@ const RegistryServerCard: React.FC<RegistryServerCardProps> = ({ serverResponse
123149
const websiteUrl = server?.websiteUrl;
124150

125151
const programLabel = programTarget === 'vscode' ? 'VS Code' : 'Claude Code';
152+
const programIcon = programTarget === 'vscode' ? vscodeIcon : claudeIcon;
153+
const programIconAlt = programTarget === 'vscode' ? 'VS Code logo' : 'Claude logo';
126154
const buttonLabel = isInstalling
127155
? `Installing in ${programLabel}…`
128156
: installMode === 'package'
@@ -228,16 +256,18 @@ const RegistryServerCard: React.FC<RegistryServerCardProps> = ({ serverResponse
228256
<ToggleGroupItem
229257
value="vscode"
230258
aria-label="Install in VS Code"
231-
className="text-xs px-2 py-1 rounded border border-transparent data-[state=on]:bg-[var(--vscode-list-activeSelectionBackground)] data-[state=on]:text-[var(--vscode-list-activeSelectionForeground)] data-[state=on]:border-[var(--vscode-focusBorder)] hover:bg-[var(--vscode-list-hoverBackground)] focus:outline-none focus-visible:ring-0 ring-0"
259+
className="text-xs px-2 py-1 rounded border border-transparent data-[state=on]:bg-[var(--vscode-list-activeSelectionBackground)] data-[state=on]:text-[var(--vscode-list-activeSelectionForeground)] data-[state=on]:border-[var(--vscode-focusBorder)] hover:bg-[var(--vscode-list-hoverBackground)] focus:outline-none focus-visible:ring-0 ring-0 flex items-center gap-2"
232260
>
233-
VS Code
261+
<img src={vscodeIcon} alt="VS Code logo" className="w-4 h-4" />
262+
<span>VS Code</span>
234263
</ToggleGroupItem>
235264
<ToggleGroupItem
236265
value="claude"
237266
aria-label="Install in Claude Code"
238-
className="text-xs px-2 py-1 rounded border border-transparent data-[state=on]:bg-[var(--vscode-list-activeSelectionBackground)] data-[state=on]:text-[var(--vscode-list-activeSelectionForeground)] data-[state=on]:border-[var(--vscode-focusBorder)] hover:bg-[var(--vscode-list-hoverBackground)] focus:outline-none focus-visible:ring-0 ring-0"
267+
className="text-xs px-2 py-1 rounded border border-transparent data-[state=on]:bg-[var(--vscode-list-activeSelectionBackground)] data-[state=on]:text-[var(--vscode-list-activeSelectionForeground)] data-[state=on]:border-[var(--vscode-focusBorder)] hover:bg-[var(--vscode-list-hoverBackground)] focus:outline-none focus-visible:ring-0 ring-0 flex items-center gap-2"
239268
>
240-
Claude Code
269+
<img src={claudeIcon} alt="Claude logo" className="w-4 h-4" />
270+
<span>Claude Code</span>
241271
</ToggleGroupItem>
242272
</ToggleGroup>
243273
</div>
@@ -358,7 +388,10 @@ const RegistryServerCard: React.FC<RegistryServerCardProps> = ({ serverResponse
358388
disabled={isInstallDisabled}
359389
className="flex-1 bg-[var(--vscode-button-background)] hover:border-[var(--vscode-button-border)] hover:bg-[var(--vscode-button-hoverBackground)] disabled:opacity-50 disabled:cursor-not-allowed"
360390
>
361-
{buttonLabel}
391+
<span className="flex items-center justify-center gap-2">
392+
<img src={programIcon} alt={programIconAlt} className="w-4 h-4" />
393+
<span>{buttonLabel}</span>
394+
</span>
362395
</Button>
363396
</CardFooter>
364397
</Card>

web/vite.config.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ export default defineConfig({
1111
},
1212
},
1313
build: {
14+
assetsInlineLimit: 0,
1415
rollupOptions: {
15-
output: {
16-
entryFileNames: `assets/[name].js`,
17-
chunkFileNames: `assets/[name].js`,
18-
assetFileNames: `assets/[name].[ext]`,
19-
},
16+
output: {
17+
entryFileNames: `assets/[name].js`,
18+
chunkFileNames: `assets/[name].js`,
19+
assetFileNames: `assets/[name].[ext]`,
2020
},
21-
}
21+
},
22+
},
2223
})

0 commit comments

Comments
 (0)