This page explains how to connect an already running ShardingSphere-MCP HTTP Server through the Anthropic MCP Connector in the Messages 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.
database_gateway_validate_proxy_connectivity for preflight validation against configured runtime databases.Streamable HTTP or SSE.anthropic-beta: mcp-client-2025-11-20.authorization_token.In a Messages API request, declare ShardingSphere-MCP in mcp_servers first, then add the matching mcp_toolset in the tools array. A minimal example is:
curl https://api.anthropic.com/v1/messages \
-H "content-type: application/json" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: mcp-client-2025-11-20" \
-d '{
"model": "claude-sonnet-4-5",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Use ShardingSphere-MCP to inspect the tables in the logic database."
}
],
"mcp_servers": [
{
"type": "url",
"url": "https://example.com/mcp",
"name": "shardingsphere"
}
],
"tools": [
{
"type": "mcp_toolset",
"mcp_server_name": "shardingsphere"
}
]
}'
If the secured remote endpoint or gateway requires OAuth or Bearer authentication, add this field to the mcp_servers entry:
"authorization_token": "YOUR_TOKEN"
To expose only a subset of tools, use default_config and configs in the mcp_toolset as an allowlist or denylist. For example, disable everything by default and enable only a small subset:
{
"type": "mcp_toolset",
"mcp_server_name": "shardingsphere",
"default_config": {
"enabled": false
},
"configs": {
"database_gateway_search_metadata": {
"enabled": true
},
"database_gateway_validate_proxy_connectivity": {
"enabled": true
}
}
}
Recognition succeeds when:
mcp_servers and mcp_toolset are correctly paired and do not trigger validation errors for mismatched server names or dangling toolsets.Invocation succeeds when:
<logic-database>.orders table.database_gateway_validate_proxy_connectivity for a configured runtime database.If the integration fails, check these items first:
anthropic-beta: mcp-client-2025-11-20 header.name in mcp_servers exactly matches mcp_server_name in the mcp_toolset.127.0.0.1 address or a directly exposed unauthenticated built-in HTTP Server.STDIO processes.mcp_toolset enables all tools exposed by the remote MCP Server. For read-only assistants or controlled trial environments, explicitly disable write-oriented tools that are not needed.anthropic-beta: mcp-client-2025-11-20 header. If Anthropic updates the beta version, update the documentation and the request configuration together.