Why the order matters
An unchecked address would be a request from inside your network to wherever it pointed — a private service, a neighbour on the network, a metadata endpoint — with the answer handed back to whoever typed it. Checking before contacting is what makes an address somebody typed safe to accept.
What is checked
| Rule | Refusal |
|---|---|
| An address is present | url_required |
| The scheme is https | url_not_https |
| It resolves to a public address | url_blocked |
The check returns the address in its canonical form, and that is the one the package then uses — not the one that was typed.
https, with no exception
Plain http would send the token unencrypted across the network. There is no development exception: an address that cannot be reached securely cannot hold a credential.
Redirects are never followed
A redirect raises mcp_redirect. Following one would take the request — and the token — to an address nothing checked, which is the whole check undone in one hop.
A changed address is re-checked
update(name, { url }) goes through the same check. An address that does not pass is refused and the connection stays as it was.
The bare client does none of this
McpClient contacts what it is given. That is fine for a server you wrote and a bad idea for one a user typed — which is exactly the difference between it and api.mcp.