<?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: Mockd</title>
    <description>The latest articles on DEV Community by Mockd (@mockd).</description>
    <link>https://dev.to/mockd</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3726951%2F29377b86-3208-4af1-b97a-74b31fd1e4b9.png</url>
      <title>DEV Community: Mockd</title>
      <link>https://dev.to/mockd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mockd"/>
    <language>en</language>
    <item>
      <title>Give Your AI Agent a Mock Server: mockd as an MCP Tool</title>
      <dc:creator>Mockd</dc:creator>
      <pubDate>Sun, 29 Mar 2026 20:58:07 +0000</pubDate>
      <link>https://dev.to/mockd/give-your-ai-agent-a-mock-server-mockd-as-an-mcp-tool-844</link>
      <guid>https://dev.to/mockd/give-your-ai-agent-a-mock-server-mockd-as-an-mcp-tool-844</guid>
      <description>&lt;p&gt;Here's a scene that plays out a dozen times a day if you use an AI coding agent: you ask it to build something that calls an external API — a payment service, a notification system, an OAuth flow — and it writes beautiful code. Clean types, proper error handling, good structure. Then it stops. It can't actually run any of it, because the API it's calling doesn't exist locally and the agent has no way to spin one up.&lt;/p&gt;

&lt;p&gt;So you get code that &lt;em&gt;looks&lt;/em&gt; right but hasn't been tested against anything. The agent wrote a Stripe integration without ever seeing a Stripe response. It built a webhook handler without ever receiving a webhook. You're the one who has to close that gap, manually, every time.&lt;/p&gt;

&lt;p&gt;I kept hitting this wall, and it's the reason mockd ships with 18 MCP tools built in.&lt;/p&gt;

&lt;h2&gt;
  
  
  What MCP gives your agent
&lt;/h2&gt;

&lt;p&gt;MCP — Model Context Protocol — is the standard that lets AI agents call external tools programmatically. Instead of just reading and writing files, your agent can interact with services, APIs, and infrastructure through a structured interface.&lt;/p&gt;

&lt;p&gt;mockd implements an MCP server that exposes everything an agent needs to create mock endpoints, send test traffic, inspect request logs, verify call counts, and inject failure conditions. All over stdio, no API keys required for local use.&lt;/p&gt;

&lt;p&gt;The agent doesn't just develop &lt;em&gt;against&lt;/em&gt; a mock server. It provisions and manages the mock server itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup: two minutes, zero config
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Claude Code
&lt;/h3&gt;

&lt;p&gt;Add this to your Claude Code MCP configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"mockd"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"mockd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"mcp"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Cursor
&lt;/h3&gt;

&lt;p&gt;In Cursor's MCP settings (Settings → MCP Servers), add the same configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"mockd"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"mockd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"mcp"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works with any MCP-compatible agent — Claude Code, Cursor, GitHub Copilot, Windsurf, JetBrains AI. The &lt;code&gt;mockd mcp&lt;/code&gt; command speaks standard MCP over stdio, so anything that implements the protocol can use it.&lt;/p&gt;

&lt;p&gt;One detail worth calling out: &lt;code&gt;mockd mcp&lt;/code&gt; automatically starts a background daemon if one isn't already running. You don't need to manually run &lt;code&gt;mockd start&lt;/code&gt; first. The agent connects, mockd boots up on port 4280 (mock server) and 4290 (admin API), and everything just works. Pass &lt;code&gt;--data-dir&lt;/code&gt; if you want project-level isolation between different codebases.&lt;/p&gt;

&lt;h2&gt;
  
  
  A real workflow: "Build me a payment service"
&lt;/h2&gt;

