Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 2, 2025

The schema already validates that HTTP MCP servers require a url field via the http_mcp_tool definition in main_workflow_schema.json. This validation provides early feedback during workflow parsing, before runtime execution.

Changes

  • Test coverage: Added TestHTTPMCPServerRequiresURL to verify and document the existing validation behavior across three scenarios:
    • HTTP MCP server with type: http but missing url (validation fails)
    • HTTP MCP server with explicit type and url (validation passes)
    • HTTP MCP server with url only, no explicit type (validation passes via type inference)

Example

# ❌ Fails validation
mcp-servers:
  api:
    type: http
    # missing url field

# ✓ Passes validation  
mcp-servers:
  api:
    type: http
    url: "https://api.example.com"

Error message when url is missing:

error: at '/mcp-servers/api': missing property 'url'

The validation is enforced by the JSON schema during workflow compilation, providing IDE/editor feedback without requiring runtime checks.

Original prompt

This section details on the original issue you should resolve

<issue_title>[task] Add required 'url' field to HTTP MCP tool schema</issue_title>
<issue_description>## Objective
Make the url field required in the MCP config schema for HTTP MCP tools to provide early validation feedback.

Context

This addresses Issue #2 from discussion #2969. Currently, the MCP config schema doesn't enforce the url field as required via JSON Schema, but the compiler enforces it at runtime in pkg/workflow/mcp-config.go:827. Users don't get IDE validation or early warning when url is missing.

Approach

  1. Open pkg/parser/schemas/mcp_config_schema.json
  2. Locate the http_mcp_tool definition
  3. Add a conditional required array that enforces url when type is http
  4. Follow the existing pattern used in MCP schemas (which are noted as "gold standard")

Files to Modify

  • pkg/parser/schemas/mcp_config_schema.json - Add conditional requirement for url field in HTTP tools

Acceptance Criteria

AI generated by Plan Command for discussion #2969</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.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add required 'url' field to HTTP MCP tool schema Add test coverage for HTTP MCP server URL validation Nov 2, 2025
Copilot AI requested a review from pelikhan November 2, 2025 05:58
@pelikhan pelikhan marked this pull request as ready for review November 2, 2025 13:00
Copilot AI review requested due to automatic review settings November 2, 2025 13:00
@pelikhan pelikhan enabled auto-merge (squash) November 2, 2025 13:00
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 adds validation testing for HTTP MCP server configurations to ensure they require a URL field. The test verifies that HTTP MCP servers fail validation when missing a URL, pass when URL is present with explicit type, and pass when URL is present with inferred type.

  • Validates that HTTP MCP servers without a URL field fail compilation
  • Confirms HTTP MCP servers with URL field compile successfully
  • Tests type inference when URL is present without explicit type

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

@pelikhan pelikhan merged commit a1096e9 into main Nov 2, 2025
50 of 55 checks passed
@pelikhan pelikhan deleted the copilot/add-required-url-field branch November 2, 2025 13:08
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] Add required 'url' field to HTTP MCP tool schema

2 participants