Skip to content

MCP Toolkit: OAuth2 authorization fails with "no such host" behind corporate proxy (DNS resolution bypasses proxy) #457

@harmseru

Description

@harmseru

Expected Behavior

When a proxy is configured in Docker Desktop (via UI or environment variables), the MCP toolkit's oauth authorize flow should either:

  1. Resolve the MCP server hostname (mcp.atlassian.com) through the configured proxy.
  2. Use the system's DNS settings correctly if the proxy is not intended for DNS.

Actual Behavior

The docker-desktop backend process (com.docker.backend) attempts a direct DNS lookup for mcp.atlassian.com. In corporate environments where external DNS is blocked, this results in a dial tcp: lookup mcp.atlassian.com: no such host error, even if a local proxy (e.g., handles Kerberos/NTLM) is correctly configured and working for other Docker features.
Steps to Reproduce

  1. Be behind a corporate firewall that blocks direct external DNS resolution.
  2. Configure Docker Desktop with a working HTTPS_PROXY (e.g., a local proxy like Cntlm or a corporate gateway).
  3. Run docker mcp oauth authorize atlassian-remote.
  4. Observe the 500 error: dial tcp: lookup mcp.atlassian.com: no such host.

Portability / Workaround

The issue was temporarily resolved by manually adding the IP address for mcp.atlassian.com to the local /etc/hosts file. This indicates the MCP Go backend's http.Client or Dialer is not inheriting the proxy settings for the discovery phase.
Technical Context (from logs)

Stack trace in docker desktop logs

[main.ipc] discovering OAuth requirements for atlassian-remote: connecting to server https://mcp.atlassian.com: Post "https://mcp.atlassian.com": dial tcp: lookup mcp.atlassian.com: no such host
[[STACK]]/Users/ec2-user/jenkins/workspace/.../internal/handlers/tools/api_gen.go:108 
://github.com

Environment

  • Docker Desktop Version: 4.65.0 (or your current version)
  • OS: macOS (Arm64)
  • Proxy Type: Enterprise proxy with Kerberos auth, which I abstracted by a local proxy managing the kerberos auth.
  • MCP Client: atlassian-remote

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions