rust-mcp-sdk 0.9.0

An asynchronous SDK and framework for building MCP-Servers and MCP-Clients, leveraging the rust-mcp-schema for type safe MCP Schema Objects.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::mcp_http::McpAppState;
use axum::{
    http::{StatusCode, Uri},
    response::IntoResponse,
    Router,
};
use std::sync::Arc;

pub fn routes() -> Router<Arc<McpAppState>> {
    Router::new().fallback(not_found)
}

pub async fn not_found(uri: Uri) -> impl IntoResponse {
    (
        StatusCode::NOT_FOUND,
        format!("The requested uri does not exist:\r\nuri: {uri}"),
    )
}