Extract MCP timeout constants for maintainability#6692
Merged
Conversation
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Extract MCP timeout constants for better maintainability
Extract MCP timeout constants for maintainability
Dec 17, 2025
pelikhan
approved these changes
Dec 17, 2025
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.
Consolidates hardcoded timeout values (10s connect, 5s operations, 30m HTTP) into named constants to improve maintainability and consistency across MCP client code.
Changes
Added constants in
pkg/cli/mcp_inspect_mcp.go:MCPConnectTimeout(10s) - MCP server connection establishmentMCPOperationTimeout(5s) - ListTools/ListResources operationsMCPServerHTTPTimeout(30m) - HTTP server session timeoutReplaced hardcoded values:
connectStdioMCPServerandconnectHTTPMCPServerReadHeaderTimeoutto HTTP server config inmcp_server.goAll timeout values remain functionally unchanged.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/user/usr/bin/gh gh api user --jq .login -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env it/ref/tags/v5 GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api user --jq .login GmkEpiFk4 GO111MODULE 3575698/b347=> GOINSECURE GOMOD -d/gh-aw go ortc�� .git stmain.go noffline GOINSECURE GOMOD GOMODCACHE noffline(http block)/usr/bin/gh gh api user --jq .login /run/containerd/io.containerd.runtime.v2.task/moby/b073249c18aed80908ce3ba76b888163c4be1e100cbae57837652be6cccfe26e/init.pid b073249c18aed80908ce3ba76b888163c4be1e100cbae57837652be6cccfe26e 1/x64/bin/node 163c4be1e100cbae57837652be6cccfe26e/log.json GOMOD GOMODCACHE ache/go/1.25.0/x--json env 92/push_to_pull_request_branch.j/run/containerd/io.containerd.runtime.v2.task/moby/6701175663d14bash GO111MODULE 3575698/b383=> GOINSECURE GOMOD GOMODCACHE go(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.