Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/gittensory-mcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ gittensory-mcp cache clear
gittensory-mcp init-client --print codex
gittensory-mcp init-client --print claude
gittensory-mcp init-client --print cursor
gittensory-mcp init-client --print vscode
gittensory-mcp init-client --print codex --agent-profile miner-planner
gittensory-mcp completion bash
gittensory-mcp completion zsh
Expand Down Expand Up @@ -154,6 +155,10 @@ The same capabilities are exposed to MCP clients as:
- `gittensory_agent_explain_next_action`
- `gittensory_agent_prepare_pr_packet`

### Client config

`init-client --print <host>` prints the stdio MCP config for a host: `codex` (TOML), `claude`, `cursor`, and `mcp` (the shared `mcpServers` JSON shape), and `vscode` (VS Code's native `servers` map with `"type": "stdio"`, for `.vscode/mcp.json`). It prints config only; it never edits client files.

### Agent profiles

`init-client` can print optional agent-profile instructions next to the MCP client config:
Expand Down
23 changes: 20 additions & 3 deletions packages/gittensory-mcp/bin/gittensory-mcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -1779,7 +1779,7 @@ function printHelp() {
gittensory-mcp changelog [--json]
gittensory-mcp doctor [--profile name] [--cwd path] [--exit-code] [--json]
gittensory-mcp cache status|clear [--json]
gittensory-mcp init-client --print codex|claude|cursor|mcp [--agent-profile miner-planner|maintainer-triage|repo-owner-intake] [--json]
gittensory-mcp init-client --print codex|claude|cursor|mcp|vscode [--agent-profile miner-planner|maintainer-triage|repo-owner-intake] [--json]
gittensory-mcp decision-pack --login <github-login> [--json]
gittensory-mcp repo-decision --login <github-login> --repo owner/repo [--json]
gittensory-mcp analyze-branch --login <github-login> [--repo owner/repo] [--base origin/main] [--branch-eligibility eligible|ineligible|unknown] [--pending-merged-prs 3] [--expected-open-prs 0] [--projected-credibility 0.8] [--scenario-note "..."] [--validation "passed|npm test|summary"] [--json]
Expand Down Expand Up @@ -2319,7 +2319,7 @@ function shellArg(value) {

function initClient(options) {
const client = String(options.print ?? options.client ?? "").toLowerCase();
if (!client) throw new Error("Pass --print codex, --print claude, --print cursor, or --print mcp.");
if (!client) throw new Error("Pass --print codex, --print claude, --print cursor, --print mcp, or --print vscode.");
const command = options.command ?? "gittensory-mcp";
const snippet = clientSnippet(client, command);
const agentProfile = resolveAgentProfile(options.agentProfile);
Expand Down Expand Up @@ -2725,7 +2725,24 @@ function clientSnippet(client, command) {
2,
);
}
throw new Error(`Unsupported client: ${client}. Use codex, claude, cursor, or mcp.`);
// VS Code's native MCP support uses a `servers` map with an explicit transport type, not the
// `mcpServers` shape the other JSON hosts use, so it needs its own snippet (see .vscode/mcp.json).
if (client === "vscode") {
return JSON.stringify(
{
servers: {
gittensory: {
type: "stdio",
command,
args: ["--stdio"],
},
},
},
null,
2,
);
}
throw new Error(`Unsupported client: ${client}. Use codex, claude, cursor, mcp, or vscode.`);
}

async function getDecisionPackWithCache(login) {
Expand Down
7 changes: 7 additions & 0 deletions test/unit/mcp-cli-basics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ describe("gittensory-mcp CLI — basics", () => {

const generic = JSON.parse(run(["init-client", "--print", "mcp", "--json"])) as { snippet: string };
expect(generic.snippet).toBe(claude.snippet);

const vscode = JSON.parse(run(["init-client", "--print", "vscode", "--json"])) as { snippet: string };
// VS Code uses a `servers` map with an explicit transport type, not the `mcpServers` shape.
expect(vscode.snippet).toContain('"servers"');
expect(vscode.snippet).toContain('"type": "stdio"');
expect(vscode.snippet).toContain('"gittensory"');
expect(vscode.snippet).not.toContain('"mcpServers"');
});

it("prints human-approved agent profile instructions for supported MCP clients", () => {
Expand Down