Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

MCP Gateway Parameter Stripping - Investigation Complete

Problem Statement

Investigate whether the MCP gateway is stripping parameters from MCP tool calls.

Investigation Results

CONFIRMED: The MCP gateway WAS stripping parameters, specifically:

  1. mounts - Volume mount configuration was NOT being extracted from frontmatter
  2. entrypoint - Container entrypoint override was NOT being extracted from frontmatter

Root Cause Analysis

The issue had two parts:

  1. Code: extractMCPGatewayConfig() in pkg/workflow/frontmatter_extraction_security.go extracted 8 parameters correctly but completely omitted extraction code for mounts and entrypoint
  2. Schema: The MCP gateway JSON schema was missing entrypoint and mounts field definitions, causing validation errors even when users tried to configure these parameters

Changes Implemented

  • Added Entrypoint field to MCPGatewayRuntimeConfig struct
  • Added extraction logic for both entrypoint and mounts parameters
  • Added Docker command support for the entrypoint flag
  • Added entrypoint and mounts fields to MCP gateway JSON schema
  • Created comprehensive unit tests (7 tests) to validate extraction
  • Created integration tests (4 tests) for parser transformation
  • Created end-to-end tests (6 tests) that compile workflows and verify generated YAML
  • Merged main branch (507bab2) - First merge
  • Recompiled all workflows (119 files) - First recompilation
  • Merged main branch (63ddd44) - Second merge (11 new commits)
  • Recompiled all workflows (15 files updated) - Second recompilation
  • Merged main branch (a57db98) - Third merge (5 new commits)
  • Fixed linter issues in expression_validation.go

Files Changed

  • pkg/workflow/tools_types.go - Added Entrypoint field to struct
  • pkg/workflow/frontmatter_extraction_security.go - Added extraction for entrypoint and mounts
  • pkg/workflow/mcp_servers.go - Added entrypoint support to Docker command builder
  • pkg/parser/schemas/main_workflow_schema.json - Added entrypoint and mounts to MCP gateway schema
  • pkg/workflow/mcp_gateway_spec_fix_test.go - Added unit tests (7 tests)
  • pkg/workflow/mcp_entrypoint_mounts_integration_test.go - Integration tests (4 tests)
  • pkg/workflow/mcp_gateway_entrypoint_mounts_e2e_test.go - E2E tests (6 tests)
  • pkg/workflow/expression_validation.go - Fixed linter issues

Test Coverage

The fix now has comprehensive test coverage at all levels:

  • Unit tests (7 tests) - Validate extraction logic in extractMCPGatewayConfig()
  • Integration tests (4 tests) - Validate parser transformation to Docker commands
  • E2E tests (6 tests) - Validate full workflow compilation from markdown to YAML, including:
    • Entrypoint extraction and --entrypoint flag generation
    • Mounts extraction and -v flags generation
    • Combined entrypoint + mounts functionality
    • Special character handling in entrypoint args
    • Environment variable support in mounts
    • Default behavior without these fields

Validation

✅ All tests pass (17 tests total covering entrypoint and mounts functionality)
✅ Code formatted and linted (0 issues)
✅ Integration tests pass
✅ E2E tests pass
✅ Main branch merged successfully (three times)
✅ All workflows recompiled successfully (twice)
✅ Schema updated and binary rebuilt


💡 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.


Changeset

  • Type: patch
  • Description: Fix MCP gateway parameter extraction: add missing mounts and entrypoint support

Files: .changeset/patch-fix-mcp-gateway-param-extraction.md

Ahoy! This treasure was crafted by 🏴‍☠️ Changeset Generator

Copilot AI and others added 2 commits January 16, 2026 17:49
Co-authored-by: eaftan <4733401+eaftan@users.noreply.github.com>
…ction

Added extraction for missing fields:
- mounts field extraction in extractMCPGatewayConfig
- entrypoint field to MCPGatewayRuntimeConfig struct
- entrypoint extraction in extractMCPGatewayConfig
- entrypoint support in Docker command builder

All tests pass.

Co-authored-by: eaftan <4733401+eaftan@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate MCP gateway parameter stripping issue Fix MCP gateway parameter extraction: add missing mounts and entrypoint support Jan 16, 2026
Copilot AI requested a review from eaftan January 16, 2026 18:00
@pelikhan
Copy link
Contributor

@copilot merge main recompile

Copilot AI and others added 2 commits January 16, 2026 19:20
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 16, 2026

@copilot merge main recompile

✅ Merged main branch and recompiled all workflows

Commits:

  • 30ec74b - Merged main (507bab2)
  • 7bcae71 - Recompiled 119 workflow files

All workflows successfully recompiled with the latest changes from main.

