Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 25, 2025

The container field regex in mcp_config_schema.json rejected valid container images with registry ports (e.g., registry:5000/myimage), while the same field in included_file_schema.json and main_workflow_schema.json accepted them.

Changes

  • Updated regex pattern in pkg/parser/schemas/mcp_config_schema.json line 24:
    • Before: ^[a-zA-Z0-9][a-zA-Z0-9/_.-]*$
    • After: ^[a-zA-Z0-9][a-zA-Z0-9/:_.-]*$

Impact

Enables standard container image formats with registry ports and tags:

mcp-servers:
  my-server:
    type: stdio
    container: registry:5000/myimage        # Now valid
    container: localhost:5000/app:latest    # Now valid
    container: ghcr.io/owner/repo:v1.0.0   # Now valid

All three schema files now use identical container patterns, resolving the inconsistency identified in #2361.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • registry
    • Triggering command: docker pull registry:5000/myimage (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[task] Fix container pattern regex in mcp_config_schema.json to allow colons</issue_title>
<issue_description>## Objective
Fix the container field regex pattern in mcp_config_schema.json to allow colons, matching the pattern used in other schemas.

Context

Related to discussion #2361 - Schema Consistency Check identified that the container field has DIFFERENT regex patterns across schemas. The MCP config schema currently REJECTS valid container images like registry:5000/myimage while other schemas accept them.

Problem

  • mcp_config_schema.json: ^[a-zA-Z0-9][a-zA-Z0-9/_.-]*$ ❌ (NO colon)
  • included_file_schema.json: ^[a-zA-Z0-9][a-zA-Z0-9/:_.-]*$ ✅ (colon allowed)
  • main_workflow_schema.json: ^[a-zA-Z0-9][a-zA-Z0-9/:_.-]*$ ✅ (colon allowed)

Approach

In pkg/parser/schemas/mcp_config_schema.json line 24, update the container pattern:

  • Change: ^[a-zA-Z0-9][a-zA-Z0-9/_.-]*$
  • To: ^[a-zA-Z0-9][a-zA-Z0-9/:_.-]*$

Files to Modify

  • pkg/parser/schemas/mcp_config_schema.json (line 24)

Acceptance Criteria

  • Container pattern in mcp_config_schema.json matches the pattern in included_file_schema.json and main_workflow_schema.json
  • Pattern allows colon character for registry ports (e.g., registry:5000/myimage)
  • Run make build successfully (schemas are embedded, rebuild required)
  • Run make test to ensure no regressions

AI generated by Plan Command for discussion #2361</issue_description>

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.

- Updated pkg/parser/schemas/mcp_config_schema.json line 24
- Changed pattern from `^[a-zA-Z0-9][a-zA-Z0-9/_.-]*$` to `^[a-zA-Z0-9][a-zA-Z0-9/:_.-]*$`
- Now matches patterns in included_file_schema.json and main_workflow_schema.json
- Allows container images like `registry:5000/myimage`, `localhost:5000/image:tag`
- All tests pass successfully

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix container pattern regex in mcp_config_schema.json Fix container pattern regex in mcp_config_schema.json to allow colons Oct 25, 2025
Copilot AI requested a review from pelikhan October 25, 2025 06:41
@pelikhan pelikhan marked this pull request as ready for review October 25, 2025 06:49
Copilot AI review requested due to automatic review settings October 25, 2025 06:49
@pelikhan pelikhan merged commit 361ec49 into main Oct 25, 2025
5 checks passed
@pelikhan pelikhan deleted the copilot/fix-container-pattern-regex branch October 25, 2025 06:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a schema validation bug where the container field pattern in mcp_config_schema.json incorrectly rejected valid container image references containing colons (such as registry ports and tags), while other schema files correctly allowed them.

Key Changes:

  • Updated the regex pattern for the container field in mcp_config_schema.json to include the colon character (:)
  • Aligned the pattern with included_file_schema.json and main_workflow_schema.json for consistency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

Agentic Changeset Generator triggered by this pull request.

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.

[task] Fix container pattern regex in mcp_config_schema.json to allow colons

2 participants