fix(skill-mcp): pass workspace directory as cwd to stdio MCP processes#3415
Merged
code-yeongyu merged 1 commit intoMay 4, 2026
Merged
Conversation
In OpenCode web multi-workspace mode, skill_mcp spawned stdio child processes inherited process.cwd() instead of the session's workspace directory. Pass toolContext.directory through SkillMcpClientInfo to StdioClientTransport's cwd parameter.
Contributor
|
All contributors have signed the CLA. Thank you! ✅ |
There was a problem hiding this comment.
No issues found across 4 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Low-risk fix for workspace directory inheritance in MCP servers; includes test coverage and follows existing patterns for built-in MCPs.
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
This was referenced Apr 17, 2026
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 19, 2026
4 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 19, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 19, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 19, 2026
2 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 19, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 20, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 20, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 20, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 20, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 20, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 20, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 21, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 21, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 21, 2026
4 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 21, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 21, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 21, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 21, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 21, 2026
4 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 21, 2026
4 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 21, 2026
4 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 21, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 21, 2026
4 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 22, 2026
3 tasks
github-actions Bot
added a commit
to Vacbo/oh-my-opencode
that referenced
this pull request
Apr 22, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
toolContext.directorythroughSkillMcpClientInfotoStdioClientTransport'scwdparameter so that stdio MCP child processes inherit the correct workspace directory instead ofprocess.cwd()Problem
In OpenCode web multi-workspace mode, skill_mcp spawned stdio child processes used
process.cwd()(the directory whereopencode webwas started) rather than the session's workspace directory. This meant MCP servers that rely on the working directory (e.g., file-based databases, linters) would operate on the wrong project.OpenCode's built-in MCP correctly passes
Instance.directoryascwdto itsStdioClientTransport. This PR brings skill-embedded MCPs to parity.Changes
SkillMcpClientInfotype: added optionaldirectoryfieldtools.ts: populatedirectoryfromtoolContext.directorystdio-client.ts: conditionally passcwdtoStdioClientTransportwhendirectoryis presentTest plan
toolContext.directoryis forwarded to manager viaSkillMcpClientInfoSummary by cubic
Pass the session’s workspace directory to stdio MCP child processes as
cwdso servers run against the correct project. Fixes multi-workspace mode where processes inheritedprocess.cwd().directorytoSkillMcpClientInfo.toolContext.directoryand pass ascwdtoStdioClientTransportwhen present.Written for commit df172ac. Summary will update on new commits.