🔧 fix: Fix rampant pings and rate limiting

- Skips idle connection checks in `getMCPManager` to avoid unnecessary pings.
- Introduces a skipOAuthTimeout flag during initial connection to prevent timeouts during server discovery.
- Uses a lightweight connection state check instead of ping to avoid rate limits.
- Prevents refetch spam and rate limit errors when checking connection status.
- Fixes an issue where the server connection was not being disconnected.
This commit is contained in:
Dustin Healy 2025-07-21 12:53:28 -07:00 committed by Danny Avila
parent 4b4741b1aa
commit 3ca736bc53
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
9 changed files with 90 additions and 39 deletions

View file

@ -97,7 +97,6 @@ function createServerToolsCallback() {
return;
}
await mcpToolsCache.set(serverName, serverTools);
logger.warn(`MCP tools for ${serverName} added to cache.`);
} catch (error) {
logger.error('Error retrieving MCP tools from cache:', error);
}
@ -240,7 +239,6 @@ const getAvailableTools = async (req, res) => {
// Check if the app-level connection is active
try {
const mcpManager = getMCPManager();
const allConnections = mcpManager.getAllConnections();
const appConnection = mcpManager.getConnection(serverName);