MCP Tool Builder — Generate Model Context Protocol Tool Definitions from Python / TypeScript

Free online MCP Tool Definition Generator. Paste a Python or TypeScript function signature and get spec-compliant MCP tool JSON, full Python (FastMCP) and TypeScript (@modelcontextprotocol/sdk) server boilerplate, plus a ready-to-use cURL test command. Fully client-side.

What is MCP (Model Context Protocol)?

MCP is the de facto standard tool-access protocol for AI agents, launched by Anthropic in late 2024 and adopted natively by Claude, OpenAI, Gemini, and others by 2026. MCP lets AI agents connect to GitHub, Postgres, Slack, or custom services through a unified interface — write the server once, and every compliant agent can call it.

Why this tool?

Every MCP tool needs a JSON Schema describing its inputs (without it, calls fail). Writing schemas by hand is error-prone — fields get missed, types get wrong, optionality gets confused. This tool generates spec-compliant tool definitions directly from your function signature, saving 80% of the boilerplate work.

Supported inputs

  • Python: full type hints (including Optional / Literal / Union) + Google / NumPy / reST docstring parsing
  • TypeScript: full type annotations (union of string literals → enum) + JSDoc @param parsing
  • Default value detection: auto-mapped to JSON Schema default field
  • Optional detection: Optional[X] / ?: / has-default = non-required

Four outputs

  1. MCP Tool JSON: paste into your server.list_tools() handler or manifest
  2. Python server: complete FastMCP template, pip install mcp and run
  3. TypeScript server: full @modelcontextprotocol/sdk + zod scaffold, type-safe
  4. Test cURL: HTTP transport test command, jsonrpc 2.0 payload

Learn MCP in depth

Read dibi8's Model Context Protocol Deep Dive — Definitive 2026 Guide: from zero to production MCP servers.