Skip to main content

Overview

OpenAI’s Responses API supports Model Context Protocol servers as remote tools. Connect it to an ezForge Ready MCP server to give GPT-4o (and later models) direct access to a business’s data and capabilities.

Prerequisites

  • An ezForge Ready business with a deployed MCP server
  • Your MCP server URL (format: https://<slug>.mcp.ezforge.ai)
  • An OpenAI API key with access to the Responses API

Connecting via the Responses API

from openai import OpenAI

client = OpenAI()

response = client.responses.create(
    model="gpt-4o",
    tools=[
        {
            "type": "mcp",
            "server_label": "my-business",
            "server_url": "https://<slug>.mcp.ezforge.ai",
            "require_approval": "never",
        }
    ],
    input="What services does this salon offer and what are the prices?",
)
print(response.output_text)
Replace <slug> with your business slug.
Security trade-off: require_approval: "never" disables OpenAI’s per-call tool approval gate, meaning the model can invoke any MCP tool without pausing for user confirmation. This is safe for read-only operations against public business data (hours, menu, services), but you should evaluate this setting carefully if your server exposes write tools (e.g., book_appointment, place_order). For write-capable servers, consider using require_approval: "always" or a per-tool approval policy to keep a human in the loop before state-changing actions execute.
The Responses API MCP integration is in beta. Check the OpenAI changelog for the latest status.

Transport: HTTP (Stateless JSON-RPC)

ezForge Ready servers support both SSE and stateless HTTP transports. The OpenAI Responses API uses the stateless HTTP transport by default (openaiTransport: "http" in the /.well-known/mcp-server-metadata response). You do not need to append /sse to the URL when using the Responses API — pass the base MCP server URL.

OAuth 2.1 Authentication

ezForge Ready servers require OAuth 2.1 with PKCE. The Responses API handles the discovery and authorization flow automatically when you pass the base server URL. The authorization server is discovered via:
  1. GET https://<slug>.mcp.ezforge.ai/.well-known/oauth-protected-resource (RFC 9728)
  2. GET <authorization-server>/.well-known/oauth-authorization-server (RFC 8414)
Dynamic client registration (RFC 7591) is supported — the Responses API registers its client ID automatically on first use.

Function Calling (Legacy)

If you are using the older Chat Completions API with function calling rather than the Responses API, you can convert MCP tool definitions to OpenAI function schemas manually. All ezForge Ready tool names conform to the OpenAI naming rule (^[a-zA-Z0-9_-]{1,64}$) and all parameters use JSON Schema types compatible with OpenAI function calling. Retrieve the tool list via the MCP tools/list JSON-RPC method:
curl -X POST "https://<slug>.mcp.ezforge.ai" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <access_token>" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

Agent Discovery

To discover Ready businesses programmatically, query the ezForge directory:
curl "https://ezforge.ai/api/v1/directory?vertical=salon&city=Chicago"
The agentDiscovery.openaiTransport field in /.well-known/mcp-server-metadata tells the Responses API which transport to use:
{
  "agentDiscovery": {
    "openaiTransport": "http",
    "oauthProtectedResource": "https://<slug>.mcp.ezforge.ai/.well-known/oauth-protected-resource"
  }
}

Available Tools

See the Claude Integration Guide for the full tool reference. All tools work identically across Claude, ChatGPT, and Gemini — the MCP protocol is agent-agnostic.

Troubleshooting

401 Unauthorized — the access token has expired. The Responses API refreshes tokens automatically; if you are calling the MCP server directly, re-run the OAuth flow to get a new token. Tool schema validation failures — ensure your GPT model supports all JSON Schema types used in the tool parameters. All Ready tools use only string, number, boolean, and array types at the top level.