pulseengine_mcp_transport/
config.rs1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
7pub enum TransportConfig {
8 Stdio,
10
11 Http { port: u16, host: Option<String> },
13
14 StreamableHttp { port: u16, host: Option<String> },
16
17 WebSocket { port: u16, host: Option<String> },
19}
20
21impl Default for TransportConfig {
22 fn default() -> Self {
23 Self::Stdio
24 }
25}
26
27impl TransportConfig {
28 pub fn stdio() -> Self {
30 Self::Stdio
31 }
32
33 pub fn http(port: u16) -> Self {
35 Self::Http { port, host: None }
36 }
37
38 pub fn streamable_http(port: u16) -> Self {
40 Self::StreamableHttp { port, host: None }
41 }
42
43 pub fn websocket(port: u16) -> Self {
45 Self::WebSocket { port, host: None }
46 }
47}