pub struct McpServer {
pub implementation: Implementation,
pub capabilities: ServerCapabilities,
/* private fields */
}Expand description
Main MCP server
Fields§
§implementation: ImplementationServer implementation information
capabilities: ServerCapabilitiesServer capabilities
Implementations§
Source§impl McpServer
impl McpServer
Sourcepub fn builder() -> McpServerBuilder
pub fn builder() -> McpServerBuilder
Create a new builder
§Example
use turul_mcp_server::McpServer;
let builder = McpServer::builder()
.name("my-server")
.version("1.0.0");Sourcepub fn capabilities(&self) -> &ServerCapabilities
pub fn capabilities(&self) -> &ServerCapabilities
Get the server’s configured capabilities
Sourcepub async fn run(&self) -> Result<()>
pub async fn run(&self) -> Result<()>
Run the server with the default transport (HTTP if available)
Sourcepub async fn run_http(&self) -> Result<()>
pub async fn run_http(&self) -> Result<()>
Run the server with HTTP transport (requires “http” feature)
Sourcepub async fn run_with_sse_access(
&self,
) -> Result<(HttpMcpServer, JoinHandle<Result<()>>)>
pub async fn run_with_sse_access( &self, ) -> Result<(HttpMcpServer, JoinHandle<Result<()>>)>
Run the server and return the HTTP server handle for SSE access (requires “http” feature)
Sourcepub fn session_storage_info(&self) -> &str
pub fn session_storage_info(&self) -> &str
Get session storage configuration info
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 moreCreates a shared type from an unshared type.