Skip to content

Production Rust API patterns for Axum: typed extractors, shared state, Tower middleware, error mapping, and graceful shutdown.

CCM score
59 of 100
skills.sh installs
517
GitHub stars
79
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers routing, extractors, shared state, structured errors, middleware, tracing, graceful shutdown, and testing for Rust HTTP services
  • Includes examples for typed Path, Query, and Json extraction, AppError mapping via IntoResponse, and tower-http layers for tracing, timeouts, and CORS
  • Enforces non-blocking handlers and isolates the HTTP stack behind an optional feature so library consumers avoid the web dependencies
  • Designed for teams building Rust HTTP services that need supervised shutdown with systemd or launchd and router tests without sockets

Install

$ npx -y skills add bobmatnyc/claude-mpm-skills --skill axum -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Axum (Rust) - Production Web APIs

Overview

Axum is a Rust web framework built on Hyper and Tower. Use it for type-safe request handling with composable middleware, structured errors, and excellent testability.

Quick Start

Minimal server

✅ Correct: typed handler + JSON response

use axum::{routing::get, Json, Router};
use serde::Serialize;
use std::net::SocketAddr;

#[derive(Serialize)]
struct Health {
    status: &'static str,
}

async fn health() -> Json<Health> {
    Json(Health { status: "ok" })
}

#[tokio::main]
async fn main() {
    let app = Router::new().route("/health", get(health));

    let addr: SocketAddr = "0.0.0.0:3000".parse().unwrap();
    let listener = tokio::net::TcpListener::bind(addr).await.unwrap();
    axum::serve(listener, app).await.unwrap();
}

❌ Wrong: block the async runtime

async fn handler() {
    std::thread::sleep(std::time::Duration::from_secs(1)); // blocks executor
}

Core Concepts

Router + handlers

Handlers are async functions that return something implementing IntoResponse.

✅ Correct: route nesting

use axum::{routing::get, Router};

Details

Repository
github.com/bobmatnyc/claude-mpm-skills
Categories
Rust, Backend & APIs
First seen
Jun 3, 2026

Questions

Where does the axum skill rank among Rust skills on Claude Marketplaces?

The axum skill is in the Rust category on Claude Marketplaces and ranks in the top 100 on the Rust category page. It is listed alongside fix-errors, rust-best-practices, rust-async-patterns, rust-testing and rust-patterns, and it covers Axum routers, extractors, state, middleware, error handling, tracing, graceful shutdown and testing.

What does the axum skill help an agent build?

The axum skill gives patterns for production Rust HTTP APIs built on Axum. It covers typed handlers and extractors, shared AppState, structured error handling with IntoResponse, Tower middleware such as tracing, timeouts and CORS, graceful shutdown, and testing routers without sockets.

How do I install the axum skill?

Run npx -y skills add bobmatnyc/claude-mpm-skills --skill axum -y inside your project. After that, the agent can apply Axum patterns such as typed extractors, Tower layers and graceful shutdown when you build a Rust web service.

More from bobmatnyc/claude-mpm-skills

All 154

Similar to Axum

More Rust