{"id":1145,"date":"2026-12-05T22:07:12","date_gmt":"2026-12-05T20:07:12","guid":{"rendered":"https:\/\/mexela.com\/blog\/mcp-corporate-proxy\/"},"modified":"2026-12-05T22:07:12","modified_gmt":"2026-12-05T20:07:12","slug":"mcp-corporate-proxy","status":"publish","type":"post","link":"https:\/\/mexela.com\/blog\/mcp-corporate-proxy\/","title":{"rendered":"Using MCP Behind a Corporate Proxy: Local vs. Remote"},"content":{"rendered":"<p>Proxy settings matter to MCP when the client makes a network connection. A local stdio server is a subprocess: the client talks to its standard input and output, so that link cannot go through an HTTP proxy. The subprocess might still make its own outbound requests; those are a separate part of the setup.<\/p>\n<h2 id=\"choose-mcp-transport\">Decide which connection you are diagnosing<\/h2>\n<table>\n<thead>\n<tr>\n<th>What you configured<\/th>\n<th>Where to look<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>A local command and arguments<\/td>\n<td>Check that the subprocess launches and keeps protocol messages on stdout and diagnostics on stderr. If a tool inside it calls an API, inspect that process\u2019s network configuration.<\/td>\n<\/tr>\n<tr>\n<td>An approved remote HTTPS MCP URL<\/td>\n<td>Check the client\u2019s proxy settings, then the HTTPS origin, endpoint path and authentication. The proxy\u2019s credentials are not the MCP server\u2019s credentials.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The <a href=\"https:\/\/modelcontextprotocol.io\/specification\/2025-11-25\/basic\/transports\">MCP transport specification<\/a> describes both modes. Keep a local server bound to localhost, retain authentication and origin checks for HTTP, and do not expose a private MCP server just to make a connection test work.<\/p>\n<h2 id=\"mcp-handshake\">Send one initialization request to a test endpoint<\/h2>\n<p>Use this PowerShell 7 probe only with an operator-approved, credential-free staging endpoint for Streamable HTTP. Set <code>MEXELA_APPROVED_MCP_URL<\/code> to its exact HTTPS endpoint, <code>MEXELA_CORPORATE_PROXY<\/code> to the approved proxy URL, and <code>MEXELA_TEST_CA<\/code> to the approved origin CA bundle. Use a real MCP client for authenticated or stateful use; this diagnostic performs no tool calls and does not complete an MCP session.<\/p>\n<pre id=\"mcp-initialize\"><code class=\"language-powershell\">$message = @{jsonrpc='2.0'; id=1; method='initialize'; params=@{protocolVersion='2025-11-25'; capabilities=@{}; clientInfo=@{name='network-check'; version='1.0.0'}}} | ConvertTo-Json -Depth 6 -Compress\n$message | curl.exe --silent --show-error --include --connect-timeout 5 --max-time 10 --noproxy \"\" --proxy \"$env:MEXELA_CORPORATE_PROXY\" --cacert \"$env:MEXELA_TEST_CA\" --header \"Content-Type: application\/json\" --header \"Accept: application\/json, text\/event-stream\" --data-binary '@-' \"$env:MEXELA_APPROVED_MCP_URL\"<\/code><\/pre>\n<h2 id=\"read-mcp-result\">Read the response before trying again<\/h2>\n<p>Look for a JSON-RPC response with ID 1 and a negotiated protocol version. A Streamable HTTP server may send the response as JSON or as an SSE event. A proxy CONNECT 200 is not an MCP response, and an HTML login page is not a successful handshake. A 407 points to proxy authentication; an origin 401 points to the server\u2019s authentication. A timeout after receiving SSE headers may mean the one-shot curl command reached its time limit on an open stream.<\/p>\n<p>If only the real client fails, check its own proxy support, trust configuration and which process owns the connection. For environment variable scope, see the <a href=\"\/blog\/http-proxy-https-proxy-no-proxy\/\">environment guide<\/a> or the <a href=\"\/blog\/proxy-setup-developer-guides\/\">developer integration hub<\/a>.<\/p>\n<p><strong>Verification, December 5, 2026:<\/strong> The published probe made one CONNECT and one HTTPS POST to a local fixture. The fixture confirmed the initialization payload and both accepted media types, then returned a JSON-RPC response. This did not test a production MCP server, an SSE stream, OAuth, or a full session.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Find out when an MCP connection needs an HTTP proxy. Compare local stdio with a remote Streamable HTTP server and test one initialization request.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[189],"tags":[],"_links":{"self":[{"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/posts\/1145"}],"collection":[{"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/comments?post=1145"}],"version-history":[{"count":0,"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/posts\/1145\/revisions"}],"wp:attachment":[{"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/media?parent=1145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/categories?post=1145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/tags?post=1145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}