Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/mcp-inspector.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/smoke-otel-backends.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions pkg/parser/mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@

config, err := ParseMCPConfig(serverName, toolConfig, toolConfig)
if err != nil {
return nil, fmt.Errorf("failed to parse MCP config for %s: %w", serverName, err)

Check failure on line 215 in pkg/parser/mcp.go

View workflow job for this annotation

GitHub Actions / error-message-lint

avoid generic 'failed to ...: %w' wrapping; add specific recovery guidance

Check failure on line 215 in pkg/parser/mcp.go

View workflow job for this annotation

GitHub Actions / error-message-lint

error message uses negative language without constructive guidance; include expected/requires/should/example details
}

mcpLog.Printf("Parsed custom MCP server: %s (type=%s)", serverName, config.Type)
Expand Down Expand Up @@ -459,7 +459,7 @@
case string:
// Parse JSON string
if err := json.Unmarshal([]byte(v), &mcpConfig); err != nil {
return config, fmt.Errorf("invalid JSON in mcp configuration: %w", err)

Check failure on line 462 in pkg/parser/mcp.go

View workflow job for this annotation

GitHub Actions / error-message-lint

error message uses negative language without constructive guidance; include expected/requires/should/example details
}
default:
return config, fmt.Errorf("mcp configuration must be a map or JSON string, got %T. Example:\nmcp-servers:\n %s:\n command: \"npx @my/tool\"\n args: [\"--port\", \"3000\"]", v, toolName)
Expand Down Expand Up @@ -621,22 +621,6 @@
}
}

// Extract network configuration for stdio (container-based tools)
if network, hasNetwork := mcpConfig["network"]; hasNetwork {
if networkMap, ok := network.(map[string]any); ok {
// Extract proxy arguments from network config
if proxyArgs, hasProxyArgs := networkMap["proxy-args"]; hasProxyArgs {
if proxyArgsSlice, ok := proxyArgs.([]any); ok {
for _, arg := range proxyArgsSlice {
if argStr, ok := arg.(string); ok {
config.ProxyArgs = append(config.ProxyArgs, argStr)
}
}
}
}
}
}

case "http":
if url, hasURL := mcpConfig["url"]; hasURL {
Comment on lines 621 to 625
if urlStr, ok := url.(string); ok {
Expand Down
26 changes: 0 additions & 26 deletions pkg/parser/mcp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,32 +645,6 @@ func TestParseMCPConfig(t *testing.T) {
Allowed: nil,
},
},

{
name: "Stdio with network proxy-args (new format)",
toolName: "network-proxy-server",
mcpSection: map[string]any{
"type": "stdio",
"command": "docker",
"args": []any{"run", "myserver"},
"network": map[string]any{
"allowed": []any{"example.com", "api.example.com"},
"proxy-args": []any{"--network-proxy-arg1", "--network-proxy-arg2"},
},
},
toolConfig: map[string]any{},
expected: RegistryMCPServerConfig{BaseMCPServerConfig: types.BaseMCPServerConfig{Type: "stdio",
Command: "docker",
Args: []string{"run", "myserver"},

Env: map[string]string{},
Headers: map[string]string{}}, Name: "network-proxy-server",

ProxyArgs: []string{"--network-proxy-arg1", "--network-proxy-arg2"},

Allowed: []string{},
},
},
{
name: "Local type (alias for stdio)",
Comment on lines 645 to 649
toolName: "local-server",
Expand Down
12 changes: 12 additions & 0 deletions pkg/parser/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,18 @@ func TestValidateMCPConfigWithSchema(t *testing.T) {
wantErr: true,
errContains: "jsonschema validation failed",
},
{
name: "per-server network rejected by schema",
mcpConfig: map[string]any{
"type": "stdio",
"command": "node",
"network": map[string]any{
Comment on lines +235 to +239
"proxy-args": []any{"--proxy-test"},
},
},
wantErr: true,
errContains: "jsonschema validation failed",
},
{
name: "valid local type (alias for stdio)",
mcpConfig: map[string]any{
Expand Down
30 changes: 1 addition & 29 deletions pkg/parser/schemas/main_workflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10723,34 +10723,6 @@
"additionalProperties": false,
"description": "Environment variables for MCP server"
},
"network": {
"type": "object",
"deprecated": true,
"$comment": "DEPRECATED: Per-server network configuration is no longer supported. Use top-level workflow 'network:' configuration instead.",
"properties": {
"allowed": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?)*$",
"description": "Allowed domain name"
},
"minItems": 1,
"uniqueItems": true,
"description": "List of allowed domain names for network access",
"maxItems": 100
},
"proxy-args": {
"type": "array",
"items": {
"type": "string"
},
"description": "Custom proxy arguments for container-based MCP servers"
}
},
"additionalProperties": false,
"description": "DEPRECATED: Per-server network configuration is no longer supported. Use top-level workflow 'network:' configuration instead. This field is ignored and will be removed in a future version."
},
"allowed": {
"type": "array",
"description": "List of allowed tool names for this MCP server",
Expand All @@ -10768,7 +10740,7 @@
}
},
"additionalProperties": false,
"$comment": "Validation constraints: (1) Mutual exclusion: 'command' and 'container' cannot both be specified. (2) Requirement: Either 'command' or 'container' must be provided (via 'anyOf'). (3) Type constraint: When 'type' is 'stdio' or 'local', either 'command' or 'container' is required. Note: Per-server 'network' field is deprecated and ignored.",
"$comment": "Validation constraints: (1) Mutual exclusion: 'command' and 'container' cannot both be specified. (2) Requirement: Either 'command' or 'container' must be provided (via 'anyOf'). (3) Type constraint: When 'type' is 'stdio' or 'local', either 'command' or 'container' is required.",
"anyOf": [
{
"required": ["type"]
Expand Down
45 changes: 1 addition & 44 deletions pkg/parser/schemas/mcp_config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,49 +147,6 @@
}
]
},
"network": {
"type": "object",
"deprecated": true,
"properties": {
"allowed": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?)*$",
"description": "Allowed domain name"
},
"minItems": 1,
"uniqueItems": true,
"description": "List of allowed domain names for network access",
"examples": [
["github.com", "api.github.com"],
["example.com", "api.example.com", "cdn.example.com"]
]
},
"proxy-args": {
"type": "array",
"items": {
"type": "string"
},
"description": "Custom proxy arguments for container-based MCP servers",
"examples": [
["--proxy", "http://proxy.example.com:8080"],
["--proxy-auth", "user:pass"]
]
}
},
"additionalProperties": false,
"description": "DEPRECATED: Per-server network configuration is no longer supported. Use top-level workflow 'network:' configuration instead. This field is ignored and will be removed in a future version.",
"examples": [
{
"allowed": ["github.com", "api.github.com"]
},
{
"allowed": ["example.com"],
"proxy-args": ["--proxy", "http://proxy.example.com:8080"]
}
]
},
"allowed": {
"type": "array",
"items": {
Expand Down Expand Up @@ -218,7 +175,7 @@
"then": {
"required": ["url"],
"not": {
"anyOf": [{ "required": ["command"] }, { "required": ["container"] }, { "required": ["network"] }]
"anyOf": [{ "required": ["command"] }, { "required": ["container"] }]
}
}
},
Expand Down
Loading