Add configurable timeout for context server tool calls (#33348)

Closes: #32668

- Add
[tool_call_timeout_millis](https://github.com/cline/cline/pull/1904)
field to ContextServerCommand, like in Cline
- Update ModelContextServerBinary to include timeout configuration
- Modify Client to store and use configurable request timeout
- Replace hardcoded REQUEST_TIMEOUT with self.request_timeout
- Rename REQUEST_TIMEOUT to DEFAULT_REQUEST_TIMEOUT for clarity
- Maintain backward compatibility with 60-second default

Release Notes:

- context_server: Add support for configurable timeout for MCP tool
calls

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
This commit is contained in:
Rafał Krzyważnia
2025-09-03 00:03:56 +00:00
committed by GitHub
co-authored by Ben Brandt
parent 893eb92f91
commit ae0ee70abd
6 changed files with 28 additions and 4 deletions
@@ -976,6 +976,7 @@ mod tests {
path: "somebinary".into(),
args: vec!["arg".to_string()],
env: None,
timeout: None,
},
},
),
@@ -1016,6 +1017,7 @@ mod tests {
path: "somebinary".into(),
args: vec!["anotherArg".to_string()],
env: None,
timeout: None,
},
},
),
@@ -1098,6 +1100,7 @@ mod tests {
path: "somebinary".into(),
args: vec!["arg".to_string()],
env: None,
timeout: None,
},
},
)],
@@ -1150,6 +1153,7 @@ mod tests {
path: "somebinary".into(),
args: vec!["arg".to_string()],
env: None,
timeout: None,
},
},
)],
@@ -1177,6 +1181,7 @@ mod tests {
command: ContextServerCommand {
path: "somebinary".into(),
args: vec!["arg".to_string()],
timeout: None,
env: None,
},
},
@@ -1230,6 +1235,7 @@ mod tests {
path: "somebinary".into(),
args: vec!["arg".to_string()],
env: None,
timeout: None,
},
}
}
@@ -1318,6 +1324,7 @@ mod tests {
path: self.path.clone(),
args: vec!["arg1".to_string(), "arg2".to_string()],
env: None,
timeout: None,
}))
}
@@ -69,6 +69,7 @@ impl registry::ContextServerDescriptor for ContextServerDescriptor {
path: command.command,
args: command.args,
env: Some(command.env.into_iter().collect()),
timeout: None,
})
})
}
+1
View File
@@ -604,6 +604,7 @@ impl Settings for ProjectSettings {
path: cmd.command,
args: cmd.args.unwrap_or_default(),
env: cmd.env,
timeout: None,
}
}
}