Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Increased MCP tool execution timeout from 1 minute to 10 minutes
  • Increased workflow MCP server timeout from 5 minutes to 10 minutes
  • Aligns MCP timeouts with workflow execution timeout

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Jan 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jan 31, 2026 1:33am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 31, 2026

Greptile Overview

Greptile Summary

This PR increases MCP tool execution timeouts from 1-5 minutes to a consistent 10 minutes across the system. The changes align MCP timeouts with the workflow execution timeout (DEFAULT_EXECUTION_TIMEOUT_MS), preventing premature timeouts when workflows take longer to complete.

Changes Made:

  • Increased MCP_CONSTANTS.EXECUTION_TIMEOUT from 60000ms (1 min) to 600000ms (10 min)
  • Increased MCP_CLIENT_CONSTANTS.CLIENT_TIMEOUT from 60000ms (1 min) to 600000ms (10 min) in both utils.ts and shared.ts
  • Increased workflow MCP server fetch timeout from 300000ms (5 min) to 600000ms (10 min) in the serve route
  • Updated all corresponding test cases and improved test descriptions

Impact:

  • MCP tools invoking workflows will no longer timeout prematurely if the workflow takes more than 1-5 minutes
  • All timeout layers (client, server, workflow execution) are now consistently set to 10 minutes
  • Better user experience for long-running workflow operations accessed via MCP

Confidence Score: 5/5

  • This PR is safe to merge - it's a straightforward timeout configuration change with comprehensive test updates
  • The changes are simple, well-scoped, and properly tested. All timeout values are consistently updated across the codebase, and the tests verify the new values. The change aligns with existing workflow execution timeouts and addresses a real issue where MCP operations were timing out prematurely.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/lib/mcp/utils.ts Increased EXECUTION_TIMEOUT and CLIENT_TIMEOUT from 60000 (1 min) to 600000 (10 min) to align with workflow execution timeout
apps/sim/lib/mcp/shared.ts Increased CLIENT_TIMEOUT from 60000 (1 min) to 600000 (10 min) to match server-side timeout changes
apps/sim/app/api/mcp/serve/[serverId]/route.ts Increased workflow execution timeout from 300000 (5 min) to 600000 (10 min) when calling MCP tools
apps/sim/lib/mcp/utils.test.ts Updated test expectations from 60000 to 600000 and improved test descriptions

Sequence Diagram

sequenceDiagram
    participant Client
    participant MCP API
    participant Workflow Server
    participant Workflow Execution

    Note over Client,Workflow Execution: MCP Tool Execution Flow with Updated Timeouts

    Client->>MCP API: Execute MCP Tool
    Note right of MCP API: CLIENT_TIMEOUT: 600000ms (10 min)
    
    MCP API->>MCP API: Validate Parameters
    MCP API->>Workflow Server: POST /api/mcp/serve/[serverId]
    Note right of Workflow Server: AbortSignal.timeout(600000ms) - 10 min
    
    Workflow Server->>Workflow Server: Authenticate & Validate
    Workflow Server->>Workflow Execution: POST /api/workflows/[workflowId]/execute
    Note right of Workflow Execution: EXECUTION_TIMEOUT: 600000ms (10 min)
    Note right of Workflow Execution: DEFAULT_EXECUTION_TIMEOUT_MS: 600000ms
    
    Workflow Execution->>Workflow Execution: Execute Workflow
    Workflow Execution-->>Workflow Server: Return Result
    
    Workflow Server-->>MCP API: Return Tool Result
    MCP API-->>Client: Return Response
    
    Note over Client,Workflow Execution: All timeouts now aligned at 10 minutes
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 37d5e01 into staging Jan 31, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/mcp branch January 31, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants