What happened
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
- Create or open a project folder in VS Code.
- Add a .env file to the project root:
DSN=postgresql://user:password@localhost:5432/database
- Confirm that DBHub starts successfully when launched manually from the project directory:
dbhub --transport stdio
- Open ACP Patchbay.
- Go to Settings > MCP Servers > Add a custom MCP server.
- 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
What happened
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
DSN=postgresql://user:password@localhost:5432/database
dbhub --transport stdio
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
Confirmations