Converting a Custom GPT Action into an MCP Server: A Minimal Tested Example
A developer shows how to expose a single Custom GPT Action operation as a tool on a Model Context Protocol (MCP) server, so clients such as Claude can call the same API. The example uses the official TypeScript SDK with zod schemas and wraps Open-Meteo's forecast endpoint, which needs no API key, to return current temperature and wind speed. A test client confirmed the tool is listed with required parameters and returns correct Berlin weather data. Out-of-range coordinates were rejected by schema validation and returned as an error. The author notes the demo is not production-hardened, since the HTTP error branch and network failures are untested, and stresses that tool descriptions strongly influence when the model calls the tool.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in