Add Pieces for Developers MCP server to the extensions library (#2074)

Co-authored-by: Jim Bennett <jim@pieces.app>
This commit is contained in:
Jim Bennett
2025-04-26 07:49:01 -07:00
committed by GitHub
parent b4f5d606ca
commit f708e4d613
11 changed files with 495 additions and 117 deletions

View File

@@ -10,9 +10,28 @@ export function getGooseInstallLink(server: MCPServer): string {
].join('&');
return `goose://extension?${queryParams}`;
}
// Handle the case where the command is a URL
if (server.url) {
const queryParams = [
`url=${encodeURIComponent(server.url)}`,
`id=${encodeURIComponent(server.id)}`,
`name=${encodeURIComponent(server.name)}`,
`description=${encodeURIComponent(server.description)}`,
...server.environmentVariables
.filter((env) => env.required)
.map(
(env) => `env=${encodeURIComponent(`${env.name}=${env.description}`)}`
),
].join("&");
return `goose://extension?${queryParams}`;
}
const parts = server.command.split(" ");
const baseCmd = parts[0]; // jbang, npx or uvx
const args = parts.slice(1); // remaining arguments
const queryParams = [
`cmd=${encodeURIComponent(baseCmd)}`,
...args.map((arg) => `arg=${encodeURIComponent(arg)}`),