HKUDS/Vibe-Trading · error · ValueError

{transport} MCP servers do not accept command/args/env

Error message

{transport} MCP servers do not accept command/args/env

What it means

Raised by validate_transport_config when an HTTP (sse/streamableHttp) server also defines command, args, or env. HTTP servers are not launched locally, so process-launch fields contradict the transport and are rejected.

Source

Thrown at agent/src/config/schema.py:398

        Raises:
            ValueError: If required fields are missing for the resolved
                transport or conflicting fields are provided.
        """
        transport = self.resolved_transport()

        if transport == "stdio":
            if not self.command.strip():
                raise ValueError("stdio MCP servers require a command")
            if self.url.strip() or self.headers:
                raise ValueError("stdio MCP servers do not accept url/headers")
            if self.auth is not None:
                raise ValueError("stdio MCP servers do not accept auth (OAuth is HTTP-only)")
            return self

        if not self.url.strip():
            raise ValueError(f"{transport} MCP servers require a url")
        if self.command.strip() or self.args or self.env:
            raise ValueError(f"{transport} MCP servers do not accept command/args/env")

        if self.auth is not None:
            # The OAuth provider owns the runtime Authorization header; a
            # hand-set static header alongside it is always a config error.
            if self.headers:
                raise ValueError(
                    "MCP servers using auth must not also set static headers "
                    "(the OAuth provider owns the Authorization header)"
                )
            # A refresh token must never traverse cleartext.
            if not self.url.strip().lower().startswith("https://"):
                raise ValueError("OAuth MCP servers require an https url")
        return self


class MCPServerConfigOverride(ConfigBase):
    """Partial MCP server override used for runtime config layering."""

View on GitHub (pinned to 80ffdda44c)

Solutions

  1. Remove command, args, and env from the HTTP server entry.
  2. If the process fields are what you want, remove url/type so it resolves to stdio.

Example fix

# before
mcp_servers:
  remote:
    type: sse
    url: https://mcp.example.com/sse
    command: npx

# after
mcp_servers:
  remote:
    type: sse
    url: https://mcp.example.com/sse
Defensive patterns

Strategy: validation

Validate before calling

PROCESS_FIELDS = ('command', 'args', 'env')

def http_entry_no_process_fields(entry: dict) -> bool:
    if entry.get('type') in ('sse', 'streamableHttp'):
        return not any(entry.get(k) for k in PROCESS_FIELDS)
    return True

Prevention

When it happens

Trigger: An entry with type: sse/streamableHttp plus command/args/env; converting a stdio server to HTTP without removing the process fields.

Common situations: Adding a url to an existing stdio entry and switching type, leaving command behind; config merge bringing in both sets of fields.

Understand the failure class

Background: Config validation failed: what "invalid value for {key}" and settings-rejection errors mean across 19 open-source libraries — this error's family across 19 libraries.

Related errors


AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28). Data as JSON: /api/errors/1b09a0b501aa396a. Report an issue: GitHub.