---
title: "Discussion on \"I Made My API MCP-Ready Without Writing a Single Tool by Hand\" | Hashnode"
description: "Discussion on \"I Made My API MCP-Ready Without Writing a Single Tool by Hand\". Generating MCP tools from OpenAPI and handle sync, callback, and long-running Prefect jobs with WebSockets"
url: "https://hashnode.com/posts/i-made-my-api-mcp-ready-without-writing-a-single-tool-by-hand/6a7a107994c7f1135dd7bbbc"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [I Made My API MCP-Ready Without Writing a Single Tool by Hand](https://kunalforked.hashnode.dev/i-made-my-api-mcp-ready-without-writing-a-single-tool-by-hand?utm_source=hashnode&utm_medium=feed)

Generating MCP tools from OpenAPI and handle sync, callback, and long-running Prefect jobs with WebSockets

Aug 10 · 5 min read · kunalforked.hashnode.dev  
Read the article

-   [#mcp](https://hashnode.com/tag/mcp)
-   [#fastmcp](https://hashnode.com/tag/fastmcp)
-   [#fastapi](https://hashnode.com/tag/fastapi)
-   [#openapi](https://hashnode.com/tag/openapi)
-   [#mcp-server](https://hashnode.com/tag/mcp-server)
-   [#mcp-client](https://hashnode.com/tag/mcp-client)

## Written by

[Kunal Gupta](https://hashnode.com/@kunalforked)

@kunalforked · Bengaluru, India

  
[View profile](https://hashnode.com/@kunalforked)

Software Engineer, Tech Enthusiast

I'm a backend engineer who spends most days deep in distributed systems, services talking to each other, breaking in interesting ways, and occasionally behaving. I write here about what I actually learn while building and debugging things, not the polished version.

## Responses 4

Markdown supported · ⌘↵ to post

[Yash Pradhan](https://hashnode.com/@yashyon)

[Aug 11](https://hashnode.com/posts/i-made-my-api-mcp-ready-without-writing-a-single-tool-by-hand/6a7a107994c7f1135dd7bbbc/comment/6a7aab41bae6556450f7a963)

Automating the mcp integration instead of writing tools by hand is exactly how it should be done, great read!!

[Nabarun Mukherjee](https://hashnode.com/@naveroo)

[Aug 10](https://hashnode.com/posts/i-made-my-api-mcp-ready-without-writing-a-single-tool-by-hand/6a7a107994c7f1135dd7bbbc/comment/6a7a194f992a3ad846f7d6c7)

Liked the shared websocket logic here. How are you planning to scale it especially when mcp is horizontally scaled

[Kunal Gupta](https://hashnode.com/@kunalforked)

[Aug 12](https://hashnode.com/posts/i-made-my-api-mcp-ready-without-writing-a-single-tool-by-hand/6a7a107994c7f1135dd7bbbc/comment/6a7a194f992a3ad846f7d6c7#reply-6a7c750de87a1df5c8d2df14)

The version I described only really works in a single instance. The version I described only really works in a single instance. In my current setup, MCP and FastAPI are intentionally mapped 1:1, each MCP instance maintains its own WebSocket connection with its corresponding FastAPI instance. So the Future and request\_id stay local to that pair.

[Aug 12](https://hashnode.com/posts/i-made-my-api-mcp-ready-without-writing-a-single-tool-by-hand/6a7a107994c7f1135dd7bbbc/comment/6a7c7e4fbf6650ed9072766d)

Your what-bit-me list contains its own fix and I would promote it: "Untagged routes default to 'sync', which is not always safe" plus your hung prefect-job route equals a strong argument for making untagged a startup error rather than a default. Generation happens at boot anyway, so failing fast on a route missing x-api-type turns "tag everything, don't rely on the default" from a discipline you remember into one the system enforces, and the cost is one crash the first time instead of one silent hang in production. The single-multiplexed-WebSocket with per-request futures is genuinely nice; the timeout-around-every-await lesson is the one every async-tool author learns exactly once. The x-api-type extension pattern generalizes beyond your three flavors too. I keep a guide to the REST-to-MCP conversion path, including where generation stops being enough, at [skillselion.com/guides/how-to-convert-rest-api-to…](https://skillselion.com/guides/how-to-convert-rest-api-to-mcp-server-2026?utm_source=hashnode&utm_medium=comment&utm_campaign=sweep-aug-12) (disclosure: I run Skillselion).
