Skip to content

Connect via OpenAI API

Use the mcp tool type in a Responses API request. This example restricts allowed_tools to the read-only list_monitors for safe verification — remove the restriction to enable write tools in production:

Terminal window
curl https://api.openai.com/v1/responses \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"tools": [
{
"type": "mcp",
"server_label": "uptimemonitoring",
"server_url": "https://api.uptimemonitoring.com/mcp",
"headers": {
"Authorization": "Bearer umk_live_..."
},
"allowed_tools": ["list_monitors"]
}
],
"input": "List my UptimeMonitoring monitors."
}'

Replace umk_live_... with your UptimeMonitoring API key. Keep the two keys separate: OPENAI_API_KEY (sk-...) is your OpenAI credential; umk_live_... is your UptimeMonitoring credential.

Use caseMethod
Backend-to-backend / server agentPass Authorization: Bearer umk_live_... in the headers field (shown above)
User-facing agent with OAuthPass the user’s OAuth access token via the authorization field of the MCP tool config instead of headers.Authorization

To enable write tools (create_monitor, update_monitor, delete_monitor) in production, remove allowed_tools and handle the mcp_approval_request events in the response stream, or set require_approval: "never" only after confirming user intent in your application layer.

Run the curl call above. The response should include a tool call to list_monitors and a follow-up assistant message summarising your monitors.

SymptomCauseFix
401 from UptimeMonitoringWrong key in headers.AuthorizationConfirm the key starts with umk_live_ — do not use your OpenAI key here
MCP tool ignored by modelOlder model version without mcp tool supportSwitch to gpt-4o or a later model
Server not foundURL typoThe endpoint is https://api.uptimemonitoring.com/mcp, not mcp.uptimemonitoring.com