anthropics/skills · error · ValueError
URL is required for http transport
Error message
URL is required for http transport
What it means
create_connection() requires a url for transport in ('http', 'streamable_http', 'streamable-http'): streamable-HTTP MCP servers live at a known HTTP endpoint, so constructing MCPConnectionHTTP without a url is always a caller error. The check fires before any connection attempt.
Source
Thrown at skills/mcp-builder/scripts/connections.py:147
Returns:
MCPConnection instance
"""
transport = transport.lower()
if transport == "stdio":
if not command:
raise ValueError("Command is required for stdio transport")
return MCPConnectionStdio(command=command, args=args, env=env)
elif transport == "sse":
if not url:
raise ValueError("URL is required for sse transport")
return MCPConnectionSSE(url=url, headers=headers)
elif transport in ["http", "streamable_http", "streamable-http"]:
if not url:
raise ValueError("URL is required for http transport")
return MCPConnectionHTTP(url=url, headers=headers)
else:
raise ValueError(f"Unsupported transport type: {transport}. Use 'stdio', 'sse', or 'http'")
View on GitHub (pinned to f6656c1256)
Solutions
- Provide the endpoint: create_connection(name='x', transport='http', url='http://localhost:3000/mcp').
- If the entry has command/args and no url, it is a stdio server — use transport='stdio'.
- Confirm the url key spelling and that the value includes the scheme and full path (often '/mcp').
- Add any required headers dict alongside the url.
Example fix
# before
create_connection(name="api", transport="http")
# after
create_connection(name="api", transport="http", url="http://127.0.0.1:3000/mcp", headers={"Authorization": "Bearer tok"}) Defensive patterns
Strategy: validation
Validate before calling
from urllib.parse import urlparse
def valid_http_entry(entry: dict) -> bool:
url = entry.get("url") or ""
return bool(url) and urlparse(url).scheme in ("http", "https") Try / catch
try:
conn = create_connection(name=n, transport="http", url=u)
except ValueError as e:
if "URL is required" in str(e):
raise ConfigError(f"server {n!r}: http entry missing 'url'") from e
raise Prevention
- Validate that entries declaring http/sse transports carry a url at startup.
- If an entry only has command/args, classify it as stdio automatically.
- Test config parsing in CI so schema drift fails the build, not production.
When it happens
Trigger: Calling create_connection(transport='http') with url omitted — e.g. a config entry that only defines command/args (a stdio server) but declares http transport, or the url field left blank by a config generator.
Common situations: Migrating MCP configs from older sse/stdio examples without adding the url; JSON schema drift between client versions (url vs serverUrl key); empty template values never filled in.
Related errors
- Command is required for stdio transport
- URL is required for sse transport
- Unsupported transport type: {transport}. Use 'stdio', 'sse',
- Expected JSON object with 'reviews' key
- {word} not found (not an unpacked .docx?)
AI-assisted analysis of anthropics/skills@f6656c1256 (2026-08-14).
Data as JSON: /api/errors/0ecb2d47193a9344.
Report an issue: GitHub.