mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
mcp supports cwd config and defaults to workspace cwd (#2171)
* mcp supports cwd config and defaults to workspace cwd * clean up * Update src/services/mcp/McpHub.ts Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
parent
e7a1db83c0
commit
b38b40656c
1 changed files with 3 additions and 1 deletions
|
|
@ -63,6 +63,7 @@ const createServerTypeSchema = () => {
|
|||
type: z.enum(["stdio"]).optional(),
|
||||
command: z.string().min(1, "Command cannot be empty"),
|
||||
args: z.array(z.string()).optional(),
|
||||
cwd: z.string().default(() => vscode.workspace.workspaceFolders?.at(0)?.uri.fsPath ?? process.cwd()),
|
||||
env: z.record(z.string()).optional(),
|
||||
// Ensure no SSE fields are present
|
||||
url: z.undefined().optional(),
|
||||
|
|
@ -314,7 +315,7 @@ export class McpHub {
|
|||
mcpSettingsFilePath,
|
||||
`{
|
||||
"mcpServers": {
|
||||
|
||||
|
||||
}
|
||||
}`,
|
||||
)
|
||||
|
|
@ -427,6 +428,7 @@ export class McpHub {
|
|||
transport = new StdioClientTransport({
|
||||
command: config.command,
|
||||
args: config.args,
|
||||
cwd: config.cwd,
|
||||
env: {
|
||||
...config.env,
|
||||
...(process.env.PATH ? { PATH: process.env.PATH } : {}),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue