Skip to content

A native macOS / windows / Linux database IDE built with Swift and AppKit. Connect to PostgreSQL, MySQL, SQLite, and Redis from a single app with a fast, keyboard-driven interface.

C++

fix(mcp): use ConnectionConfig.password from ConnectionStore, not empty vault

DangHuynh7ca584f6d3f7
diff --git a/windows/Gridex/Services/MCP/Tools/MCPTool.cpp b/windows/Gridex/Services/MCP/Tools/MCPTool.cpp
index 4908a79..d6d4ff7 100644
--- a/windows/Gridex/Services/MCP/Tools/MCPTool.cpp
+++ b/windows/Gridex/Services/MCP/Tools/MCPTool.cpp
@@ -4,7 +4,6 @@
#include "MCPTool.h"
#include "../../../Models/ConnectionStore.h"
-#include "../../../Models/CredentialManager.h"
#include "../../../Models/MCP/MCPAuditEntry.h"
#include <algorithm>
#include <windows.h>
@@ -41,11 +40,15 @@ namespace DBModels
throw MCPToolError::connectionNotFound(narrow);
}
- // Resolve password from Windows credential vault.
- std::wstring pass = CredentialManager::Load(connectionId);
-
+ // Password comes from ConnectionStore — it DPAPI-decrypts the
+ // `password_enc` column into ConnectionConfig::password during
+ // Load(). CredentialManager (Windows Credential Vault) isn't
+ // wired in this codebase yet; looking there would always
+ // return empty and the adapter would hit
+ // 'fe_sendauth: no password supplied' (observed against
+ // PostgreSQL).
auto& ncPool = const_cast<MCPConnectionPool&>(pool);
- auto adapter = ncPool.acquire(*it, pass);
+ auto adapter = ncPool.acquire(*it, it->password);
return { adapter, *it };
}