Turning a Custom GPT Action into an MCP server: a minimal tested example A developer published a minimal, tested example of migrating a Custom GPT Action to an MCP server using the official TypeScript SDK (@modelcontextprotocol/sdk 1.32.2, zod 4, Node 24). The demo wraps Open-Meteo's current-weather endpoint as a get_current_weather tool, with a stdio test client confirming tool listing, a successful call returning 2.6°C and 9 km/h wind, and a validation error for out-of-range latitude. The author notes the example is a happy-path demo, not production-hardened, and that HTTP error and network-failure branches remain untested. If you have a Custom GPT that calls your own API through an Action, the same API can also be exposed to MCP clients such as Claude. This is a minimal, tested example of moving one Action operation into an MCP server. I ran the code below with the official TypeScript SDK @modelcontextprotocol/sdk 1.32.2, zod 4, Node 24 . It is a happy-path demo, not production-hardened. Setup: npm i @modelcontextprotocol/sdk zod , save the server as server.mjs and the test client as test.mjs both ES modules . | Custom GPT Action OpenAPI | MCP server | |---|---| | operationId | tool name | | summary / description | tool description the model reads this to decide when to call it | | parameters + request schema | inputSchema : a zod shape you write by hand no OpenAPI import | | HTTP error response | you map it to isError: true yourself, with a message the model can act on | | API key / OAuth in the Action | your server's own auth not shown here | Operation being moved: GET /v1/forecast?latitude=..&longitude=..¤t weather=true Open-Meteo, no key needed . js import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { z } from "zod"; const server = new McpServer { name: "weather-actions", version: "1.0.0" } ; // OpenAPI operation: GET /v1/forecast?latitude=..&longitude=..¤t weather=true operationId: getCurrentWeather server.registerTool "get current weather", { description: "Current temperature °C and wind speed km/h for a latitude/longitude.", inputSchema: { latitude: z.number .min -90 .max 90 , longitude: z.number .min -180 .max 180 }, }, async { latitude, longitude } = { const url = https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}¤t weather=true ; const res = await fetch url ; if res.ok { return { isError: true, content: { type: "text", text: Weather API returned ${res.status}. Check the coordinates and retry. } }; } const { current weather: w } = await res.json ; return { content: { type: "text", text: JSON.stringify { temperature c: w.temperature, windspeed kmh: w.windspeed } } }; } ; await server.connect new StdioServerTransport ; A client that connects over stdio, lists tools, and calls the tool twice: js import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"; const c = new Client { name: "t", version: "1" } ; await c.connect new StdioClientTransport { command: "node", args: "server.mjs" } ; console.log JSON.stringify await c.listTools .tools.map t= {name:t.name,required:t.inputSchema.required} ; console.log JSON.stringify await c.callTool { name: "get current weather", arguments: { latitude: 52.52, longitude: 13.41 } } ; console.log JSON.stringify await c.callTool { name: "get current weather", arguments: { latitude: 999, longitude: 0 } } .slice 0,200 ; await c.close ; Results: listTools returned one tool, get current weather , with latitude and longitude required. {"temperature c":2.6,"windspeed kmh":9} . isError: true : Too big: expected number to be <=90 at latitude . The res.ok branch in the handler is not covered by this test, and network failures a thrown fetch are not handled. If you would rather hand it off, I offer this migration as a fixed-price Upwork project search for "Custom GPT Actions rebuilt as a tested MCP server" .