MCP clients
OpenAI Responses API and Agents SDK
Hosted MCP with server_url and authorization Bearer
OpenAI's hosted MCP integration calls Servicebay from OpenAI's infrastructure. Send a static API key (or an OAuth access token you already hold) on every request — the API does not store authorization.
Responses API
{
"type": "mcp",
"server_label": "servicebay",
"server_url": "https://oauth.servicebay.io/mcp",
"authorization": "sk_live_YOUR_KEY",
"require_approval": "always"
}Pass that object in tools on POST /v1/responses. Use a read-only key unless the agent must write. require_approval can be "never" only for keys you trust with the actions they can take.
Agents SDK (Python)
from agents import Agent, HostedMCPTool, Runner
agent = Agent(
name="Servicebay",
tools=[
HostedMCPTool(
tool_config={
"type": "mcp",
"server_label": "servicebay",
"server_url": "https://oauth.servicebay.io/mcp",
"authorization": "sk_live_YOUR_KEY",
"require_approval": "always",
}
)
],
)
result = await Runner.run(agent, "List open jobs")Agents SDK (JavaScript)
import { Agent, hostedMcpTool } from "@openai/agents";
const agent = new Agent({
name: "Servicebay",
tools: [
hostedMcpTool({
serverLabel: "servicebay",
serverUrl: "https://oauth.servicebay.io/mcp",
authorization: process.env.SERVICEBAY_KEY!,
requireApproval: "always",
}),
],
});The key must allow mcp. OAuth tokens must have audience https://oauth.servicebay.io/mcp (the only audience Servicebay issues).