axum

Develop Rust HTTP APIs with Axum typed extractors and Tower middleware.

68|19|Updated Nov 21, 2025
One-click install
npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill axum-bobmatnyc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: axum
Source: https://github.com/bobmatnyc/claude-mpm-skills/tree/main/toolchains/rust/frameworks/axum
Command: npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill axum-bobmatnyc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the development of robust and production-ready web APIs using the Axum framework in Rust, addressing common challenges in routing, state management, middleware, and error handling.

Core Features & Use Cases

  • Type-Safe Routing: Define API endpoints with strongly typed handlers and extractors for requests and responses.
  • Composable Middleware: Integrate production-grade middleware for tracing, timeouts, CORS, and more using the Tower ecosystem.
  • Structured Error Handling: Implement consistent error mapping to HTTP responses.
  • Graceful Shutdown: Ensure applications can be terminated cleanly, draining in-flight requests.
  • Testable Handlers: Easily test API logic without needing a running server.
  • Use Case: Develop a microservice in Rust that exposes a REST API for user management, including features like authentication middleware, request logging, and proper error responses for invalid input.

Quick Start

Use the axum skill to create a minimal web server with a /health endpoint that returns 'ok'.

Frequently Asked Questions about axum

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a production-ready Rust API with typed extractors and middleware?

You can build a production Rust API using Axum by defining typed extractors for requests and composing Tower middleware for tracing, timeouts, and CORS to ensure robust service operation.

What is the best way to handle errors consistently in a Rust web service?

Structured error handling in Axum maps application errors directly to standard HTTP responses, ensuring consistent API behavior across all endpoints.

Does Axum work with Tokio and Tower for asynchronous web server operations?

Axum works with Tokio and Tower-http for asynchronous operations and middleware composition, enabling scalable and non-blocking web server performance.

How do I ensure a Rust HTTP server shuts down gracefully without dropping in-flight requests?

You ensure a Rust HTTP server shuts down gracefully by configuring the server to drain in-flight requests during termination, preventing data loss and ensuring clean exits.

Can I test Axum API handlers without starting a running web server?

Axum allows you to test API logic and handlers directly without needing a running server, simplifying unit testing for Rust web services.

How do I add authentication and request logging to a Rust microservice?

You add authentication and request logging to a Rust microservice by integrating composable Tower middleware within your Axum application to intercept and process HTTP requests.