| Crates.io | mcpkit-server |
| lib.rs | mcpkit-server |
| version | 0.5.0 |
| created_at | 2025-12-11 17:02:34.451768+00 |
| updated_at | 2025-12-26 00:53:41.68398+00 |
| description | Server implementation for mcpkit |
| homepage | |
| repository | https://github.com/praxiomlabs/mcpkit |
| max_upload_size | |
| id | 1980138 |
| size | 282,012 |
Server implementation for the Model Context Protocol (MCP).
This crate provides the server-side implementation including composable handler traits, a fluent builder API, and request routing.
Building an MCP server involves:
ServerHandler trait (required)ToolHandler, ResourceHandler, etc.)ServerBuilder to create a configured serveruse mcpkit_server::{ServerBuilder, ServerHandler};
use mcpkit_core::capability::{ServerInfo, ServerCapabilities};
struct MyServer;
impl ServerHandler for MyServer {
fn server_info(&self) -> ServerInfo {
ServerInfo::new("my-server", "1.0.0")
}
fn capabilities(&self) -> ServerCapabilities {
ServerCapabilities::new().with_tools()
}
}
let server = ServerBuilder::new(MyServer).build();
The server uses composable handler traits:
| Trait | Purpose |
|---|---|
ServerHandler |
Core trait required for all servers |
ToolHandler |
Handle tool discovery and execution |
ResourceHandler |
Handle resource discovery and reading |
PromptHandler |
Handle prompt discovery and rendering |
TaskHandler |
Handle long-running task operations |
SamplingHandler |
Handle server-initiated LLM requests |
ElicitationHandler |
Handle structured user input requests |
CompletionHandler |
Handle argument completion requests |
LoggingHandler |
Handle log level changes |
Handlers receive a Context that provides:
Built-in request metrics collection via ServerMetrics:
This crate is part of the mcpkit SDK. For most use cases, depend on mcpkit directly rather than this crate.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.