&lt;p&gt;Here's what actually happens when you ask an agent to build something against an external API, with mockd connected as an MCP tool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You:&lt;/strong&gt; "Build a payment service that integrates with Stripe. It should create charges, handle webhooks, and refund failed payments."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The agent's first move&lt;/strong&gt; isn't writing application code. It calls &lt;code&gt;manage_mock&lt;/code&gt; to create the Stripe endpoints it knows it'll need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;POST /v1/charges&lt;/code&gt; → returns a charge object with &lt;code&gt;status: "succeeded"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;POST /v1/refunds&lt;/code&gt; → returns a refund object&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GET /v1/charges/:id&lt;/code&gt; → returns charge details&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;POST /webhook&lt;/code&gt; → a local endpoint for receiving Stripe events&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each mock returns realistic response structures — the agent knows what Stripe responses look like and configures the mocks accordingly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Then it writes the application code.&lt;/strong&gt; The payment service, the webhook handler, the refund logic. But here's the key difference: it can test every function as it writes it. The code hits &lt;code&gt;http://localhost:4280/v1/charges&lt;/code&gt;, gets back a real HTTP response with a real JSON body, and the agent can verify the code actually works.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After writing the code&lt;/strong&gt;, the agent calls &lt;code&gt;verify_mock&lt;/code&gt; to check that the right endpoints were called the expected number of times. It calls &lt;code&gt;get_mock_invocations&lt;/code&gt; to inspect the exact request bodies its code sent. It finds a bug — the refund handler is sending &lt;code&gt;charge_id&lt;/code&gt; instead of &lt;code&gt;charge&lt;/code&gt; in the request body — fixes it, and tests again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Then it pushes further.&lt;/strong&gt; It calls &lt;code&gt;set_chaos_config&lt;/code&gt; to inject intermittent 500 errors on the charge endpoint, reruns the payment flow, and discovers the retry logic doesn't handle idempotency keys correctly. It fixes that too.&lt;/p&gt;

&lt;p&gt;The agent just completed a development loop that would normally require you to set up a Stripe test account, manage API keys, deal with rate limits, and manually inspect webhook payloads. Instead, it did the whole thing itself in a few minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tools that matter most
&lt;/h2&gt;

&lt;p&gt;mockd exposes 18 MCP tools total. You don't need to memorize them — the agent discovers them automatically through the MCP protocol. But these are the ones that get used constantly:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;manage_mock&lt;/code&gt;&lt;/strong&gt; — The workhorse. Create, list, get, update, delete, and toggle mock endpoints. This is how the agent builds out the API surface it needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;verify_mock&lt;/code&gt;&lt;/strong&gt; — Assert that a mock was called a specific number of times. The agent uses this to confirm its code is actually making the requests it should be.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;get_mock_invocations&lt;/code&gt;&lt;/strong&gt; — Retrieve the full request details for every call that hit a specific mock — headers, body, query parameters, timestamps. This is how the agent debugs what its code is actually sending.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;get_request_logs&lt;/code&gt;&lt;/strong&gt; — View all traffic that hit the mock server, not just matched requests. Useful when the agent's code is calling an endpoint that doesn't have a mock yet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;set_chaos_config&lt;/code&gt;&lt;/strong&gt; — Inject latency, errors, and connection failures. The agent uses this to test its own error handling and retry logic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;manage_state&lt;/code&gt;&lt;/strong&gt; — Create, read, update, and delete stateful resources. When the agent needs a mock that remembers data between requests — like a user record that persists after creation — this is how.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;import_mocks&lt;/code&gt;&lt;/strong&gt; — Import mock endpoints from an OpenAPI spec, Postman collection, or other formats. If the API the agent is integrating with has a spec, this bootstraps the entire mock surface in one call.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources: read-only context for the agent
&lt;/h2&gt;

