Anthropic MCP Connector
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.
Applicable Scenarios
- Use this page when you want to attach a remote ShardingSphere-MCP server directly in the Anthropic Messages API without implementing a separate MCP client.
- Use this integration when Claude API requests should expose ShardingSphere-MCP tools for metadata queries, controlled queries, rule planning, and preflight validation.
- After integration, Claude can inspect logic databases, inspect table structures, or call
database_gateway_validate_runtime_databasefor preflight validation against configured runtime databases.
Prerequisites
- Start the HTTP MCP Server by following Quick Start.
- Expose only a secured remote HTTPS endpoint that the Anthropic Messages API can reach. The built-in ShardingSphere-MCP HTTP Server does not provide authentication or authorization.
- For remote platform access, place ShardingSphere-MCP behind a trusted gateway or reverse proxy that provides TLS termination, authentication, authorization policy, network access control, and audit logs. See Deployment and Configuration for the security boundary.
- The secured remote endpoint supports
Streamable HTTPorSSE. - Prepare an Anthropic API key.
- The current MCP Connector version requires the request header
anthropic-beta: mcp-client-2025-11-20. - If the secured remote endpoint or gateway requires OAuth or Bearer authentication, prepare an access token that can be passed as
authorization_token.
Integration Steps
Configure the integration
Set SHARDINGSPHERE_MCP_REMOTE_URL to the secured remote endpoint published by the trusted gateway.
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 @- <<EOF
{
"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": "${SHARDINGSPHERE_MCP_REMOTE_URL}",
"name": "shardingsphere"
}
],
"tools": [
{
"type": "mcp_toolset",
"mcp_server_name": "shardingsphere"
}
]
}
EOFIf the secured remote endpoint or gateway requires OAuth or Bearer authentication, read the token from a protected source and add authorization_token to the mcp_servers entry at request creation time.
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_runtime_database": {
"enabled": true
}
}
}Verify the integration
Recognition succeeds when:
- Start with a minimal request to confirm that
mcp_serversandmcp_toolsetare correctly paired and do not trigger validation errors for mismatched server names or dangling toolsets.
Invocation succeeds when:
- In a Claude conversation, run a minimal validation task such as:
- Show the tables in
logic_db. - Show columns and indexes for the
orderstable. - Call
database_gateway_validate_runtime_databasefor a configured runtime database.
- Show the tables in
- If Claude returns tool results from ShardingSphere-MCP, the integration is working.
If the integration fails, check these items first:
- Confirm that the request includes the
anthropic-beta: mcp-client-2025-11-20header. - Confirm that the
nameinmcp_serversexactly matchesmcp_server_namein themcp_toolset. - Confirm that the remote address is a secured HTTPS MCP endpoint reachable from Anthropic, not a local
127.0.0.1address or a directly exposed unauthenticated built-in HTTP Server.
Notes
- The Anthropic MCP Connector currently supports remote HTTP MCP Servers only. It does not connect to local
STDIOprocesses. - The platform integration currently supports tool calls only. It does not expose the full MCP resource surface.
- By default,
mcp_toolsetenables 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. - This feature currently requires the
anthropic-beta: mcp-client-2025-11-20header. If Anthropic updates the beta version, update the documentation and the request configuration together. - This page covers the Anthropic platform API path only. For Claude Code CLI integration, use Claude Code.
- See the Capability Catalog for the supported task surface and usage boundaries.