Feature request / Bug
Many MCP servers use relative paths in their args (e.g. npx tsx ./libs/design-system-mcp/src/index.ts, npx nx-mcp@latest .). Without a cwd field, mcpx always spawns them from its own working directory, which is wrong.
The only workaround today is an ugly bash wrapper:
{
"design_system": {
"transport": "stdio",
"command": "bash",
"args": ["-c", "cd /abs/path/to/project && exec npx tsx ./libs/design-system-mcp/src/index.ts"]
}
}
Fix
StdioClientTransport already accepts a cwd option. The change is two lines:
src/config.ts — add field to BackendConfig:
export interface BackendConfig {
transport: "stdio" | "http" | "openapi";
command?: string;
args?: string[];
cwd?: string; // <-- add this
env?: Record<string, string>;
// ... rest unchanged
}
src/backends.ts — pass it to the transport:
const transport = new StdioClientTransport({
command: config.command,
args: config.args ?? [],
env: { ...process.env, ...config.env } as Record<string, string>,
cwd: config.cwd, // <-- add this
});
This lets users write clean configs:
{
"design_system": {
"transport": "stdio",
"command": "npx",
"args": ["tsx", "./libs/design-system-mcp/src/index.ts"],
"cwd": "/path/to/project"
}
}
Feature request / Bug
Many MCP servers use relative paths in their args (e.g.
npx tsx ./libs/design-system-mcp/src/index.ts,npx nx-mcp@latest .). Without acwdfield, mcpx always spawns them from its own working directory, which is wrong.The only workaround today is an ugly bash wrapper:
{ "design_system": { "transport": "stdio", "command": "bash", "args": ["-c", "cd /abs/path/to/project && exec npx tsx ./libs/design-system-mcp/src/index.ts"] } }Fix
StdioClientTransportalready accepts acwdoption. The change is two lines:src/config.ts— add field toBackendConfig:src/backends.ts— pass it to the transport:This lets users write clean configs:
{ "design_system": { "transport": "stdio", "command": "npx", "args": ["tsx", "./libs/design-system-mcp/src/index.ts"], "cwd": "/path/to/project" } }