Repository navigation
feat: improved MCP timeout - #23546
Merged
crazywoola merged 1 commit intoAug 8, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR improves MCP (Model Context Protocol) timeout handling by adding configurable timeout parameters for better connection management. The changes allow users to specify custom timeout values when creating or updating MCP tool providers.
- Adds
timeoutandsse_read_timeoutparameters to MCP provider models and services - Updates API endpoints to accept timeout configuration
- Propagates timeout settings through the entire MCP client stack
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| api/models/tools.py | Adds timeout and sse_read_timeout columns to MCPToolProvider model |
| api/migrations/versions/2025_08_07_1115-fa8b0fa6f407_add_timeout_for_tool_mcp_providers.py | Database migration to add timeout columns with default values |
| api/services/tools/mcp_tools_manage_service.py | Updates service methods to handle timeout parameters |
| api/controllers/console/workspace/tool_providers.py | Adds timeout parameters to API endpoints |
| api/core/tools/mcp_tool/tool.py | Updates MCPTool to accept and use timeout parameters |
| api/core/tools/mcp_tool/provider.py | Updates provider controller to pass timeout settings |
| api/core/mcp/mcp_client.py | Updates MCP client to use configurable timeouts |
| api/core/mcp/client/streamable_client.py | Converts timeout handling from timedelta to float |
| api/core/tools/tool_manager.py | Removes redundant comment |
| api/core/tools/__base/tool_provider.py | Removes redundant entity declaration |
| api/core/mcp/session/client_session.py | Improves type hints for queue parameters |
| api/core/mcp/session/base_session.py | Code cleanup removing unused imports and pass statements |
| api/core/mcp/client/sse_client.py | Improves exception handling |
crazywoola
approved these changes
Aug 8, 2025
crazywoola
added a commit
that referenced
this pull request
Aug 8, 2025
This reverts commit 4b0480c.
tutkun
pushed a commit
to tutkun/dify
that referenced
this pull request
Aug 15, 2025
This was referenced Sep 19, 2025
Ssazurov
pushed a commit
to Ssazurov/dify
that referenced
this pull request
Aug 8, 2026
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Fixes #<issue number>.Summary
Fixes: #23544
This is a minor improvement, and compatibility has been tested.
Screenshots
Checklist
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods