Talks AWS re:Invent 2025 - Compile blazing-fast MCP servers in Rust (DEV405) VIDEO
AWS re:Invent 2025 - Compile blazing-fast MCP servers in Rust (DEV405) Building Blazing-Fast MCP Servers with Rust
Overview
Presenter is Darkco, an AWS developer advocate heavily involved in the Rust ecosystem
Presentation covers building MCP (Model Coordination Protocol) servers using the Rust programming language
MCP is an open protocol that allows language models and AI assistants to interact with tools and resources on a user's computer
Rust is positioned as a superior alternative to Python and other languages for building MCP servers
Advantages of Rust for MCP Servers
Rust binaries are compiled and self-contained, avoiding the pain of installing dependencies with tools like npm, pip, or cargo install
Rust's type safety and compile-time guarantees provide a more robust and secure foundation for MCP servers
Rust's performance characteristics enable building highly performant and responsive MCP servers
Anatomy of a Rust MCP Server
Server Struct : Defines the core MCP server, including a ToolRouter for mapping tools to handler functions
Tool Router Macro : Generates the necessary boilerplate for the ToolRouter implementation
Server Handler : Implements the required MCP server methods like call_tool and list_tools
Tool Functions : Implement the actual functionality exposed as MCP tools
Implementing MCP Tools
Tool Struct : Defines the input parameters for the tool using a Rust struct and the schemars crate for JSON schema validation
Tool Function : Implements the tool logic, potentially calling other helper functions to interact with external resources
Tool Macro : Decorates the tool function with metadata like the tool name and description
Integrating with External Resources
Presenter demonstrates building an MCP server that interacts with a local to-do API and a thermal receipt printer
The MCP server exposes tools to:
Retrieve the list of to-dos
Create a new to-do
Print the details of a specific to-do on the receipt printer
Tooling and Testing
The presenter uses the just task runner for building and testing the MCP server
The MCP Inspector is a TypeScript-based tool that can be used to connect to and test MCP servers
Real-World Applications
The presenter shares examples of other Rust-based MCP servers they have built, including:
An "IM Policy Autopilot" MCP server that generates IAM policies based on code analysis
A "Grimmoire" MCP server that stores and retrieves useful code snippets
Key Takeaways
Rust provides a robust and performant foundation for building MCP servers, addressing the shortcomings of Python and other interpreted languages
The Rust MCP SDK (RMCP) simplifies the process of creating MCP servers by providing macros and abstractions
Integrating MCP servers with external resources like APIs and hardware devices is straightforward in Rust
Rust's tooling, like the just task runner and the MCP Inspector, facilitate development and testing of MCP servers
Your Digital Journey deserves a great story. Build one with us.