pub struct Endpoint(/* private fields */);Expand description
The path a client POSTs, GETs and DELETEs, without a scheme or host.
The specification calls this the “MCP endpoint” and gives https:// example.com/mcp as its example. Only the path is kept, because the adapter
is handed a Router and mounting is the caller’s decision — a server that
also serves a web UI mounts the same router under a different base and the
endpoint is the part the MCP specification actually constrains.
Implementations§
Trait Implementations§
impl Eq for Endpoint
Source§impl FromStr for Endpoint
impl FromStr for Endpoint
Source§fn from_str(value: &str) -> Result<Self, Self::Err>
fn from_str(value: &str) -> Result<Self, Self::Err>
§Errors
EndpointError::Empty for a blank path,
EndpointError::NoLeadingSlash because axum matches paths that begin
with one and would otherwise register a route that can never fire,
EndpointError::QueryOrFragment because a ? or # never reaches a
server — the client strips both before writing the request line — so an
endpoint containing one is a route that can never fire and a
configuration mistake, and
EndpointError::NotVisibleAscii because a path is spliced into a
request line.
Surrounding whitespace is trimmed rather than refused, on the same
grounds as McpSessionId::validate: a path copied out of a config file
or a URL bar routinely arrives with a trailing newline, and treating
that as a hard error is a footgun with no security value.