Model Context Protocol
MCP toolboxes
Connect to OpenAI API
1 min
in this guide, learn how to connect your mcp toolbox through the openai api prerequisites docid\ jqy6i5acfim kom9erv7a to connect to your mcp toolbox through the openai api use the following configuration for your api call curl https //api openai com/v1/responses \\ h "content type application/json" \\ h "authorization bearer $openai api key" \\ d '{ "model" "gpt 4 1", "input" "list all available tools ", "tools" \[ { "type" "mcp", "server label" "make", "server url" "\<mcp toolbox url>/t/\<toolbox key>/\<transport method>", } ] }' in server url , replace the placeholders with your actual values mcp toolbox url the url generated when you created the mcp toolbox toolbox key the key generated when creating an mcp toolbox transport method the path of your preferred transport method stateless streamable http ( /stateless ) is recommended due to its connection reliability if you experience connection issues, add /stream instead of /stateless to the end of the url for sse, add /sse instead example configuration curl https //api openai com/v1/responses \\ h "content type application/json" \\ h "authorization bearer $openai api key" \\ d '{ "model" "gpt 4 1", "input" "list all available tools ", "tools" \[ { "type" "mcp", "server label" "make", "server url" "https //eu2 make com/mcp/server/•••••••••••••/t/•••••••••••••/stateless", } ] }' you've now connected your mcp toolbox through the openai api mcp toolbox timeout your mcp toolbox scenarios must finish running within 40 seconds if a scenario runs longer, the connection times out and no outputs are returned to the client