fix: avoid opening mcp session for local metadata

This commit is contained in:
lda
2026-06-08 18:15:47 +07:00 Verified
parent e1a74fdd4a
commit 929103219e
3 changed files with 474 additions and 2 deletions
+7 -2
View File
@@ -58,8 +58,13 @@ class McpSdkAdapter(BackendAdapter):
connection: McpSourceConnection,
auth: AuthRecord | None,
) -> dict[str, Any]:
async with self._client(connection, auth) as client:
return await client.get_connection_metadata()
# Metadata is derived from local connection config. Opening an MCP
# transport here would create an unnecessary session during discovery.
transport = connection.transport
return {
"server": connection.provider,
"transport": transport.kind if transport is not None else None,
}
async def read_resource(
self,