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 WebSocket { port: u16, host: Option<String> },
16}
17
18impl Default for TransportConfig {
19 fn default() -> Self {
20 Self::Stdio
21 }
22}
23
24impl TransportConfig {
25 pub fn stdio() -> Self {
27 Self::Stdio
28 }
29
30 pub fn http(port: u16) -> Self {
32 Self::Http { port, host: None }
33 }
34
35 pub fn websocket(port: u16) -> Self {
37 Self::WebSocket { port, host: None }
38 }
39}