Conversation
- Add Registry field to StdinServerConfig struct for JSON stdin config - Add Registry field to ServerConfig struct for internal config and TOML - Pass registry field through in convertStdinServerConfig for both stdio and HTTP servers - Update fetchAndFixSchema to add registry property to stdioServerConfig and httpServerConfig - Add comprehensive tests for registry field in both JSON and TOML configs - Tests verify registry field is properly parsed and preserved for stdio, HTTP, and servers without registry Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
@claude[agent] please fix these linting errors make lint github.com/github/gh-aw-mcpg/internal/cmd[github.com/github/gh-aw-mcpg/internal/cmd]Error: vet: internal/cmd/root_test.go:20:6: TestGetDefaultLogDir redeclared in this block |
Remove duplicate TestGetDefaultLogDir from root_test.go since flags_logging_test.go already contains this test. This fixes the lint error: "TestGetDefaultLogDir redeclared in this block" Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Fixed in commit 3da8a16. Removed duplicate |
|
@claude[agent] fix these linting errors Run golangci/golangci-lint-action@ec5d184
Error: issues found |
Replace if-else chain with tagged switch statement for tt.expectedType check as suggested by staticcheck QF1003. This improves code readability and follows Go best practices. Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Fixed in commit e305e8d. Replaced if-else chain with a tagged switch statement on |
There was a problem hiding this comment.
Pull request overview
This PR addresses a compliance gap where the registry field (defined in MCP Gateway spec section 4.1.2) was being rejected by JSON schema validation despite being a valid optional field for both stdio and HTTP server configurations.
Changes:
- Added
Registryfield toStdinServerConfigandServerConfigstructs to store the registry URI - Patched JSON schema validation to accept
registryproperty instdioServerConfigandhttpServerConfigdefinitions - Added comprehensive test coverage for registry field in both JSON (stdin) and TOML configuration formats
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/config/validation_schema.go | Patches the fetched schema to add registry property definition to stdio and HTTP server configs |
| internal/config/config_stdin.go | Adds Registry field to StdinServerConfig and propagates it through conversion functions |
| internal/config/config_core.go | Adds Registry field to ServerConfig with TOML and JSON tags |
| internal/config/config_test.go | Adds integration tests for registry field parsing and preservation in both JSON and TOML configs |
| internal/cmd/root_test.go | Removes test for getDefaultLogDir function that was moved to a different file |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Original prompt
This section details on the original issue you should resolve
<issue_title>[compliance] Compliance Gap:
registryfield rejected despite being valid per spec</issue_title><issue_description>## MCP Gateway Compliance Review — 2026-02-20
Summary
Found 2 compliance issues during daily review. One important issue (spec-valid field causes validation failure) and one minor gap (missing SHOULD feature).
Recent Changes Reviewed
4cd522d— Fix smoke-copilot workflow container tag mismatch (Fix smoke-copilot workflow container tag mismatch #1144)Important Issues (spec-valid field rejected)
1.
registryField Defined in Spec but Rejected by Schema ValidationSpecification Section: 4.1.2 Server Configuration Fields
Deep Link: https://github.com/github/gh-aw/blob/main/docs/src/content/docs/reference/mcp-gateway.md#412-server-configuration-fields
Requirement:
Current State:
The
registryfield is:StdinServerConfigstruct (internal/config/config_stdin.go)ServerConfigstruct (internal/config/config_core.go:88–112)v0.41.1for eitherstdioServerConfigorhttpServerConfigmainfor either type eitherBoth
stdioServerConfigandhttpServerConfigin the JSON schema use"additionalProperties": false, so any configuration that includesregistrywill fail schema validation with an "additional property" error.Gap:
The spec explicitly defines
registryas a valid optional field for both stdio and http servers. Appendix A.5 includes complete examples of its use. However, the current implementation will reject any configuration containing this field.Severity: Important (spec defines a valid optional field that the implementation actively rejects)
File References:
internal/config/config_stdin.go—StdinServerConfigstruct (missingRegistryfield)internal/config/config_core.go:88–112—ServerConfigstruct (missingRegistryfield)internal/config/validation_schema.go:38— pinned schema URL atv0.41.1v0.41.1:stdioServerConfig.additionalProperties = false, noregistrypropertymain: same —registrynot presentSuggested Fix:
Add
Registryfield toStdinServerConfig:Add
Registryfield toServerConfig:Add
registryproperty to the JSON schema (or open a PR ingh-awto update the pinned schema), and update the schema pin version once merged.Pass
registrythrough inconvertStdinConfigif it needs to be preserved in the internal config.Estimated Effort: Small (1–2 hours)
Minor Suggestions (SHOULD improvements)
2. No Random API Key Generation When
apiKeyIs Not ConfiguredSpecification Section: 7.3 Optimal Temporary API Key
Deep Link: https://github.com/github/gh-aw/blob/main/docs/src/content/docs/reference/mcp-gateway.md#73-optimal-temporary-api-key
Requirement:
Current State:
In
internal/cmd/root.go:380,apiKeyis set to""whencfg.Gateway.APIKeyis empty. No random key is generated, and the stdout output configuration omitsheadersentirely when there is no API key (internal/cmd/root.go:406).Gap:
Clients connecting to a gateway with no configured API key must know to send no Authorization header. If a random key were auto-generated, the gateway would always have an auth layer and clients would get the key from the stdout configuration output.
Severity: Minor (SHOULD, not MUST)
File References:
internal/cmd/root.go:380,406internal/server/transport.go:62Estimated Effort: Small (1–2 hours)
Compliance Status
registryregistryfield rejected despite being valid per spec #1162