mirror of https://github.com/kortix-ai/suna.git
fix mcp connection error for tools
This commit is contained in:
parent
1f73aa25ef
commit
1701eb421c
|
@ -65,9 +65,7 @@ class CustomMCPHandler:
|
|||
from mcp import ClientSession
|
||||
from mcp.client.streamable_http import streamablehttp_client
|
||||
|
||||
http_client = connection_service._http_client
|
||||
|
||||
access_token = await http_client._ensure_access_token()
|
||||
access_token = await connection_service._ensure_access_token()
|
||||
|
||||
project_id = os.getenv("PIPEDREAM_PROJECT_ID")
|
||||
environment = os.getenv("PIPEDREAM_X_PD_ENVIRONMENT", "development")
|
||||
|
@ -80,8 +78,8 @@ class CustomMCPHandler:
|
|||
"x-pd-app-slug": app_slug,
|
||||
}
|
||||
|
||||
if http_client.rate_limit_token:
|
||||
headers["x-pd-rate-limit"] = http_client.rate_limit_token
|
||||
if hasattr(connection_service, 'rate_limit_token') and connection_service.rate_limit_token:
|
||||
headers["x-pd-rate-limit"] = connection_service.rate_limit_token
|
||||
|
||||
if oauth_app_id:
|
||||
headers["x-pd-oauth-app-id"] = oauth_app_id
|
||||
|
|
|
@ -69,9 +69,7 @@ class MCPToolExecutor:
|
|||
import os
|
||||
from pipedream import connection_service
|
||||
|
||||
http_client = connection_service._http_client
|
||||
|
||||
access_token = await http_client._ensure_access_token()
|
||||
access_token = await connection_service._ensure_access_token()
|
||||
|
||||
project_id = os.getenv("PIPEDREAM_PROJECT_ID")
|
||||
environment = os.getenv("PIPEDREAM_X_PD_ENVIRONMENT", "development")
|
||||
|
@ -84,8 +82,8 @@ class MCPToolExecutor:
|
|||
"x-pd-app-slug": app_slug,
|
||||
}
|
||||
|
||||
if http_client.rate_limit_token:
|
||||
headers["x-pd-rate-limit"] = http_client.rate_limit_token
|
||||
if hasattr(connection_service, 'rate_limit_token') and connection_service.rate_limit_token:
|
||||
headers["x-pd-rate-limit"] = connection_service.rate_limit_token
|
||||
|
||||
if oauth_app_id:
|
||||
headers["x-pd-oauth-app-id"] = oauth_app_id
|
||||
|
|
Loading…
Reference in New Issue