Adding the awesome copilot MCP server to our plugin and showing that in the rendered page

This commit is contained in:
Aaron Powell
2026-07-14 14:54:47 +10:00
parent b2ce1b2a65
commit 6574b3c89a
4 changed files with 45 additions and 4 deletions
+27 -2
View File
@@ -500,7 +500,7 @@ function resolvePluginItem(item, resourceIndex) {
return {
...item,
title: match?.title || candidateId || item.path,
title: match?.title || item.title || candidateId || item.path,
detailUrl: match?.url || null,
};
}
@@ -614,12 +614,37 @@ function generatePluginsData(gitDates, resourceIndex = {}) {
];
});
// Build items list from spec fields (agents, commands, skills)
// Parse mcpServers: supports a path to a .mcp.json file or an inline object
const mcpItems = [];
if (data.mcpServers) {
let mcpServersObj = null;
if (typeof data.mcpServers === "string") {
const mcpJsonPath = path.join(pluginDir, data.mcpServers.replace(/^\.\//, ""));
if (fs.existsSync(mcpJsonPath)) {
try {
const mcpJson = JSON.parse(fs.readFileSync(mcpJsonPath, "utf-8"));
mcpServersObj = mcpJson.mcpServers || mcpJson;
} catch {
// ignore parse errors
}
}
} else if (typeof data.mcpServers === "object") {
mcpServersObj = data.mcpServers;
}
if (mcpServersObj) {
for (const serverName of Object.keys(mcpServersObj)) {
mcpItems.push({ kind: "mcp", path: serverName, title: serverName });
}
}
}
// Build items list from spec fields (agents, commands, skills, mcpServers)
const items = [
...agentItems,
...(data.commands || []).map((p) => ({ kind: "prompt", path: p })),
...(data.skills || []).map((p) => ({ kind: "skill", path: p })),
...extensionItems,
...mcpItems,
].map((item) => resolvePluginItem(item, resourceIndex));
const tags = data.keywords || data.tags || [];
+2 -1
View File
@@ -21,5 +21,6 @@
"./skills/suggest-awesome-github-copilot-agents/",
"./skills/suggest-awesome-github-copilot-instructions/",
"./skills/suggest-awesome-github-copilot-skills/"
]
],
"mcpServers": "./.mcp.json"
}
+14
View File
@@ -0,0 +1,14 @@
{
"mcpServers": {
"awesome-copilot": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/microsoft/mcp-dotnet-samples/awesome-copilot:latest"
]
}
}
}
@@ -21,9 +21,10 @@ const KIND_LABELS: Record<string, string> = {
hook: "Hooks",
prompt: "Commands",
extension: "Extensions",
mcp: "MCP Servers",
};
const KIND_ORDER = ["agent", "skill", "instruction", "hook", "prompt", "extension"];
const KIND_ORDER = ["agent", "skill", "instruction", "hook", "prompt", "extension", "mcp"];
function githubHref(itemPath: string): string {
const normalized = itemPath.replace(/^\.\/+/, "").replace(/\/+$/, "");