Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

The MCP Gateway was maintaining a local copy of the JSON schema instead of referencing the canonical version at https://raw.githubusercontent.com/githubnext/gh-aw/main/docs/public/schemas/mcp-gateway-config.schema.json.

Changes

  • Removed local schema file (internal/config/schemas/mcp-gateway-config.schema.json)
  • Fetch schema at runtime from remote URL instead of embedding with go:embed
  • Fix regex incompatibility: Remote schema uses negative lookahead patterns (^(?!stdio$|http$)[a-z][a-z0-9-]*$) which aren't valid in JSON Schema Draft 7. Transform to equivalent not constraints:
    // Before: Pattern with negative lookahead (invalid)
    typeField["pattern"] = "^(?!stdio$|http$)[a-z][a-z0-9-]*$"
    
    // After: Use 'not' constraint (valid)
    typeField["not"] = map[string]interface{}{
        "enum": []string{"stdio", "http"},
    }
  • Update mount validation: Remote schema allows optional mode (source:dest or source:dest:mode). Updated regex pattern and validation logic accordingly
  • Update schema URL references in rules.go to point to raw GitHub content URL

Schema Compatibility

The remote schema includes features not yet implemented (custom server types, tools filter). Validation accepts these but runtime ignores them, maintaining backward compatibility.

Original prompt

This section details on the original issue you should resolve

<issue_title>mcp schema authority</issue_title>
<issue_description>this should be the Source of Truth. https://github.com/githubnext/gh-aw/blob/main/docs/public/schemas/mcp-gateway-config.schema.json

https://github.com/githubnext/gh-aw-mcpg/blob/main/internal/config/schemas/mcp-gateway-config.schema.json should refer to that one</issue_description>

<agent_instructions>Please find references to the local schema and replace them with references to the schema in the gh-aw repo. THen remove the schema file from this repo.</agent_instructions>

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


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 16, 2026 00:46
- Remove local schema file at internal/config/schemas/mcp-gateway-config.schema.json
- Update schema_validation.go to fetch schema from remote URL
- Fix incompatible regex patterns in remote schema (negative lookahead)
- Update mount validation to allow optional mode per new schema
- Update test expectations for new schema behavior
- All config tests passing

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] Update schema references to mcp gateway config Replace local schema with remote source of truth Jan 16, 2026
Copilot AI requested a review from lpcox January 16, 2026 00:48
@lpcox lpcox marked this pull request as ready for review January 16, 2026 01:04
@lpcox lpcox merged commit 4f490c9 into main Jan 16, 2026
3 checks passed
@lpcox lpcox deleted the copilot/update-schema-references branch January 16, 2026 01:05
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 schema authority

2 participants