Skip to content

Fix Serena MCP server URL to use host.docker.internal#9817

Merged
pelikhan merged 2 commits intocopilot/update-mcp-server-configuration-againfrom
copilot/debug-mcp-gateway-failure
Jan 13, 2026
Merged

Fix Serena MCP server URL to use host.docker.internal#9817
pelikhan merged 2 commits intocopilot/update-mcp-server-configuration-againfrom
copilot/debug-mcp-gateway-failure

Conversation

Copy link
Contributor

Copilot AI commented Jan 13, 2026

The MCP gateway container was trying to connect to Serena at http://localhost:9121, which resolves to the container itself rather than the host where Serena runs.

Changes

  • Updated Serena MCP server URL from localhost:9121 to host.docker.internal:9121 in both JSON and TOML config renderers
  • Updated test expectations to reflect the new URL pattern
  • Recompiled all affected workflow lock files

This aligns with the existing pattern used by safe-inputs server (http://host.docker.internal:3000).

Context

# Gateway configuration (sent to container)
"serena": {
  "type": "http",
  "url": "http://host.docker.internal:9121"  # Now reaches host
}

# Health check (runs on host)
curl -s http://localhost:9121/health  # Still correct

The health check step correctly uses localhost since it runs on the host, while the gateway config uses host.docker.internal for container-to-host communication.

Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/20955104811/job/60217714408#step:47:1

Debug why the MCP gateway failed

Custom agent used: agentic-campaigns
GitHub Agentic Campaigns - Create and manage multi-workflow campaigns for coordinated automation at scale


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

The Serena MCP server runs on the host at port 9121, but the MCP gateway
runs in a Docker container. When the gateway tries to connect to
http://localhost:9121, it's trying to connect to itself inside the
container, not to the host where Serena is actually running.

Changed the Serena MCP server URL from http://localhost:9121 to
http://host.docker.internal:9121 so the gateway container can properly
reach the Serena server running on the host.

This matches the pattern used by safe-inputs server which correctly uses
http://host.docker.internal:3000.

Fixes: github.com/githubnext/gh-aw/actions/runs/20955104811

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Debug why the MCP gateway failed Fix Serena MCP server URL to use host.docker.internal Jan 13, 2026
Copilot AI requested a review from pelikhan January 13, 2026 12:22
@pelikhan pelikhan marked this pull request as ready for review January 13, 2026 12:24
@pelikhan pelikhan merged commit dbab495 into copilot/update-mcp-server-configuration-again Jan 13, 2026
@pelikhan pelikhan deleted the copilot/debug-mcp-gateway-failure branch January 13, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants