Skip to content

feat(mcp): support stdio server cwd#535

Draft
luoye520ww wants to merge 1 commit into
KunAgent:developfrom
luoye520ww:codex/issue-534-mcp-cwd
Draft

feat(mcp): support stdio server cwd#535
luoye520ww wants to merge 1 commit into
KunAgent:developfrom
luoye520ww:codex/issue-534-mcp-cwd

Conversation

@luoye520ww

Copy link
Copy Markdown
Collaborator

Summary

Fixes #534.

Adds working directory support for stdio MCP servers so project-aware MCP servers such as CodeGraph can start from the intended repository path.

Changes

  • Adds optional cwd to the Kun MCP server config schema.
  • Passes resolved cwd into the MCP SDK StdioClientTransport for stdio servers.
  • Uses explicit cwd when configured, otherwise falls back to the first trusted workspace root for workspace-scoped stdio servers.
  • Preserves cwd through the GUI MCP editor and GUI-managed runtime config sync.
  • Documents the field in the English and Chinese Kun README files.

Tests

  • npm.cmd test -- src/renderer/src/components/mcp/mcp-config-form.test.ts src/main/kun-process.test.ts
  • npm.cmd --prefix kun test -- tests/mcp-config.test.ts tests/mcp-tool-provider.test.ts
  • npm.cmd run typecheck
  • npm.cmd run build
  • git diff --check

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.

1 participant