Skip to content

Custom stdio MCP probe ignores workspace cwd #3

Description

@chenjiangui

What happened

Image Image

Hi, Some MCP services that rely on local directory environment variables do not receive the project directory during detection, causing the MCP service to fail to enable. My current workaround is to reopen the project window. This skips MCP detection and passes the information directly to the AGENT, and it works properly at this point. Thanks.

Steps to reproduce

Environment

  • OS: macOS
  • ACP Patchbay: 0.82.8
  • Agent: OpenCode 1.18.27
  • MCP server: DBHub 0.21.2
  • VS Code workspace: multi-root workspace
  1. Create or open a project folder in VS Code.
  2. Add a .env file to the project root:
    DSN=postgresql://user:password@localhost:5432/database
  3. Confirm that DBHub starts successfully when launched manually from the project directory:
    dbhub --transport stdio
  4. Open ACP Patchbay.
  5. Go to Settings > MCP Servers > Add a custom MCP server.
  6. Add the following server:
    Name:
    dbhub

Command:
/absolute/path/to/dbhub

Arguments:
--transport
stdio
7. Leave the Environment Variables field empty because DBHub should load the project-local .env.
8. Click Add or retry the connection.
9. Observe that the connection probe fails with:
MCP error -32000: Connection closed
10. Check DBHub's output. It reports that no database configuration was found because .env was not discovered.
11. Reload or reopen the VS Code project window.
12. Start a new OpenCode session through Patchbay.
13. Observe that DBHub now works because the MCP configuration is passed to OpenCode with the workspace directory through session/new.

Which agent

Other / multiple

Agent version

OpenCode 1.18.27

ACP Patchbay version

0.82.8

VS Code version & OS

1.137.0 && macOS

Relevant logs or wire output

Patchbay output:
dbhub: custom custom-stdio added
dbhub: probe failed — MCP error -32000: Connection closed
DBHub output when started outside the project directory:
Checking for env file: .env

ERROR: Database connection configuration is required.
DBHub starts successfully when the current directory is the project root.

Confirmations

  • I searched existing issues and this isn't a duplicate.
  • I removed any tokens, keys, or credentials from the details above.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions