This page explains how to connect Claude Code to an already running ShardingSphere-MCP HTTP Server, or let Claude Code start a local STDIO MCP Server. 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_runtime_database for preflight validation.http://127.0.0.1:18088/mcp, or the actual MCP Server address you configured.Use an HTTP MCP Server:
claude mcp add --transport http shardingsphere http://127.0.0.1:18088/mcp
To make the MCP Server available across all Claude Code projects for the current user, use user scope:
claude mcp add --transport http --scope user shardingsphere http://127.0.0.1:18088/mcp
You can also create .mcp.json in the project root:
{
"mcpServers": {
"shardingsphere": {
"type": "http",
"url": "http://127.0.0.1:18088/mcp"
}
}
}
If you want Claude Code to start ShardingSphere-MCP as a local process, use STDIO:
claude mcp add --transport stdio shardingsphere -- \
/path/to/apache-shardingsphere-mcp/bin/start.sh \
/path/to/apache-shardingsphere-mcp/conf/mcp-stdio.yaml
Replace /path/to/apache-shardingsphere-mcp with the actual distribution directory.
Recognition succeeds when:
claude mcp list and confirm that shardingsphere appears in the MCP Server list./mcp
Invocation succeeds when:
<logic-database>.orders table.database_gateway_validate_runtime_database against a configured runtime database.shardingsphere server name should map to only one integration method. If you need both HTTP and STDIO, use different server names.