mirror of
https://github.com/github/awesome-copilot.git
synced 2026-07-18 03:40:02 +00:00
Adding the awesome copilot MCP server to our plugin and showing that in the rendered page
This commit is contained in:
@@ -500,7 +500,7 @@ function resolvePluginItem(item, resourceIndex) {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
title: match?.title || candidateId || item.path,
|
title: match?.title || item.title || candidateId || item.path,
|
||||||
detailUrl: match?.url || null,
|
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 = [
|
const items = [
|
||||||
...agentItems,
|
...agentItems,
|
||||||
...(data.commands || []).map((p) => ({ kind: "prompt", path: p })),
|
...(data.commands || []).map((p) => ({ kind: "prompt", path: p })),
|
||||||
...(data.skills || []).map((p) => ({ kind: "skill", path: p })),
|
...(data.skills || []).map((p) => ({ kind: "skill", path: p })),
|
||||||
...extensionItems,
|
...extensionItems,
|
||||||
|
...mcpItems,
|
||||||
].map((item) => resolvePluginItem(item, resourceIndex));
|
].map((item) => resolvePluginItem(item, resourceIndex));
|
||||||
|
|
||||||
const tags = data.keywords || data.tags || [];
|
const tags = data.keywords || data.tags || [];
|
||||||
|
|||||||
+2
-1
@@ -21,5 +21,6 @@
|
|||||||
"./skills/suggest-awesome-github-copilot-agents/",
|
"./skills/suggest-awesome-github-copilot-agents/",
|
||||||
"./skills/suggest-awesome-github-copilot-instructions/",
|
"./skills/suggest-awesome-github-copilot-instructions/",
|
||||||
"./skills/suggest-awesome-github-copilot-skills/"
|
"./skills/suggest-awesome-github-copilot-skills/"
|
||||||
]
|
],
|
||||||
|
"mcpServers": "./.mcp.json"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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",
|
hook: "Hooks",
|
||||||
prompt: "Commands",
|
prompt: "Commands",
|
||||||
extension: "Extensions",
|
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 {
|
function githubHref(itemPath: string): string {
|
||||||
const normalized = itemPath.replace(/^\.\/+/, "").replace(/\/+$/, "");
|
const normalized = itemPath.replace(/^\.\/+/, "").replace(/\/+$/, "");
|
||||||
|
|||||||
Reference in New Issue
Block a user