cd /news/ai-agents/my-mcp-server-needed-8-seconds-i-gav… · home › topics › ai-agents › article
[ARTICLE · art-182070] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↓ negative

My MCP server needed 8 seconds. I gave Kiro 15, and it still timed out.

A developer built Wiretrace, a tool that records MCP traffic from both the official MCP client and the Kiro CLI, to diagnose why slow-starting MCP servers time out in Kiro. Testing with an 8-second server, the developer found Kiro's configured 15-second timeout is effectively halved to about 7.5 seconds because Kiro tries the newer server/discover handshake and then the legacy initialize handshake in sequence, restarting the server from zero each time; raising the timeout to 60 seconds made both clients succeed every run.

recommendation

Set MCP server startup timeouts to well over double the server's actual boot time, since Kiro splits the budget across two handshake attempts and restarts the server between them.

more in playbook: Designing agent systems
by read6 min views9 publishedDec 4, 2026

My MCP server takes 8 seconds to start. I gave Kiro 15 seconds to wait for it, and Kiro still said it timed out.

That's almost double the time it needed. So either my server was broken, or 15 seconds didn't mean what I thought it meant. My server was fine.

In plain terms, MCP is how an AI tool like Kiro talks to your own tools. Kiro starts your server, waits for it to answer, then uses it. I built Wiretrace for the Kiroween Hackathon 2026 to find out what happens when that waiting goes wrong. This post shows what I found, how you can test it on your own machine in two minutes, and five things that went wrong while I was building it.

Someone opened an issue on Kiro's GitHub. Their Python server worked when they ran it themselves, but Kiro always timed out on it.

I kept thinking about that one, because both sides were telling the truth. The server did work. Kiro did time out. There was just nothing in between to look at.

So that's what I built. Wiretrace makes the same tool call twice, once with the official MCP client and once with the real Kiro CLI, and saves every message both of them send.

My test server takes 8 seconds to start, and I first set Kiro's timeout to 3. It failed, as it should.

I also made an app for Kiro Crew, where a group of AI workers can look at a problem together. I gave them the recording and let them suggest a fix. One said 15 seconds. Another said 10.

I would have said the same. 8 is less than 10. 8 is less than 15.

Wiretrace tried both, twice each. All four runs failed.

This is the recording from the 15 second run:

Time What happened
0.0 s Kiro starts the server and sends server/discover
7.5 s No answer yet, so Kiro stops the server
0.0 s Kiro starts it again and sends initialize
7.5 s No answer yet, so Kiro stops it again and gives up

Kiro didn't wait 15 seconds once. It waited about 7.5 seconds, twice, and my server started from zero each time. It needed 8, so it missed both times by about half a second.

The two messages are the new and old ways to say hello in MCP. Kiro tries the new one first, then the old one, so it can work with older servers. That's a good idea. It just means a slow server gets about half the time you wrote down.

When I changed the timeout to 60 seconds, both clients worked every time.

You need uv and Kiro CLI, signed in. You don't need Wiretrace for this part.

Make a slow server and save it as slow_server.py:

import time

from mcp.server.mcpserver import MCPServer

time.sleep(8)  # pretend this is a slow import or a database
server = MCPServer(name="slow")

@server.tool()
def get_status() -> str:
    return "ok"

server.run()

Next to it, save this as .kiro/agents/slow-test.json:

{
  "name": "slow-test",
  "prompt": "Call the get_status tool once, then reply with its output.",
  "includeMcpJson": false,
  "mcpServers": {
    "slow": {
      "command": "uv",
      "args": ["run", "--with", "mcp==2.3.0", "slow_server.py"],
      "timeout": 15000
    }
  },
  "tools": ["@slow"]
}

Then run it:

kiro-cli chat --v3 --no-interactive --require-mcp-startup \
  --agent slow-test --trust-tools=@slow/get_status "Call get_status"

This is what I got on Kiro CLI 3.8.1:

Error: these servers failed to start: slow: MCP server 'slow'
connection timed out after 15000ms (--require-mcp-startup enabled)

Now change 15000 to 60000 and run it again. Mine answered ok.

If your own server is slow to start, give Kiro well over double the time it needs. I only tested 3, 10, 15 and 60 seconds, and only on this version, so check yours.

I wanted Kiro to build one part by itself, a second test server. I wrote a spec for it, but I didn't want to sit there watching every command.

So I wrote hooks first. A hook is a small check that runs by itself when Kiro does something. This one checks every Python file Kiro writes and tells Kiro what's wrong with it:

{
  "version": "v1",
  "hooks": [
    {
      "name": "Lint edited Python",
      "trigger": "PostToolUse",
      "matcher": "write",
      "action": {
        "type": "command",
        "command": "python3 .kiro/hooks/scripts/wiretrace_hook.py lint"
      },
      "timeout": 60
    }
  ]
}

The others stop Kiro from touching private files, block risky commands, and run the tests before it's allowed to finish.

Kiro worked for about 8 minutes. The hooks checked 40 commands and sent it back to fix its code 7 times. Then the tests passed. This is my favorite part of Kiro now, and I write the hooks before I write the prompt.

The day I had to submit, I clicked "Run a live example" and got "page could not be found". I had told Vercel to skip a folder called examples/. It skipped every folder with that name, including the page. The fix was one slash at the front: /examples/.

The first time I ran the Crew workers, they got stuck. I had given them @wiretrace, but Kiro Crew had named my tools @wiretrace:wiretrace. That mistake cost 4.7 credits.

In one run, Kiro connected, saw the tool and never called it. Wiretrace marked the server as failed. That was unfair, so now it says the run had no clear result.

kiro-cli whoami doesn't return an error when you're signed out. I now read accountType from kiro-cli whoami --format json.

I set up a check to run by itself in Kiro Crew. It stopped to ask permission, nobody was there to answer, and it gave up. If you want a job to run alone, you have to allow its tools first.

What Result
Official MCP client, slow server Answered in 10.7 s
Kiro with a 3, 10 or 15 second timeout Failed every time
Kiro with 60 seconds Worked, 2 out of 2
Settings that could be the cause 5. Only timeout mattered
Kiro building the second test server About 8 minutes, 5.69 credits
The Crew workers' session 13 minutes, 17.2 credits, and it ran out of budget before it finished

You can watch it fail and get fixed, with no account, at wiretrace-gray.vercel.app. The code is at https://github.com/winsznx/wiretrace, and the Kiro Crew app is at https://github.com/winsznx/wiretrace-crew.

If Kiro keeps timing out on your server, tell me how long yours takes to start.

── more in #ai-agents 4 stories · sorted by recency
── more on @kiro 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/my-mcp-server-needed…] indexed:0 read:6min 2026-12-04 · —