Axum

Ergonomic, modular async web framework for Rust built on Tokio, Tower, and Hyper. Routes handlers are async functions that use extractors to declaratively parse request parts (JSON body, path params, headers, query strings). Middleware via Tower's Service trait — leverages the entire Tower ecosystem. The most popular Rust web framework for building APIs and agent tool servers.

Evaluated Mar 06, 2026 (0d ago) v0.7.x
Homepage ↗ Repo ↗ Developer Tools axum rust web-framework api tokio async http rest
⚙ Agent Friendliness
66
/ 100
Can an agent use this?
🔒 Security
90
/ 100
Is it safe for agents?
⚡ Reliability
88
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
90
Error Messages
85
Auth Simplicity
92
Rate Limits
88

🔒 Security

TLS Enforcement
92
Auth Strength
90
Scope Granularity
88
Dep. Hygiene
92
Secret Handling
90

MIT licensed. Rust memory safety. TLS via rustls or native-tls. Tower middleware for rate limiting, auth. Tokio-rs maintained — high security bar.

⚡ Reliability

Uptime/SLA
100
Version Stability
82
Breaking Changes
78
Error Recovery
90
AF Security Reliability

Best When

You're building a high-performance Rust API service or tool server where type safety, async performance, and the Tokio/Tower ecosystem are priorities.

Avoid When

You're new to Rust or need full-stack templating. For prototyping, Actix-web may have more examples; for learning Rust, Rocket has more beginner-friendly ergonomics.

Use Cases

  • Build high-performance agent HTTP API servers in Rust with type-safe routing and request extraction
  • Create Rust-based MCP (Model Context Protocol) servers with async HTTP/WebSocket endpoints
  • Implement agent tool endpoints with automatic JSON parsing via axum::extract::Json<T> and Serde deserialization
  • Build microservices for agent systems requiring maximum throughput with minimal memory footprint
  • Develop WebSocket-based agent coordination servers using axum's native WebSocket upgrade support

Not For

  • Full-stack web development with templating and ORM — use a framework like Rails/Django for full-stack; Axum is API-first
  • Developers new to Rust — Axum's extractor pattern and tower middleware require intermediate Rust knowledge
  • GraphQL servers without extra crates — use async-graphql with axum integration for GraphQL support

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Framework for building APIs — auth is implemented by the developer via middleware. Tower middleware for JWT/session auth available.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

MIT licensed. Zero cost.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • Extractor rejection order matters — if extractors fail, Axum returns 400/422; implement IntoResponse for AppError enum to customize all error responses
  • State sharing: use axum::extract::State<Arc<AppState>> for shared state — not thread-local; state must be Clone + Send + Sync
  • Route layer vs router layer: router.layer() applies to ALL routes; router.route_layer() applies to matched routes only; wrong layering causes incorrect middleware behavior
  • Body extraction is exclusive — cannot extract Json<T> AND Form<T> from the same request; choose one or use Request<Body> for manual parsing
  • Path parameters: use axum::extract::Path<(String, u32)> for multiple path params or Path<HashMap<String, String>> for dynamic keys
  • WebSocket upgrade: use axum::extract::WebSocketUpgrade then .on_upgrade(|ws| async { ... }) — WebSocket handler runs as a separate async task

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Axum.

$99

Scores are editorial opinions as of 2026-03-06.

5215
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered