<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tunay</title>
    <description>The latest articles on DEV Community by Tunay (@tuntii).</description>
    <link>https://dev.to/tuntii</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1254758%2F4832dd73-7ced-4247-87e0-d77747193b0c.jpg</url>
      <title>DEV Community: Tunay</title>
      <link>https://dev.to/tuntii</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tuntii"/>
    <language>en</language>
    <item>
      <title>How RustAPI Turns Every Endpoint Into an AI Agent Tool In-Process, No Glue Code</title>
      <dc:creator>Tunay</dc:creator>
      <pubDate>Mon, 22 Jun 2026 11:10:45 +0000</pubDate>
      <link>https://dev.to/tuntii/how-rustapi-turns-every-endpoint-into-an-ai-agent-tool-in-process-no-glue-code-4k78</link>
      <guid>https://dev.to/tuntii/how-rustapi-turns-every-endpoint-into-an-ai-agent-tool-in-process-no-glue-code-4k78</guid>
      <description>&lt;p&gt;Picture this: you've built a solid REST API. FastAPI, Express, Go doesn't matter. It works. Then someone says "we need AI agents to use our API."&lt;/p&gt;

&lt;p&gt;Now you're writing a separate MCP server. Maintaining tool definitions that mirror your routes. Keeping schemas in sync. Debugging network timeouts between agent→proxy→API.&lt;/p&gt;

&lt;p&gt;What if your framework just... handled this?&lt;/p&gt;

&lt;h3&gt;
  
  
  MCP in 30 seconds
&lt;/h3&gt;

&lt;p&gt;Model Context Protocol (MCP) is how AI agents call external tools. Claude Desktop uses it. Cursor uses it. VS Code agents use it.&lt;/p&gt;

&lt;p&gt;An MCP tool has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A name and description&lt;/li&gt;
&lt;li&gt;An input schema (JSON Schema)&lt;/li&gt;
&lt;li&gt;A handler function&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's literally an API endpoint with an OpenAPI spec.&lt;/p&gt;

&lt;h3&gt;
  
  
  The RustAPI approach: automatic tool registration
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;rustapi_rs&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;prelude&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;rustapi_rs&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;protocol&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;mcp&lt;/span&gt;&lt;span class="p"&gt;::{&lt;/span&gt;&lt;span class="n"&gt;McpConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;InvocationMode&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nd"&gt;#[tokio::main]&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;RustApi&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="nf"&gt;.route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;get_weather&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;.route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;post_order&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// This single call:&lt;/span&gt;
    &lt;span class="c1"&gt;// 1. Reads the OpenAPI spec RustAPI auto-generates&lt;/span&gt;
    &lt;span class="c1"&gt;// 2. Creates MCP tool definitions for every route&lt;/span&gt;
    &lt;span class="c1"&gt;// 3. Wires handlers that dispatch through your middleware stack&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;mcp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;McpServer&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;from_rustapi&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nn"&gt;McpConfig&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="nf"&gt;.name&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"my-api"&lt;/span&gt;&lt;span class="nf"&gt;.into&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
            &lt;span class="nf"&gt;.invocation_mode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nn"&gt;InvocationMode&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;InProcess&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;mcp&lt;/span&gt;&lt;span class="nf"&gt;.serve_stdio&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="k"&gt;.await&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No manual tool registration. No schema duplication. Your endpoints &lt;em&gt;are&lt;/em&gt; the tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  Architecture: what happens on a tool call
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AI Agent
  → MCP Server (stdio/HTTP)
    → RequestInvoker (internal dispatch)
      → Router::dispatch()
        → LayerStack (auth, rate limit, logging, middleware)
          → Your handler function
      ← Response
    ← MCP tool result
  ← Agent sees result
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key: &lt;strong&gt;InProcess mode skips the network entirely&lt;/strong&gt;. The &lt;code&gt;RequestInvoker&lt;/code&gt; creates an internal request and dispatches it through the same Router that handles HTTP. Your middleware runs. Your interceptors fire. But no TCP socket. No serialization.&lt;/p&gt;

&lt;h3&gt;
  
  
  Benchmark reality check
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0iop9fs6r7wazzg8t5uk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0iop9fs6r7wazzg8t5uk.jpg" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Test: 1000 sequential MCP tool calls&lt;/span&gt;
&lt;span class="c1"&gt;// RustAPI 0.1.507, Intel i7-12700H, Windows 11&lt;/span&gt;

&lt;span class="n"&gt;InProcess&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;   &lt;span class="mf"&gt;27.9&lt;/span&gt; &lt;span class="n"&gt;µs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nf"&gt;call&lt;/span&gt;  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;35&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;842&lt;/span&gt; &lt;span class="n"&gt;calls&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;sec&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;Proxy&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;     &lt;span class="mf"&gt;1350.0&lt;/span&gt; &lt;span class="n"&gt;µs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nf"&gt;call&lt;/span&gt;  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;741&lt;/span&gt; &lt;span class="n"&gt;calls&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;sec&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                     &lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="n"&gt;faster&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why does this matter? An agent making 20 tool calls per user query with proxy mode = 27ms overhead. With InProcess = 0.5ms. That's the difference between "snappy" and "loading..."&lt;/p&gt;

&lt;h3&gt;
  
  
  The CLI: your existing API just got MCP powers
&lt;/h3&gt;

&lt;p&gt;Not using RustAPI? The CLI bridges that gap:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install&lt;/span&gt;
cargo &lt;span class="nb"&gt;install &lt;/span&gt;cargo-rustapi &lt;span class="nt"&gt;--features&lt;/span&gt; mcp

&lt;span class="c"&gt;# From any OpenAPI spec (FastAPI, Express, Go anything with OpenAPI)&lt;/span&gt;
rustapi mcp generate &lt;span class="nt"&gt;--spec&lt;/span&gt; ./openapi.json

&lt;span class="c"&gt;# Results:&lt;/span&gt;
&lt;span class="c"&gt;# ✓ Generated MCP tools: getWeather, postOrder, listProducts&lt;/span&gt;
&lt;span class="c"&gt;# ✓ Server running on http://localhost:9090&lt;/span&gt;
&lt;span class="c"&gt;# ✓ Connect Claude Desktop to http://localhost:9090/sse&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Under the hood, it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Parses the OpenAPI spec (tolerant of partial/incomplete specs)&lt;/li&gt;
&lt;li&gt;Maps HTTP methods + paths → MCP tool names&lt;/li&gt;
&lt;li&gt;Maps parameter schemas → MCP input schemas&lt;/li&gt;
&lt;li&gt;Generates proxy handlers that call your real API&lt;/li&gt;
&lt;li&gt;Spins up a fully typed MCP server&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This works with &lt;strong&gt;any API that has an OpenAPI spec&lt;/strong&gt;. FastAPI, Express, Go, Python doesn't matter.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why stdio transport matters
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rustapi mcp generate &lt;span class="nt"&gt;--spec&lt;/span&gt; openapi.json &lt;span class="nt"&gt;--stdio&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Stdio is the native transport for desktop AI clients. Claude Desktop reads MCP server configs and spawns processes. Your API becomes a first-class tool in the desktop agent's arsenal no HTTP server, no port conflicts, no CORS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Putting it all together: a full example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;rustapi_rs&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;prelude&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;rustapi_rs&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;protocol&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;mcp&lt;/span&gt;&lt;span class="p"&gt;::{&lt;/span&gt;&lt;span class="n"&gt;McpServer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;McpConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;InvocationMode&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;serde&lt;/span&gt;&lt;span class="p"&gt;::{&lt;/span&gt;&lt;span class="n"&gt;Deserialize&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Serialize&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nd"&gt;#[derive(Debug,&lt;/span&gt; &lt;span class="nd"&gt;Serialize,&lt;/span&gt; &lt;span class="nd"&gt;Deserialize)]&lt;/span&gt;
&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;Weather&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;temp_c&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;f64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;humidity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="cd"&gt;/// Get current weather for a city&lt;/span&gt;
&lt;span class="nd"&gt;#[get(&lt;/span&gt;&lt;span class="s"&gt;"/weather/{city}"&lt;/span&gt;&lt;span class="nd"&gt;)]&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;get_weather&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Path&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Json&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Weather&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Error&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Real app: call weather API, query DB, etc.&lt;/span&gt;
    &lt;span class="nf"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;Json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Weather&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="nf"&gt;.into_inner&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="n"&gt;temp_c&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;22.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;humidity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;65&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}))&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="cd"&gt;/// Create a new order&lt;/span&gt;
&lt;span class="nd"&gt;#[post(&lt;/span&gt;&lt;span class="s"&gt;"/orders"&lt;/span&gt;&lt;span class="nd"&gt;)]&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;create_order&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Json&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;CreateOrderRequest&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Json&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Order&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Error&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ... order logic&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nd"&gt;#[tokio::main]&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;RustApi&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="nf"&gt;.route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;get_weather&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;.route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;create_order&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Auto-generate MCP tools from routes&lt;/span&gt;
    &lt;span class="c1"&gt;// get_weather → MCP tool "getWeather" with {city: string} input&lt;/span&gt;
    &lt;span class="c1"&gt;// create_order → MCP tool "createOrder" with full request schema&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;mcp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;McpServer&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;from_rustapi&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nn"&gt;McpConfig&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="nf"&gt;.name&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"my-api"&lt;/span&gt;&lt;span class="nf"&gt;.into&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
            &lt;span class="nf"&gt;.invocation_mode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nn"&gt;InvocationMode&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Auto&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// InProcess if possible&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Serve via stdio for Claude Desktop integration&lt;/span&gt;
    &lt;span class="n"&gt;mcp&lt;/span&gt;&lt;span class="nf"&gt;.serve_stdio&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="k"&gt;.await&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The doc comment on &lt;code&gt;get_weather&lt;/code&gt; becomes the MCP tool description. The &lt;code&gt;Path&amp;lt;String&amp;gt;&lt;/code&gt; becomes the input schema. The return type determines the output. Zero additional code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Real-world impact
&lt;/h3&gt;

&lt;p&gt;Alexa (&lt;a class="mentioned-user" href="https://dev.to/alexabelonix"&gt;@alexabelonix&lt;/a&gt;, AI Distribution &amp;amp; Sales) put it best after trying the release:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"this just made AI agents way more useful"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Because right now, connecting agents to real APIs is the bottleneck. Every company building AI agents is building the same MCP glue. RustAPI removes that step entirely.&lt;/p&gt;

&lt;h3&gt;
  
  
  What's next
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;MCP Gateway&lt;/strong&gt;: One endpoint that exposes all deployed RustAPI apps as MCP tools a unified agent interface&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RustAPI Cloud&lt;/strong&gt;: &lt;code&gt;rustapi deploy&lt;/code&gt; → your API is live + MCP-toolable at &lt;code&gt;you.rustapi.dev&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Streaming tool results&lt;/strong&gt;: Long-running tools with progress updates for agents&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The bet
&lt;/h3&gt;

&lt;p&gt;Within 2 years, "MCP-native" will be as expected as "REST API" is today. Frameworks that don't include it will feel broken. AI agents aren't a fad — they're a new consumer of APIs, just like browsers were in 1995 and mobile apps were in 2008.&lt;/p&gt;

&lt;p&gt;RustAPI is built for that world.&lt;/p&gt;

&lt;h3&gt;
  
  
  Try it
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo add rustapi-rs &lt;span class="nt"&gt;--features&lt;/span&gt; protocol-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or use the CLI on any existing API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;cargo-rustapi &lt;span class="nt"&gt;--features&lt;/span&gt; mcp
rustapi mcp generate &lt;span class="nt"&gt;--spec&lt;/span&gt; ./your-openapi.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Tuntii/RustAPI" rel="noopener noreferrer"&gt;Tuntii/RustAPI&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Docs:&lt;/strong&gt; &lt;a href="https://tuntii.github.io/RustAPI" rel="noopener noreferrer"&gt;tuntii.github.io/RustAPI&lt;/a&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>ai</category>
      <category>mcp</category>
      <category>api</category>
    </item>
    <item>
      <title>Framework Yorgunluğu ve RustAPI'nin Doğuşu: Geliştirici Deneyimini (DX) Geri Kazanmak</title>
      <dc:creator>Tunay</dc:creator>
      <pubDate>Mon, 19 Jan 2026 23:55:22 +0000</pubDate>
      <link>https://dev.to/tuntii/framework-yorgunlugu-ve-rustapinin-dogusu-gelistirici-deneyimini-dx-geri-kazanmak-499l</link>
      <guid>https://dev.to/tuntii/framework-yorgunlugu-ve-rustapinin-dogusu-gelistirici-deneyimini-dx-geri-kazanmak-499l</guid>
      <description>&lt;h1&gt;
  
  
  Framework Yorgunluğu ve RustAPI'nin Doğuşu: Geliştirici Deneyimini (DX) Geri Kazanmak
&lt;/h1&gt;

&lt;p&gt;Yazılım dünyasında sıkça duyduğumuz bir terim var: &lt;strong&gt;Framework Yorgunluğu&lt;/strong&gt;. Sürekli yeni bir araç öğrenmek zorunda kalmak bir yana, mevcut araçların karmaşıklığı, versiyon güncellemeleriyle kırılan kodlar ve "basit" bir API ayağa kaldırmak için harcanan saatler geliştiricileri tükenme noktasına getirebiliyor. Özellikle Rust ekosisteminde, performans muazzam olsa da, parçaları birleştirmek (routing, dokümantasyon, doğrulama vb.) bazen bir yapbozu tamamlamaya benziyor.&lt;/p&gt;

&lt;p&gt;İşte &lt;strong&gt;RustAPI&lt;/strong&gt;, tam olarak bu karmaşaya ve yorgunluğa bir tepki olarak doğdu. Peki, RustAPI'yi diğerlerinden ayıran felsefe ne?&lt;/p&gt;

&lt;h3&gt;
  
  
  1. İstikrar Arayışı: Facade Mimarisi
&lt;/h3&gt;

&lt;p&gt;Geliştiricileri en çok yoran durumlardan biri, altyapıdaki kütüphanelerin (örneğin &lt;code&gt;hyper&lt;/code&gt; veya &lt;code&gt;tokio&lt;/code&gt;) güncellenmesiyle uygulamanın çalışmaz hale gelmesidir. RustAPI'nin doğuşundaki temel vizyon şudur: &lt;strong&gt;"API yüzeyi bizimdir, motorlar değişebilir."&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;RustAPI, "Facade Architecture" (Ön Yüz Mimarisi) kullanır. Bu sayede siz &lt;code&gt;rustapi-rs&lt;/code&gt; ile kod yazarsınız ve arkada kullanılan motorlar (&lt;code&gt;hyper&lt;/code&gt;, &lt;code&gt;tokio&lt;/code&gt;, &lt;code&gt;validator&lt;/code&gt;) değişse veya güncellense bile sizin kodunuz kırılmaz,. Örneğin &lt;code&gt;hyper 2.0&lt;/code&gt; çıktığında framework kendi çekirdeğini günceller ama sizin &lt;code&gt;RustApi::new()&lt;/code&gt; kodunuz çalışmaya devam eder. Bu, geliştiricideki "bakım yükü" stresini ortadan kaldırır.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. "Piller Dahil" (Batteries Included) Felsefesi
&lt;/h3&gt;

&lt;p&gt;Modern bir API yazmak için sadece bir router yetmez. JWT, CORS, Rate Limiting, OpenAPI dokümantasyonu gibi parçalara ihtiyacınız vardır. Diğer frameworklerde (örneğin Axum veya Actix-web) bu parçaları tek tek bulup entegre etmeniz ve uyumlu çalıştırmanız gerekirken, RustAPI bu yorgunluğu bitirmeyi hedefler.&lt;/p&gt;

&lt;p&gt;RustAPI; JWT, CORS, Rate Limiting ve en önemlisi &lt;strong&gt;otomatik OpenAPI (Swagger)&lt;/strong&gt; desteğini yerleşik olarak sunar,. Sadece 5 satır kod ile çalışan, dokümantasyonu hazır bir REST endpoint'i oluşturabilirsiniz. Bu, Python dünyasındaki &lt;strong&gt;FastAPI&lt;/strong&gt; ergonomisinin Rust performansıyla buluşmasıdır.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Yapay Zeka ve LLM Çağına Hazırlık
&lt;/h3&gt;

&lt;p&gt;RustAPI'nin doğuşunun bir diğer önemli sebebi de, API geliştirme süreçlerinin artık Yapay Zeka (AI) çağına evrilmesidir. Geleneksel JSON formatı, LLM (Büyük Dil Modelleri) ile iletişimde token maliyetlerini artırabilir.&lt;/p&gt;

&lt;p&gt;RustAPI, bu soruna çözüm olarak &lt;strong&gt;TOON (Token-Oriented Object Notation)&lt;/strong&gt; formatını sunar. Bu format, JSON'a kıyasla &lt;strong&gt;%50-58 oranında token tasarrufu&lt;/strong&gt; sağlar,. MCP (Model Context Protocol) sunucuları ve AI ajanları için optimize edilmiş olması, onu sadece bugünün değil, geleceğin ihtiyaçları için tasarlanmış bir framework yapar.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Performanstan Ödün Vermeden Ergonomi
&lt;/h3&gt;

&lt;p&gt;Genellikle kullanım kolaylığı (ergonomi) arttıkça performans düşer. Python'un FastAPI'si çok kolaydır ancak yavaştır. RustAPI ise bu denklemi bozar. &lt;code&gt;simd-json&lt;/code&gt; ve &lt;code&gt;tokio&lt;/code&gt; üzerine kurulu yapısıyla saniyede ~185.000 - 220.000 istek karşılayabilir. Bu, geliştiricinin "kolay yazayım ama yavaş olsun" ya da "hızlı olsun ama yazması zor olsun" ikilemi arasında kalmasını engeller.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sonuç: Neden RustAPI?
&lt;/h3&gt;

&lt;p&gt;RustAPI, geliştiricilerin boğuştuğu "trait bound" hatalarına, manuel dokümantasyon yazma zorunluluğuna ve versiyon uyumsuzluklarına bir son vermek için doğmuştur. Eğer siz de frameworklerin konfigürasyonlarıyla uğraşmaktan yorulduysanız ve sadece iş mantığınıza odaklanmak istiyorsanız, RustAPI'nin sunduğu modern geliştirici deneyimine (DX) bir şans vermelisiniz.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Kaynaklar:&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Tuntii/RustAPI&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>ai</category>
      <category>rust</category>
    </item>
  </channel>
</rss>
