Skip to main content

start_http_server

Function start_http_server 

Source
pub async fn start_http_server(
    bind: &str,
    token: String,
    extra_hosts: Vec<String>,
) -> Result<(), Box<dyn Error + Send + Sync>>
Expand description

Start the Streamable HTTP MCP server.

  • bind: socket address to listen on, e.g. 127.0.0.1:8000.
  • token: shared secret required on every request (must be non-empty).
  • extra_hosts: additional Host authorities to accept beyond loopback — add your tunnel hostname here (e.g. abc.trycloudflare.com), otherwise the built-in DNS-rebinding guard rejects requests coming through the tunnel.