MCP concepts

Address check

The platform checks an address before the package contacts it. That order is the security, not a formality.

checked firsthttps onlyredirects never followed
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

Why the order matters

In an application, the package runs on a server of yours

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

RuleRefusal
An address is presenturl_required
The scheme is httpsurl_not_https
It resolves to a public addressurl_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.