This page explains how to connect an already running ShardingSphere-MCP HTTP Server to the OpenAI Responses API. ShardingSphere-MCP is the Apache ShardingSphere MCP Server that exposes database metadata access, controlled SQL queries, and database governance capabilities to MCP-capable AI clients and platforms.
allowed_tools, require_approval, or OAuth parameters.database_gateway_validate_proxy_connectivity for preflight validation against configured runtime databases.Streamable HTTP or HTTP/SSE.Pass ShardingSphere-MCP as an mcp tool in the tools array of a Responses API request. A minimal example is:
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-5",
tools=[
{
"type": "mcp",
"server_label": "shardingsphere",
"server_url": "https://example.com/mcp",
"allowed_tools": [
"database_gateway_search_metadata",
"database_gateway_validate_proxy_connectivity",
],
}
],
input="Use ShardingSphere-MCP to inspect the tables in the logic database.",
)
Pay attention to these fields:
server_label: the label used to identify this MCP server in tool calls and approval events.server_url: the secured remote HTTP address that fronts ShardingSphere-MCP.allowed_tools: optional. Import only a subset of ShardingSphere-MCP tools, which is useful when starting with read-only and validation tools.require_approval: optional. Approval is required by default. Disable it only after you have reviewed the tool surface and accept automatic tool calls.authorization: optional. Pass authentication data here only when the secured remote endpoint or gateway requires an OAuth or Bearer access token.
This does not enable authentication inside the built-in ShardingSphere-MCP HTTP Server.Recognition succeeds when:
mcp_list_tools output item.mcp_approval_request output item. Reply with mcp_approval_response by following the OpenAI approval flow.Invocation succeeds when:
<logic-database>.orders table.database_gateway_validate_proxy_connectivity for a configured runtime database.mcp_list_tools, approval flow events, or final query results appear as expected, the integration is working.If the integration fails, check these items first:
server_url is a secured endpoint reachable from OpenAI, not a local 127.0.0.1 address or a directly exposed unauthenticated built-in HTTP Server.mcp_list_tools; if not, start with the remote endpoint and server availability.mcp_approval_request was returned and whether the matching mcp_approval_response was sent.STDIO processes.allowed_tools.