RustAPI: Rust's Answer to FastAPI
It all started in December 2025 with one question: "Why has nobody done what FastAPI does, but in Rust?"
There actually was an answer. There's Axum, there's Actix, there's Poem. They're all good frameworks. But none of them had FastAPI's "it's right there under your fingers" ergonomics. None of them gave you that feeling of writing app.get("/") and having an endpoint in three lines. And more importantly, none of them treated the AI/LLM world as a first-class citizen.
So I built it.
The story
It was the last quarter of 2025. I had a ton of parallel projects going. Between Hyperembed's embedding inference engine and a few LLM tools, I noticed I kept writing the same thing over and over: HTTP endpoints. In every project I was defining routes, writing middleware and doing error handling from scratch. It was a toxic pattern: the exact opposite of DRY.
"Let me build it once and use it everywhere," I said. First commit: December 15, 2025. I named it RustAPI. Plain, descriptive, ambitious.
The first version was terrible. Only app.get() and app.post() worked. But they worked. And most importantly, Rust didn't have an API this simple.
What it does
RustAPI does in Rust what FastAPI does in Python. But with a few extra layers:
Macro-based route definitions. You write an attribute, and your function becomes an endpoint:
#[get("/hello/{name}")]
async fn hello(name: String) -> String {
format!("Hello, {}!", name)
}
Path parameters, query parameters, request body: all resolved automatically. If you're a FastAPI user, you'll feel right at home.
Native MCP (Model Context Protocol) support. This is the most interesting part. Every endpoint you write with RustAPI can automatically become an MCP tool. That means an AI agent can call your API directly. To do that:
#[get("/weather/{city}")]
#[mcp_tool(description = "Get weather for a city")]
async fn weather(city: String) -> Json<WeatherResponse> {
// ...
}
That's it. The #[mcp_tool] attribute turns your endpoint into a tool definition that follows Anthropic's MCP specification. Claude, GPT, Gemini: all of them can call this endpoint as if it were their own tool.
Let me explain how big a deal this is.
Agent-first API design
Until now, APIs were designed for humans. RESTful, well documented, fed with Swagger/OpenAPI. Developer experience came first.
But the world is changing. In 2026, the consumers of APIs aren't only humans anymore. AI agents call APIs too. And what an AI agent expects from an API is very different from what a human developer expects.
For a human developer: "Call this endpoint, add this header, parse the response." For an AI agent: "Tell me what it does, define the parameters, I'll call it."
The MCP support in RustAPI represents exactly this shift in mindset. Every endpoint is agent-readable from birth. Zero extra work. The moment you add #[mcp_tool], your endpoint lands in Claude's tool registry.
I call this "agent-first API design". And I think it'll be the biggest API trend of 2026-2027.
Technical details (for the curious)
A quick look at what's going on behind the scenes:
- HTTP layer: I wrote my own HTTP/1.1 implementation. Yes, from scratch. I didn't use
hyperoractix-http. The reason is simple: to zero out the dependency chain. Today RustAPI's total dependency count is incredibly low. That shortens compile times, shrinks the binary, and most importantly, I know how everything works. - MCP layer: Implements the MCP specification over JSON-RPC 2.0. Tool listing, tool calling, error handling: all spec-compliant.
- Permission scoping: The most critical feature that came with v0.1.508. Which agent can call which endpoint, and how often? Rate limiting? Scope restrictions? All configurable.
- Cloud CLI: You type
rustapi deployand your project goes live. The goal is to bring the Vercel model to the Rust ecosystem.
We're at v0.1.528 right now. 55+ GitHub stars, 3 forks. Those look like small numbers, but for a web framework in the Rust ecosystem that's not bad at all, especially in 7 months.
Performance
I'll keep it short. Benchmark results:
| Framework | Request/sec (hello world) | P99 latency |
|---|---|---|
| FastAPI (Python) | ~14,000 | ~8ms |
| Express (Node) | ~24,000 | ~5ms |
| Actix-web (Rust) | ~180,000 | ~0.6ms |
| RustAPI (Rust) | ~210,000 | ~0.5ms |
On the MCP invocation side it's even crazier: 28 microseconds. Yes, microseconds. Calling an MCP tool is faster than a Python function call.
These are "hello world" benchmarks. In the real world the gap gets even wider, because Rust's zero-cost abstractions are what really make the difference under real workloads.
Where is it going?
The roadmap is clear:
- RustAPI Cloud (Q3 2026): Managed hosting. Deployment in a single command with
rustapi deploy. Free tier + pro tier. The Rust version of Vercel. - MCP Gateway (Q4 2026): A gateway that gathers all your deployed APIs behind a single MCP endpoint. An AI agent will be able to reach hundreds of APIs from a single URL.
- Plugin ecosystem: Auth plugins, rate limiting, caching, monitoring. Open to community contributions.
- gRPC + WebSocket: Going beyond HTTP. Agents sometimes want streaming.
What I learned
Writing a web framework from scratch teaches you HTTP inside and out. Keep-alive connections, chunked transfer encoding, pipelined requests: you have to implement all of them. I could say reading RFCs ruined my eyesight.
But the biggest thing I learned is this: in Rust, ergonomics doesn't come at zero cost. Thanks to the macro system you can offer an API as clean as Python's, but behind the scenes everything is resolved statically. No runtime overhead. That's Rust's superpower.
The second big lesson: open source is like compound interest. For the first 3 months nobody looked at it. Then I wrote a blog post, shared it on Hacker News, and suddenly 30 stars came in. Now every week a few people open issues and send PRs. Slow, but steady growth.
Try it
cargo install rustapi
rustapi new my-project
cd my-project
rustapi dev
3 commands, 10 seconds. Then start building.
Website: rustapi.cloud GitHub: github.com/Tuntii/RustAPI Documentation: tuntii.github.io/RustAPI
If you write Rust and build APIs, give it a shot. If you don't like it, open an issue. I mean it, I try to implement every piece of feedback.
In the next post I'll talk about KayaDB: what it's like to write a distributed key-value store from scratch, implementing Raft consensus, Jepsen tests... That one's even crazier.