&lt;p&gt;Beyond tools, mockd also exposes MCP resources — read-only data the agent can access for context. There are 5 static resource URIs (&lt;code&gt;mock://config&lt;/code&gt;, &lt;code&gt;mock://mocks&lt;/code&gt;, &lt;code&gt;mock://logs&lt;/code&gt;, &lt;code&gt;mock://state&lt;/code&gt;, &lt;code&gt;mock://chaos&lt;/code&gt;) and 8 dynamic resource patterns for drilling into specific mocks, invocations, and state entries.&lt;/p&gt;

&lt;p&gt;In practice, the agent uses resources to understand the current state of the mock server before making changes. It reads &lt;code&gt;mock://mocks&lt;/code&gt; to see what's already configured, checks &lt;code&gt;mock://logs&lt;/code&gt; to see recent traffic, and uses that context to make informed decisions about what to create or modify next.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this changes the development loop
&lt;/h2&gt;

&lt;p&gt;The fundamental shift is that your AI agent can now iterate on code &lt;em&gt;and&lt;/em&gt; its test environment simultaneously. It's not writing code in a vacuum and hoping it works when it hits a real service. It's running a full development loop — write, test, inspect, fix, test again — with a real HTTP server returning real responses.&lt;/p&gt;

&lt;p&gt;No rate limits. No API keys. No cost per request. No dependency on staging environments that might be down. No "works on my machine but I can't test the integration" gaps.&lt;/p&gt;

&lt;p&gt;The agent gets real HTTP responses, not simulated ones. The code it writes has been tested against actual network calls. When you review the PR, the integration code has already been through dozens of iteration cycles against a mock that behaves like the real thing.&lt;/p&gt;

&lt;p&gt;That's the gap I kept running into, and it's the gap that disappears when your agent has a mock server it controls.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to know
&lt;/h2&gt;

&lt;p&gt;The MCP transport is stdio only right now — local use. There's no remote or SSE transport, so this is a "your machine, your agent" setup. If you're hoping to share a mock server across a team via MCP, that's not how it works yet. The agent also can't change server configuration through MCP. It can create and manage mocks all day, but things like port numbers, TLS settings, and server-level config still require CLI flags or a config file. That's a deliberate boundary, not an oversight.&lt;/p&gt;

&lt;p&gt;MCP tool responses can get chatty. If your agent has a small context window and you've got fifty mocks configured, calling &lt;code&gt;manage_mock&lt;/code&gt; with &lt;code&gt;action: "list"&lt;/code&gt; is going to eat a chunk of that context. Something to keep in mind if you're working with a constrained model. Trim your mocks or use targeted &lt;code&gt;get&lt;/code&gt; calls instead of listing everything.&lt;/p&gt;

&lt;p&gt;One more thing: &lt;code&gt;mockd mcp&lt;/code&gt; auto-starts a background daemon, which is convenient right up until you forget it's running. The daemon doesn't shut down when the MCP session ends. You'll want to run &lt;code&gt;mockd stop&lt;/code&gt; when you're done, or you'll find port 4280 still occupied next time you try to start something else there. Ask me how I know.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get started
&lt;/h2&gt;

&lt;p&gt;Install mockd, add the MCP config to your agent, and point it at a project that talks to external APIs. The agent will figure out the rest.&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 mockd&lt;/span&gt;
curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://get.mockd.io | sh

&lt;span class="c"&gt;# Start mockd — the MCP server auto-connects to this&lt;/span&gt;
mockd start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For detailed setup instructions, tool reference, and advanced configuration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://docs.mockd.io/guides/mcp-server/" rel="noopener noreferrer"&gt;MCP Server Guide&lt;/a&gt;&lt;/strong&gt; — Setup, tool reference, and resource URIs for all 18 MCP tools&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://mockd.io/blog/why-ai-agents-need-mock-servers?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=mock-server-as-mcp-tool" rel="noopener noreferrer"&gt;Why AI Agents Need Mock Servers&lt;/a&gt;&lt;/strong&gt; — The broader case for mock infrastructure in AI development&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>opensource</category>
    </item>
    <item>
      <title>7 Protocols, 1 Binary, 0 Dependencies</title>
      <dc:creator>Mockd</dc:creator>
      <pubDate>Sat, 28 Mar 2026 20:33:04 +0000</pubDate>
      <link>https://dev.to/mockd/7-protocols-1-binary-0-dependencies-1ana</link>
      <guid>https://dev.to/mockd/7-protocols-1-binary-0-dependencies-1ana</guid>
      <description>&lt;p&gt;Last year I counted the mock tools running on my laptop. WireMock for HTTP (Java, 200MB Docker image). A custom Node script for WebSocket. Mosquitto for MQTT. A Go stub for gRPC. Four tools, four runtimes, four sets of config files, four ports to remember. I spent more time wiring up mock infrastructure than writing the code it was supposed to help me test.&lt;/p&gt;

&lt;p&gt;So I built mockd. One binary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mockd add http &lt;span class="nt"&gt;--path&lt;/span&gt; /api/orders &lt;span class="nt"&gt;--status&lt;/span&gt; 200 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--body&lt;/span&gt; &lt;span class="s1"&gt;'{"orders": [{"id": "{{uuid}}", "total": {{faker.price}}}]}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Created mock: http_c9e4c315168bcfbe / Type: http / Method: GET / Path: /api/orders / Status: 200
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl http://localhost:4280/api/orders
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"orders"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"7e53e8ca-..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"total"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;405.87&lt;/span&gt;&lt;span class="p"&gt;}]}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;HTTP done. Same binary, six more protocols to go.&lt;/p&gt;

&lt;h2&gt;
  
  
  All 7 protocols
&lt;/h2&gt;

&lt;p&gt;Every protocol follows the same pattern: &lt;code&gt;mockd add &amp;lt;type&amp;gt;&lt;/code&gt;, configure, hit the endpoint. No plugins. No extensions. No separate downloads.&lt;/p&gt;

&lt;h3&gt;
  
  
  GraphQL
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mockd add graphql &lt;span class="nt"&gt;--path&lt;/span&gt; /graphql &lt;span class="nt"&gt;--operation&lt;/span&gt; GetUser &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--response&lt;/span&gt; &lt;span class="s1"&gt;'{"id":"1","name":"{{faker.name}}","email":"{{faker.email}}"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Test it: &lt;code&gt;curl -X POST http://localhost:4280/graphql -H 'Content-Type: application/json' -d '{"query":"{ GetUser }"}'&lt;/code&gt; returns &lt;code&gt;{"data":{"GetUser":{"email":"alice684@mock.io","id":"1","name":"Charlie Brown"}}}&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  gRPC
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mockd add grpc &lt;span class="nt"&gt;--proto&lt;/span&gt; service.proto &lt;span class="nt"&gt;--service&lt;/span&gt; greeter.Greeter &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--rpc-method&lt;/span&gt; SayHello &lt;span class="nt"&gt;--response&lt;/span&gt; &lt;span class="s1"&gt;'{"message": "Hello, {{faker.name}}!"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You provide the &lt;code&gt;.proto&lt;/code&gt; file, mockd handles reflection and serialization. Port 50051 by default.&lt;/p&gt;

&lt;h3&gt;
  
  
  WebSocket
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mockd add websocket &lt;span class="nt"&gt;--path&lt;/span&gt; /ws/chat &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--message&lt;/span&gt; &lt;span class="s1"&gt;'{"event":"connected","ts":"{{now}}"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  MQTT
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mockd add mqtt &lt;span class="nt"&gt;--topic&lt;/span&gt; sensors/temp &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--payload&lt;/span&gt; &lt;span class="s1"&gt;'{"temp":{{random.float 20.0 35.0}},"unit":"C","ts":"{{now}}"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Built-in MQTT broker on port 1883. No Mosquitto required.&lt;/p&gt;

&lt;h3&gt;
  
  
  SSE (Server-Sent Events)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mockd add http &lt;span class="nt"&gt;--path&lt;/span&gt; /events &lt;span class="nt"&gt;--sse&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--sse-event&lt;/span&gt; &lt;span class="s1"&gt;'update:{"ts":"{{now}}","cpu":{{random.int 10 95}}}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;curl -N http://localhost:4280/events&lt;/code&gt; streams &lt;code&gt;event:update&lt;/code&gt; / &lt;code&gt;data:{"ts":"2026-03-07T18:26:03-06:00","cpu":70}&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  SOAP
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mockd add soap &lt;span class="nt"&gt;--path&lt;/span&gt; /service &lt;span class="nt"&gt;--operation&lt;/span&gt; GetUser &lt;span class="nt"&gt;--status&lt;/span&gt; 200 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--response&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;User&amp;gt;&amp;lt;Id&amp;gt;1&amp;lt;/Id&amp;gt;&amp;lt;Name&amp;gt;{{faker.name}}&amp;lt;/Name&amp;gt;&amp;lt;/User&amp;gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Send a SOAP envelope with &lt;code&gt;SOAPAction: GetUser&lt;/code&gt;, get back a properly wrapped response.&lt;/p&gt;

&lt;h3&gt;
  
  
  All together
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ID                    TYPE       PATH             METHOD  STATUS  ENABLED
list-users            http       /api/users       GET     200     true
graphql_917e99253...  graphql    /graphql         GQL     -       true
websocket_91720db...  websocket  /ws/chat         WS      -       true
mqtt_4c28d4810103...  mqtt       :1883            MQTT    -       true
http_32897b6a3bd8...  http       /events          GET     -       true
soap_edc045dfba00...  soap       /service         SOAP    -       true
grpc_7a2ea7f56902...  grpc       :50051           gRPC    -       true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Seven protocols. One process. One config file. One set of logs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Go, why single binary
&lt;/h2&gt;

&lt;p&gt;I get asked this a lot. Go was chosen for three reasons:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Static binary.&lt;/strong&gt; &lt;code&gt;CGO_ENABLED=0 go build&lt;/code&gt; produces a single statically-linked executable. No shared libraries, no runtime, no interpreter. Copy it to any Linux/macOS/Windows machine and it runs. Docker image is &lt;code&gt;distroless/static&lt;/code&gt; — no shell, no libc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Goroutines.&lt;/strong&gt; Each protocol listener runs in its own goroutine. HTTP, gRPC, MQTT, WebSocket — same process, none blocking each other. In Node that's clustering. In Java it's thread pools. In Go it's &lt;code&gt;go serve()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cross-compilation.&lt;/strong&gt; &lt;code&gt;GOOS=darwin GOARCH=arm64 go build&lt;/code&gt; from a Linux CI runner. Mockd ships six OS/arch binaries from a single GitHub Actions workflow.&lt;/p&gt;

&lt;p&gt;The result is a 43MB binary containing all seven protocol servers, 34 faker functions, an admin API, and a request logger. No runtime to download. No plugins to install.&lt;/p&gt;

&lt;p&gt;That matters in three places: &lt;strong&gt;CI/CD&lt;/strong&gt; (&lt;code&gt;curl -fsSL https://get.mockd.io | sh &amp;amp;&amp;amp; mockd start&lt;/code&gt; — two seconds vs. pulling a 200MB Docker image), &lt;strong&gt;laptop onboarding&lt;/strong&gt; ("install mockd" vs. "install Java 17 and Docker Desktop"), and &lt;strong&gt;air-gapped networks&lt;/strong&gt; (a single binary can be SCP'd to a bastion host — try that with &lt;code&gt;node_modules&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Shared internals
&lt;/h2&gt;

&lt;p&gt;The seven protocols share core infrastructure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Template engine&lt;/strong&gt; — &lt;code&gt;{{faker.name}}&lt;/code&gt;, &lt;code&gt;{{uuid}}&lt;/code&gt;, &lt;code&gt;{{now}}&lt;/code&gt;, &lt;code&gt;{{random.int 1 100}}&lt;/code&gt; — same 34 faker functions across every protocol&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Config&lt;/strong&gt; — one YAML or JSON file defines all mocks across all protocols&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Request logging&lt;/strong&gt; — HTTP, GraphQL, gRPC, WebSocket, MQTT traffic in one unified log&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Import&lt;/strong&gt; — OpenAPI, Postman, HAR, WireMock, cURL, Mockoon, and WSDL formats&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chaos&lt;/strong&gt; — 10 profiles and 12 fault types apply across HTTP, GraphQL, gRPC, and SOAP&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP&lt;/strong&gt; — 18 tools give AI agents programmatic access to everything&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How this compares
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Language&lt;/th&gt;
&lt;th&gt;Protocols&lt;/th&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;th&gt;Runtime&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;mockd&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Go&lt;/td&gt;
&lt;td&gt;7 (HTTP, GraphQL, gRPC, WS, MQTT, SSE, SOAP)&lt;/td&gt;
&lt;td&gt;43MB binary&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;WireMock&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Java&lt;/td&gt;
&lt;td&gt;HTTP (extensions for others)&lt;/td&gt;
&lt;td&gt;~200MB Docker&lt;/td&gt;
&lt;td&gt;JVM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Mockoon&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Electron/Node&lt;/td&gt;
&lt;td&gt;HTTP, GraphQL&lt;/td&gt;
&lt;td&gt;~200MB app&lt;/td&gt;
&lt;td&gt;Node&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;json-server&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Node&lt;/td&gt;
&lt;td&gt;REST&lt;/td&gt;
&lt;td&gt;~2MB (+ Node)&lt;/td&gt;
&lt;td&gt;Node&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Prism&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Node&lt;/td&gt;
&lt;td&gt;HTTP (OpenAPI validation)&lt;/td&gt;
&lt;td&gt;~50MB (+ Node)&lt;/td&gt;
&lt;td&gt;Node&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MockServer&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Java&lt;/td&gt;
&lt;td&gt;HTTP/HTTPS&lt;/td&gt;
&lt;td&gt;~200MB Docker&lt;/td&gt;
&lt;td&gt;JVM&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;WireMock is battle-tested with a huge plugin ecosystem. Mockoon has a desktop UI nothing else matches. json-server is dead simple for REST prototyping. Mockd's angle: all seven protocols from one tool, zero runtime dependencies, sub-second startup.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest part
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;43MB is not small.&lt;/strong&gt; It's smaller than pulling a JVM or Node runtime, but it's not a 5MB CLI tool. Every protocol adds weight — gRPC alone brings in protobuf libraries. I could strip features to shrink the binary, but that defeats the point.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;gRPC requires a &lt;code&gt;.proto&lt;/code&gt; file.&lt;/strong&gt; There's no way around this. gRPC is contract-driven — you can't hand-wave the schema like you can with HTTP. No &lt;code&gt;.proto&lt;/code&gt; file, no gRPC mock. That's a protocol constraint, not a mockd constraint, but it still adds friction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The MQTT broker is basic.&lt;/strong&gt; QoS 0 and 1, topic wildcards, pub/sub. No clustering, no persistence, no QoS 2. For dev/test it's fine. For benchmarking against a real broker, use Mosquitto or EMQX.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SOAP exists because it has to.&lt;/strong&gt; Banks, insurance, healthcare — I didn't add SOAP because I enjoy XML. I added it because developers at those companies deserve mock tooling that isn't "install a 2008 Java web server."&lt;/p&gt;

&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;getmockd/tap/mockd
&lt;span class="c"&gt;# or&lt;/span&gt;
curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://get.mockd.io | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the server and start adding mocks. Every protocol. One binary. Zero dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn more
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://mockd.io/quickstart?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=seven-protocols-one-binary" rel="noopener noreferrer"&gt;Quickstart guide&lt;/a&gt;&lt;/strong&gt; — create your first mock in under 60 seconds&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://mockd.io/protocols?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=seven-protocols-one-binary" rel="noopener noreferrer"&gt;All 7 protocols&lt;/a&gt;&lt;/strong&gt; — full documentation for each protocol&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://mockd.io/blog/openapi-to-mock-server?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=seven-protocols-one-binary" rel="noopener noreferrer"&gt;Import from OpenAPI&lt;/a&gt;&lt;/strong&gt; — convert existing API specs to mocks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://mockd.io/blog/chaos-engineering-without-the-chaos?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=seven-protocols-one-binary" rel="noopener noreferrer"&gt;Chaos engineering&lt;/a&gt;&lt;/strong&gt; — fault injection across all protocols&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/getmockd/mockd" rel="noopener noreferrer"&gt;github.com/getmockd/mockd&lt;/a&gt; (Apache 2.0)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docs:&lt;/strong&gt; &lt;a href="https://docs.mockd.io" rel="noopener noreferrer"&gt;docs.mockd.io&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Install:&lt;/strong&gt; &lt;code&gt;brew install getmockd/tap/mockd&lt;/code&gt; or &lt;code&gt;curl -fsSL https://get.mockd.io | sh&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>go</category>
      <category>webdev</category>
      <category>opensource</category>
      <category>programming</category>
    </item>
    <item>
      <title>Your AI Coding Agent Needs a Dev Environment Too</title>
      <dc:creator>Mockd</dc:creator>
      <pubDate>Sat, 28 Mar 2026 03:01:16 +0000</pubDate>
      <link>https://dev.to/mockd/your-ai-coding-agent-needs-a-dev-environment-too-d2l</link>
      <guid>https://dev.to/mockd/your-ai-coding-agent-needs-a-dev-environment-too-d2l</guid>
      <description>&lt;p&gt;I've been watching how AI coding agents actually work — not the demos, the real day-to-day usage — and something keeps standing out: we've optimized the wrong things.&lt;/p&gt;

&lt;p&gt;Agents have great editors now. They can read files, write files, run tests, search codebases, manage git. The tooling around code manipulation is genuinely impressive.&lt;/p&gt;

&lt;p&gt;What they can't do — what nobody seems to talk about — is run a development loop against the services their code depends on. And if you've built anything nontrivial in the last decade, that's where most real development happens.&lt;/p&gt;

&lt;h2&gt;
  
  
  The development loop problem
&lt;/h2&gt;

&lt;p&gt;When you build a feature that talks to an external API — Stripe for payments, your team's user service, a third-party data provider — you need that service running and responding while you develop. You write code, test it, see what the API returns, adjust, test again. Tight loop.&lt;/p&gt;

&lt;p&gt;AI agents do this loop too. Except faster. A lot faster.&lt;/p&gt;

&lt;p&gt;A developer might hit an API endpoint 20–30 times while building a payment integration. They know the API, they've read the docs, they debug by reading error messages and adjusting carefully.&lt;/p&gt;

&lt;p&gt;An AI agent doing the same work might hit that endpoint 200–400 times. It generates code, tests it, reads the response, adjusts, generates new code, tests again. Each iteration is cheap in human terms — it costs tokens, not hours — but each iteration still needs a real response from a real service.&lt;/p&gt;

&lt;p&gt;And that's where everything falls apart.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens when agents hit real services
&lt;/h2&gt;

&lt;p&gt;Three problems, in order of how much they'll derail your afternoon:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rate limits.&lt;/strong&gt; Stripe's test mode allows 25 requests per second. That sounds generous until an AI agent burns through it in a tight iteration loop, gets rate-limited, spends 400 tokens parsing the 429 response, backs off, retries, gets limited again, and eventually asks you what went wrong. Your agent just hit a wall that has nothing to do with the code it's writing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost.&lt;/strong&gt; Not every API has a free test mode. Third-party data providers, AI inference APIs, communication platforms — many charge per request even in sandbox environments. An agent making 200 exploratory calls during a feature build adds up fast. And unlike a developer who reads docs and makes targeted calls, agents are exploratory by nature. They try things. They test edge cases. That exploration has a dollar sign attached when it hits real services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Availability.&lt;/strong&gt; The API you depend on is maintained by a team in another timezone. They pushed a breaking change to staging at 3 PM their time — 7 AM yours. Your agent starts working at 8 AM and immediately hits 500 errors on every call. It doesn't know the staging environment is broken. It thinks its code is wrong. It spends 45 minutes rewriting perfectly good code to "fix" an error that isn't its fault.&lt;/p&gt;

&lt;p&gt;Developers recognize these situations instinctively. We check Slack, we ping the other team, we context-switch to something else. Agents don't have that instinct. They see a broken response and conclude they need to write different code.&lt;/p&gt;

&lt;h2&gt;
  
  
  The gap in your local dev stack
&lt;/h2&gt;

&lt;p&gt;We've actually solved most of the "AI agent needs local infrastructure" problem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Filesystem?&lt;/strong&gt; Agents have one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Terminal?&lt;/strong&gt; Built in.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database?&lt;/strong&gt; SQLite, Docker, your local Postgres — pick one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Git?&lt;/strong&gt; First-class support in every agent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Editor/IDE integration?&lt;/strong&gt; That's... what they are.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What we haven't solved: &lt;strong&gt;the services this application talks to over the network.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your app makes HTTP requests to a user service. It connects to a WebSocket for real-time updates. It calls a gRPC service for search. It authenticates through an OAuth provider. Those services are remote, someone else owns them, and they may or may not be running right now.&lt;/p&gt;

&lt;p&gt;That gap — the space between "my agent can edit code" and "my agent can develop against a real system" — is the bottleneck nobody's addressing. Your agent has every tool it needs to write code, and no way to verify that code works against the services it's designed to talk to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mock servers as agent infrastructure
&lt;/h2&gt;

&lt;p&gt;I'll be direct: this is the reason I built &lt;a href="https://github.com/getmockd/mockd" rel="noopener noreferrer"&gt;mockd&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Not because mock servers are a new concept. WireMock has been around since 2011. json-server since 2013. The idea of returning fake responses from a local server isn't novel.&lt;/p&gt;

&lt;p&gt;What's new is the role. Mock servers aren't just test utilities anymore. They're &lt;strong&gt;development infrastructure that makes AI agents productive.&lt;/strong&gt; The same way a local database makes a developer productive — it's always there, it's fast, it's yours — a local mock server makes an agent productive against external service dependencies.&lt;/p&gt;

&lt;p&gt;When you point an AI agent at a project that has a mock server running, the agent can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make unlimited API calls with zero rate limits&lt;/li&gt;
&lt;li&gt;Get sub-millisecond responses instead of network-latency responses&lt;/li&gt;
&lt;li&gt;Work against services that don't exist yet (the other team hasn't built them)&lt;/li&gt;
&lt;li&gt;Work at 3 AM when staging is down for maintenance&lt;/li&gt;
&lt;li&gt;Work in complete isolation from other developers and their agents&lt;/li&gt;
&lt;li&gt;Hit intentional error responses you've configured, not accidental ones from broken staging&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This isn't a test-time convenience. It's a development-time necessity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Self-provisioning infrastructure
&lt;/h2&gt;

&lt;p&gt;Here's where it gets interesting. With MCP (Model Context Protocol), an agent doesn't just develop &lt;em&gt;against&lt;/em&gt; mock servers — it can &lt;em&gt;manage&lt;/em&gt; them.&lt;/p&gt;

&lt;p&gt;MCP is a standard protocol that lets AI agents call external tools programmatically. mockd exposes 18 MCP tools for creating endpoints, importing API specs, managing state, and inspecting request logs. Any MCP-compatible agent — Claude Code, Cursor, GitHub Copilot — can use them.&lt;/p&gt;

&lt;p&gt;The workflow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Agent reads the OpenAPI spec for the service you depend on&lt;/li&gt;
&lt;li&gt;Agent calls mockd's &lt;code&gt;import_mocks&lt;/code&gt; tool to create endpoints from the spec&lt;/li&gt;
&lt;li&gt;Agent develops against those endpoints as if they're the real service&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No human writes configuration. No human runs CLI commands. The agent provisions its own development infrastructure and immediately starts building.&lt;/p&gt;

&lt;p&gt;This is a fundamentally different relationship between developer tools and AI. The tool isn't something the developer configures for the agent. The tool is something the agent configures for itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The cost math
&lt;/h2&gt;

&lt;p&gt;Let's make this concrete.&lt;/p&gt;

&lt;p&gt;A team of 10 engineers, each with an AI agent doing 4 hours of assisted development per day. Each agent averages 150 API calls to external service dependencies during that time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Against real services:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Cost factor&lt;/th&gt;
&lt;th&gt;Calculation&lt;/th&gt;
&lt;th&gt;Daily cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Metered API calls&lt;/td&gt;
&lt;td&gt;10 agents x 150 calls x $0.01/call&lt;/td&gt;
&lt;td&gt;$15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rate-limit delays&lt;/td&gt;
&lt;td&gt;~5 min/day/agent of wasted time&lt;/td&gt;
&lt;td&gt;50 min lost&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Staging downtime&lt;/td&gt;
&lt;td&gt;10% availability issues = blocked agents&lt;/td&gt;
&lt;td&gt;~2 hrs/day team-wide&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent token waste&lt;/td&gt;
&lt;td&gt;Debugging non-code errors (429s, 500s, timeouts)&lt;/td&gt;
&lt;td&gt;Hard to quantify, but real&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Against local mock servers:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Cost factor&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;API calls&lt;/td&gt;
&lt;td&gt;$0.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rate-limit delays&lt;/td&gt;
&lt;td&gt;0 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Availability issues&lt;/td&gt;
&lt;td&gt;0 (it's running on your machine)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent token waste&lt;/td&gt;
&lt;td&gt;Near zero&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The mock server isn't a nice-to-have optimization. It's the difference between your agent spending tokens on your feature and spending tokens fighting infrastructure it doesn't control.&lt;/p&gt;

&lt;h2&gt;
  
  
  This is just the beginning
&lt;/h2&gt;

&lt;p&gt;Local mock servers for AI development is a bigger topic than one post can cover. Two things I haven't addressed yet: why "return 200 OK with some JSON" isn't enough (your agent needs realistic service behavior to build production-ready code), and how this scales when you have multiple teams with multiple agents all developing in parallel.&lt;/p&gt;

&lt;p&gt;If you want to try this now:&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 mockd&lt;/span&gt;
curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://get.mockd.io | sh

&lt;span class="c"&gt;# Start the server&lt;/span&gt;
mockd start

&lt;span class="c"&gt;# Create a mock endpoint&lt;/span&gt;
mockd add http &lt;span class="nt"&gt;--method&lt;/span&gt; GET &lt;span class="nt"&gt;--path&lt;/span&gt; /api/users &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--status&lt;/span&gt; 200 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--body&lt;/span&gt; &lt;span class="s1"&gt;'[{"id": 1, "name": "Alice"}, {"id": 2, "name": "Bob"}]'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your agent now has an API it can develop against. No rate limits, no costs, no downtime.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn more
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://mockd.io/quickstart?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=ai-agents-need-mock-servers" rel="noopener noreferrer"&gt;Quickstart guide&lt;/a&gt;&lt;/strong&gt; — install mockd and create your first mock in under 60 seconds&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://mockd.io/features?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=ai-agents-need-mock-servers" rel="noopener noreferrer"&gt;All features&lt;/a&gt;&lt;/strong&gt; — MCP server, AI mock generation, 7 protocols, recording proxy, and more&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://mockd.io/protocols?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=ai-agents-need-mock-servers" rel="noopener noreferrer"&gt;All 7 protocols&lt;/a&gt;&lt;/strong&gt; — HTTP, gRPC, GraphQL, WebSocket, MQTT, SSE, SOAP&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://mockd.io/tunnels?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=ai-agents-need-mock-servers" rel="noopener noreferrer"&gt;Cloud tunnel&lt;/a&gt;&lt;/strong&gt; — share local mocks via a public URL with one command&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/getmockd/mockd" rel="noopener noreferrer"&gt;github.com/getmockd/mockd&lt;/a&gt; (Apache 2.0)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docs:&lt;/strong&gt; &lt;a href="https://docs.mockd.io?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=ai-agents-need-mock-servers" rel="noopener noreferrer"&gt;docs.mockd.io&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Install:&lt;/strong&gt; &lt;code&gt;brew install getmockd/tap/mockd&lt;/code&gt; or &lt;code&gt;curl -fsSL https://get.mockd.io | sh&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

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