feat(setup): support Command Code MCP registration (#645)
Configure Command Code's user-scope MCP config (~/.commandcode/mcp.json)
with an explicit stdio registration ({ transport, enabled, command, args })
under mcpServers, matching the shape Command Code writes itself.
Adds the commandcode setup client and dialect, detection/alignment support,
README/docs entries, and regenerated product catalog.
This commit is contained in:
@@ -150,6 +150,14 @@ export const clientRegistrationEntry = (
|
||||
tools: ["*"],
|
||||
...(Object.keys(environment).length === 0 ? {} : { env: environment }),
|
||||
};
|
||||
case "commandcode":
|
||||
return {
|
||||
transport: "stdio",
|
||||
enabled: true,
|
||||
command: executable,
|
||||
args,
|
||||
...(Object.keys(environment).length === 0 ? {} : { env: environment }),
|
||||
};
|
||||
default:
|
||||
return {
|
||||
command: executable,
|
||||
|
||||
@@ -47,6 +47,7 @@ const registrationSchema = z
|
||||
args: z.array(z.string()).default([]),
|
||||
startup_timeout_sec: z.number().positive().optional(),
|
||||
type: z.string().optional(),
|
||||
transport: z.string().optional(),
|
||||
tools: z.array(z.string()).optional(),
|
||||
disabled: z.boolean().optional(),
|
||||
enabled: z.boolean().optional(),
|
||||
@@ -152,6 +153,8 @@ const registrationAligned = (
|
||||
JSON.stringify(registration.tools) !== JSON.stringify(["*"]))
|
||||
)
|
||||
return false;
|
||||
if (client.format === "commandcode" && registration.transport !== "stdio")
|
||||
return false;
|
||||
if (
|
||||
command.length === 4 &&
|
||||
command[0] === "npx" &&
|
||||
@@ -193,6 +196,8 @@ const parseRegistration = (
|
||||
registration.type !== "stdio"
|
||||
)
|
||||
throw new TypeError("Expected an stdio registration");
|
||||
if (client.format === "commandcode" && registration.transport !== "stdio")
|
||||
throw new TypeError("Expected an stdio registration");
|
||||
return registration;
|
||||
};
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ export interface SetupClient {
|
||||
| "vscode"
|
||||
| "copilot_cli"
|
||||
| "opencode"
|
||||
| "commandcode"
|
||||
| "unsupported";
|
||||
}
|
||||
|
||||
@@ -79,6 +80,9 @@ const codexDirectory = ({ home, env }: ClientPathContext): string =>
|
||||
const copilotDirectory = ({ home, env }: ClientPathContext): string =>
|
||||
env.COPILOT_HOME ?? join(home, ".copilot");
|
||||
|
||||
const commandCodeDirectory = ({ home }: ClientPathContext): string =>
|
||||
join(home, ".commandcode");
|
||||
|
||||
const opencodeDirectory = ({ home, env }: ClientPathContext): string =>
|
||||
join(env.XDG_CONFIG_HOME ?? join(home, ".config"), "opencode");
|
||||
|
||||
@@ -192,6 +196,14 @@ export const SUPPORTED_CLIENT_DEFINITIONS = [
|
||||
markerPath: copilotDirectory,
|
||||
format: "copilot_cli",
|
||||
},
|
||||
{
|
||||
name: "commandcode",
|
||||
displayName: "Command Code",
|
||||
configPath: (context: ClientPathContext) =>
|
||||
join(commandCodeDirectory(context), "mcp.json"),
|
||||
markerPath: commandCodeDirectory,
|
||||
format: "commandcode",
|
||||
},
|
||||
{
|
||||
name: "vscode",
|
||||
displayName: "VS Code",
|
||||
|
||||
Reference in New Issue
Block a user