Skip to content

Add KGraph MCP server orchestration#65

Merged
kentwynn merged 1 commit into
mainfrom
kgraph-mcp-orchestration
Jun 29, 2026
Merged

Add KGraph MCP server orchestration#65
kentwynn merged 1 commit into
mainfrom
kgraph-mcp-orchestration

Conversation

@kentwynn

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 29, 2026 03:48
@kentwynn kentwynn self-assigned this Jun 29, 2026
@kentwynn kentwynn merged commit ba2494b into main Jun 29, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a local MCP (Model Context Protocol) server for KGraph, exposes the KGraph command surface as typed kgraph_* tools over stdio, and adds VS Code/Copilot setup automation via --mcp during init/integrate.

Changes:

  • Add a new kgraph mcp CLI subcommand backed by an in-process MCP server with typed tool definitions.
  • Add VS Code MCP config installation (--mcp) for Copilot integration flows, plus integration tests.
  • Update docs and integration workflow instructions to route KGraph usage through MCP tools when available.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/integration/mcp.test.ts New integration tests validating MCP tool listing and basic tool execution.
tests/integration/integrate.test.ts Adds integrate add copilot --mcp test coverage and VS Code MCP config assertions.
tests/integration/init-integrations.test.ts Adds init --integrations copilot --mcp test coverage and VS Code MCP config assertions.
tests/fixtures/helpers.ts Extends CLI test harness with env overrides for VS Code MCP config path and MCP command.
src/mcp/server.ts New MCP server implementation exposing typed tools + command-compat wrapper.
src/integrations/workflow-steps.ts Updates generated workflow guidance to prefer MCP tools when present.
src/integrations/vscode-mcp.ts New VS Code MCP config writer/installer for registering KGraph as a stdio server.
src/cli/index.ts Registers the new mcp command in the CLI program.
src/cli/help.ts Documents kgraph mcp and --mcp integration flows in help output.
src/cli/commands/mcp.ts Adds the kgraph mcp subcommand implementation.
src/cli/commands/integrate.ts Adds --mcp flag to install VS Code MCP server during integrate add.
src/cli/commands/init.ts Adds --mcp flag to install VS Code MCP server during init.
README.md Documents MCP usage and --mcp setup flows.
docs/wiki/Roadmap.md Updates roadmap to reflect MCP expansion beyond VS Code/Copilot.
docs/wiki/MCP-Setup.md New MCP setup guide including VS Code/Copilot instructions and tool list.
docs/wiki/Home.md Adds MCP Setup page to wiki navigation.
docs/wiki/Command-Guide.md Documents kgraph mcp and VS Code setup commands.
docs/wiki/AI-Tool-Integrations.md Adds MCP section pointing to setup guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/mcp/server.ts
Comment on lines +169 to +175
const commandBacked = (
name: string,
description: string,
mutability: ToolDefinition['mutability'],
buildArgs: (args: Record<string, unknown>) => string[],
inputSchema: JsonValue = schema({}),
): ToolDefinition => ({
Comment thread src/mcp/server.ts
Comment on lines +190 to +193
commandBacked('kgraph_scan', 'Refresh deterministic file, symbol, import, and relationship maps.', 'repo-write', (args) => [
'scan',
...(booleanParam(args, 'verbose') ? ['--verbose'] : []),
]),
Comment thread src/mcp/server.ts
Comment on lines +194 to +197
commandBacked('kgraph_update', 'Process Markdown cognition notes from .kgraph/inbox.', 'repo-write', (args) => [
'update',
...(booleanParam(args, 'dryRun') ? ['--dry-run'] : []),
]),
Comment on lines +266 to +271
function vscodeMcpConfigPath(repo: string): string {
return path.join(
os.tmpdir(),
'kgraph-vscode-mcp-test-' + path.basename(repo),
'mcp.json',
);
Comment on lines +80 to +86
function vscodeMcpConfigPath(repo: string): string {
return path.join(
os.tmpdir(),
'kgraph-vscode-mcp-test-' + path.basename(repo),
'mcp.json',
);
}
Comment on lines +43 to +47
const changed =
JSON.stringify(previous ?? null) !== JSON.stringify(nextServer);

await mkdir(path.dirname(configPath), { recursive: true });
await writeFile(configPath, `${JSON.stringify(next, null, 2)}\n`, 'utf8');
@kentwynn kentwynn deleted the kgraph-mcp-orchestration branch June 29, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants