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:
I Made Ocy Darma Putra
2026-10-06 14:15:59 +08:00
committed by GitHub
parent 6ad62cec6a
commit 7f1ae42f71
14 changed files with 115 additions and 13 deletions
@@ -126,3 +126,59 @@ describe("client registration status", () => {
]);
});
});
describe("commandcode registration status", () => {
const writeCommandcodeRegistration = async (
home: string,
registration: Record<string, unknown>,
): Promise<void> => {
await mkdir(join(home, ".commandcode"));
await writeFile(
join(home, ".commandcode/mcp.json"),
JSON.stringify({ mcpServers: { rea: registration } }),
);
};
const ownedArgs = (): readonly string[] => [
"-y",
PRODUCT_IDENTITY.registrationPackageSpecifier,
"mcp",
];
it.each([undefined, "sse"])(
"reports transport %j as invalid",
async (transport) => {
const home = await createTestTempDirectory("rea-commandcode-transport-");
await writeCommandcodeRegistration(home, {
...(transport === undefined ? {} : { transport }),
command: "npx",
args: [...ownedArgs()],
});
expect(await readClientRegistrationStatuses(home)).toEqual([
expect.objectContaining({
client: "commandcode",
state: "invalid",
command: [],
}),
]);
},
);
it("reports a disabled registration as stale", async () => {
const home = await createTestTempDirectory("rea-commandcode-disabled-");
await writeCommandcodeRegistration(home, {
transport: "stdio",
enabled: false,
command: "npx",
args: [...ownedArgs()],
});
expect(await readClientRegistrationStatuses(home)).toEqual([
expect.objectContaining({
client: "commandcode",
state: "stale",
}),
]);
});
});