Skip to content

[plan] Reduce MCP connection timeouts to speed up agent startup #12557

@github-actions

Description

@github-actions

Objective

Reduce MCP connection timeout values to speed up error detection and reduce waiting time during agent initialization.

Context

Current MCP timeout configuration uses conservative values:

  • MCP connection timeout: 120 seconds
  • MCP tool timeout: 60 seconds

These long timeouts add unnecessary wait time when connections fail or tools are unresponsive. Most successful connections complete within 10-20 seconds.

Impact: Save 5-8s (3-6% of agent startup time)

Approach

  1. Review current timeout values in MCP configuration
  2. Analyze successful MCP connection times from workflow logs
  3. Set aggressive but safe timeout values based on real data
  4. Test with multiple MCP servers (GitHub, safe outputs, custom)
  5. Add retry logic if needed for robustness

Recommended Configuration

env:
  MCP_TIMEOUT: 30000        # Reduce from 120s to 30s
  MCP_TOOL_TIMEOUT: 20000   # Reduce from 60s to 20s

Files to Modify

  • MCP configuration generation in pkg/workflow/
  • Environment variable setup in workflow templates
  • MCP gateway initialization scripts in actions/setup/
  • Any timeout constants in Go code

Acceptance Criteria

AI generated by Plan Command for #12543

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions