pub struct NewMcpServer {
pub name: String,
pub server_type: McpServerType,
pub config: McpServerConfig,
pub enabled: bool,
pub auto_start: bool,
pub env: Vec<McpEnvEntry>,
}Expand description
An MCP server to be inserted into the system (no ID yet).
This represents an MCP server that hasn’t been persisted to the database.
After insertion, the repository returns an McpServer with the assigned ID.
Fields§
§name: StringUser-friendly name for the server.
server_type: McpServerTypeConnection type (stdio or SSE).
config: McpServerConfigExecution configuration (command, args, URL, etc.).
enabled: boolWhether tools from this server are included in chat.
auto_start: boolWhether to start this server when gglib launches.
env: Vec<McpEnvEntry>Environment variables for the server process.
Implementations§
Source§impl NewMcpServer
impl NewMcpServer
Sourcepub fn new_stdio(
name: impl Into<String>,
exe_path: impl Into<String>,
args: Vec<String>,
path_extra: Option<String>,
) -> Self
pub fn new_stdio( name: impl Into<String>, exe_path: impl Into<String>, args: Vec<String>, path_extra: Option<String>, ) -> Self
Create a new stdio-based MCP server.
Sourcepub fn new_sse(name: impl Into<String>, url: impl Into<String>) -> Self
pub fn new_sse(name: impl Into<String>, url: impl Into<String>) -> Self
Create a new SSE-based MCP server.
Sourcepub fn with_env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add an environment variable.
Sourcepub fn with_working_dir(self, dir: impl Into<String>) -> Self
pub fn with_working_dir(self, dir: impl Into<String>) -> Self
Set the working directory.
Sourcepub const fn with_auto_start(self, auto_start: bool) -> Self
pub const fn with_auto_start(self, auto_start: bool) -> Self
Set auto-start.
Sourcepub const fn with_enabled(self, enabled: bool) -> Self
pub const fn with_enabled(self, enabled: bool) -> Self
Set enabled status.
Trait Implementations§
Source§impl Clone for NewMcpServer
impl Clone for NewMcpServer
Source§fn clone(&self) -> NewMcpServer
fn clone(&self) -> NewMcpServer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NewMcpServer
impl Debug for NewMcpServer
Source§impl<'de> Deserialize<'de> for NewMcpServer
impl<'de> Deserialize<'de> for NewMcpServer
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NewMcpServer
impl RefUnwindSafe for NewMcpServer
impl Send for NewMcpServer
impl Sync for NewMcpServer
impl Unpin for NewMcpServer
impl UnwindSafe for NewMcpServer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more