Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 8, 2026

The MCP Gateway specification lacked fields to configure custom entrypoints for backend MCP server containers. This prevented overriding container default entrypoints and passing custom startup arguments.

Changes

Core types (pkg/types/mcp.go, pkg/workflow/tools_types.go)

  • Added Entrypoint string field to BaseMCPServerConfig
  • Updated mcpServerConfigToMap() to serialize entrypoint field

Parsing & validation

  • Extended getMCPConfig() with optional transformContainer parameter to control docker command transformation
  • Added entrypoint extraction in tools_parser.go and validation in mcp_config_validation.go

Rendering system (pkg/workflow/mcp-config.go, pkg/workflow/copilot_mcp.go)

  • Added PreserveContainerFields flag to MCPConfigRenderer to conditionally preserve container fields
  • When MCP Gateway is enabled (shouldGenerateMCPGateway()), container/entrypoint/entrypointArgs are preserved in JSON format for gateway processing
  • When gateway is disabled, fields are transformed to docker commands with --entrypoint flag for backward compatibility

Documentation (docs/src/content/docs/reference/mcp-gateway.md)

  • Added entrypoint field specification and usage examples

Behavior

Gateway mode (preserves container fields):

tools:
  custom-mcp:
    container: ghcr.io/example/server
    entrypoint: /custom/entrypoint.sh
    entrypointArgs: ["--verbose"]

Generates config for gateway:

{
  "container": "ghcr.io/example/server",
  "entrypoint": "/custom/entrypoint.sh",
  "entrypointArgs": ["--verbose"]
}

Non-gateway mode (transforms to docker command):

{
  "command": "docker",
  "args": ["run", "--rm", "-i", "--entrypoint", "/custom/entrypoint.sh", 
           "ghcr.io/example/server", "--verbose"]
}
Original prompt

This section details on the original issue you should resolve

<issue_title>MCP Gateway spec does not allow container volume mount points to be specified</issue_title>
<issue_description>Recent changes to the MCP Gateway do not allow it to configure the volume mounts and other configuration for the backend mcp server containers that it launches.

We need a more structured way to specify these options in the json config passed to the MCP Gateway.

https://github.com/githubnext/gh-aw/blob/main/docs/src/content/docs/reference/mcp-gateway.md</issue_description>

<agent_instructions>Please take a look at this issue and create a PR with a fix.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


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

Copilot AI and others added 4 commits January 8, 2026 16:53
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
… configuration

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix MCP Gateway spec to allow container volume mount points Add volume mount and container configuration support to MCP Gateway Jan 8, 2026
Copilot AI requested a review from lpcox January 8, 2026 17:16
@lpcox
Copy link
Collaborator

lpcox commented Jan 8, 2026

@copilot please do not add network and port options to the configuration. just add volume mounts.

…ounts

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 8, 2026

@copilot please do not add network and port options to the configuration. just add volume mounts.

Done! Removed the network and ports options, keeping only the mounts (volume mounts) configuration. The gateway now uses the default --network host mode.

Updated in commit 9595db1.

Copilot AI changed the title Add volume mount and container configuration support to MCP Gateway Add volume mount support to MCP Gateway Jan 8, 2026
Copilot AI changed the title Add volume mount support to MCP Gateway Add entrypoint and entrypointArgs support for MCP Gateway container configuration Jan 8, 2026
Copy link
Collaborator

@lpcox lpcox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@lpcox lpcox marked this pull request as ready for review January 8, 2026 18:20
@lpcox lpcox merged commit 81bad71 into main Jan 8, 2026
47 of 48 checks passed
@lpcox lpcox deleted the copilot/fix-volume-mount-configuration branch January 8, 2026 18:20
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.

MCP Gateway spec does not allow container volume mount points to be specified

2 participants