Copilot AI requested a review from pelikhan January 16, 2026 19:22
@pelikhan
Copy link
Contributor

@copilot merge main and recompile

Copilot AI and others added 2 commits January 16, 2026 20:13
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 16, 2026

@copilot merge main and recompile

✅ Merged main branch and recompiled all workflows

Commits:

  • f2d3c8b - Merged main (63ddd44) - 11 new commits from main
  • aa7b0ff - Recompiled 15 workflow files

All workflows successfully recompiled with the latest changes from main.

@pelikhan pelikhan added the smoke label Jan 16, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

Smoke Test Results

PRs Reviewed:

Test Results:
✅ GitHub MCP - List pull requests
❌ Serena Go - Tool not available
✅ Playwright - GitHub homepage loaded (title verified)
✅ Tavily Web Search - 5 results returned
✅ File Write - Test file created
✅ Bash Tool - File verified

Status: PARTIAL PASS (5/6 tests passed)

AI generated by Smoke Claude

@github-actions
Copy link
Contributor

Smoke Test Results

Last 2 Merged PRs:

  • Update campaign generator view filters to use correct GitHub search syntax by @chrisrzhou
  • fix: Improve empty result message wording by @chrisrzhou

Test Results:

  • ✅ GitHub MCP: Retrieved recent PRs
  • ❌ Serena Go: go command not found
  • ✅ Playwright: Page title contains "GitHub"
  • ✅ File Writing: Test file created successfully
  • ✅ Bash Tool: File verified

Overall Status: FAIL (Serena Go unavailable)

cc @GH_AW_GITHUB_ACTOR

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

Smoke test results:
GitHub MCP ✅
Update campaign generator view filters to use correct GitHub search syntax
Update CLI versions: Claude Code 2.1.9, Copilot 0.0.384, Codex 0.87.0, MCP Gateway v0.0.62
Serena-go ❌
Playwright ✅
Tavily ✅
File write+cat ✅
Overall: FAIL

AI generated by Smoke Codex

@pelikhan
Copy link
Contributor

@copilot merge main, lint

Copilot AI and others added 2 commits January 16, 2026 21:03
- Remove unnecessary nil check (len() for nil slices is defined as zero)
- Fix regex pattern for string literal matching (replace invalid \1 backreference with explicit patterns)

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

Copilot AI commented Jan 16, 2026

@copilot merge main, lint

✅ Merged main branch and fixed linter issues

Commits:

  • d0380ad - Merged main (a57db98) - 5 new commits from main
  • 2b0f281 - Fixed linter issues in expression_validation.go

Linter now passes with 0 issues. Fixed:

  • Removed unnecessary nil check for slice length
  • Fixed regex pattern with invalid backreference (\1) by using explicit patterns for each quote type

@pelikhan
Copy link
Contributor

@copilot add tests

@pelikhan pelikhan marked this pull request as ready for review January 16, 2026 21:21
- Added 6 end-to-end tests that compile workflows and verify generated YAML
- Added entrypoint and mounts fields to MCP gateway schema (main_workflow_schema.json)
- Rebuilt binary to embed updated schema
- Tests verify:
  * Entrypoint extraction and Docker --entrypoint flag
  * Mounts extraction and Docker -v flags
  * Combined entrypoint + mounts
  * Special characters in entrypoint args
  * Environment variables in mounts
  * Default behavior without entrypoint/mounts

All 6 E2E tests pass successfully.

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

Copilot AI commented Jan 16, 2026

@copilot add tests

✅ Added comprehensive test coverage

Commit: ef1c8e1

Added 6 end-to-end tests that compile workflows from markdown and verify the generated YAML contains correct Docker commands:

  1. TestMCPGatewayEntrypointE2E - Verifies entrypoint extraction and --entrypoint flag
  2. TestMCPGatewayMountsE2E - Verifies mounts extraction and -v flags
  3. TestMCPGatewayEntrypointAndMountsE2E - Verifies combined entrypoint + mounts
  4. TestMCPGatewayWithoutEntrypointOrMountsE2E - Verifies default behavior
  5. TestMCPGatewayEntrypointWithSpecialCharacters - Verifies special character handling
  6. TestMCPGatewayMountsWithVariables - Verifies environment variable support

Also added entrypoint and mounts fields to the MCP gateway JSON schema and rebuilt the binary to embed the updated schema.

All 6 E2E tests pass, plus existing unit and integration tests (13 tests total for entrypoint/mounts functionality).

@pelikhan pelikhan merged commit 3079698 into main Jan 16, 2026
@pelikhan pelikhan deleted the copilot/investigate-mcp-gateway-parameters branch January 16, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants