pub struct McpServer { /* private fields */ }
Expand description
Main MCP Server implementation
Implementations§
Source§impl McpServer
impl McpServer
Sourcepub fn new_with_config(
memory_limit_mb: usize,
batch_size: usize,
max_file_size_mb: usize,
disable_memory_limit: bool,
exclude_dirs: Vec<String>,
include_extensions: Option<Vec<String>>,
dependency_mode: Option<String>,
) -> Result<Self>
pub fn new_with_config( memory_limit_mb: usize, batch_size: usize, max_file_size_mb: usize, disable_memory_limit: bool, exclude_dirs: Vec<String>, include_extensions: Option<Vec<String>>, dependency_mode: Option<String>, ) -> Result<Self>
Create a new MCP server with custom configuration
Sourcepub async fn initialize_with_repository<P: AsRef<Path>>(
&self,
path: P,
) -> Result<()>
pub async fn initialize_with_repository<P: AsRef<Path>>( &self, path: P, ) -> Result<()>
Initialize with repository path
Sourcepub async fn run_with_transport<T: Transport>(self, transport: T) -> Result<()>
pub async fn run_with_transport<T: Transport>(self, transport: T) -> Result<()>
Run the MCP server with a custom transport
Sourcepub fn state(&self) -> ServerState
pub fn state(&self) -> ServerState
Get current server state
Sourcepub fn server_info(&self) -> &ServerInfo
pub fn server_info(&self) -> &ServerInfo
Get server info
Sourcepub fn client_info(&self) -> Option<&ClientInfo>
pub fn client_info(&self) -> Option<&ClientInfo>
Get client info (if initialized)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for McpServer
impl !RefUnwindSafe for McpServer
impl Send for McpServer
impl Sync for McpServer
impl Unpin for McpServer
impl !UnwindSafe for McpServer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more