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.
http://127.0.0.1:18088/mcp, or the actual MCP Server address you configured.Run the following command from the project where you use Claude Code:
claude mcp add --transport http shardingsphere http://127.0.0.1:18088/mcp
Verify that it has been added:
claude mcp list
Run the following command in Claude Code:
/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.
Describe database tasks directly in Claude Code, for example:
<logic-database>.orders table.orders table.orders.status and preview it without execution.When SQL execution or rule changes are involved, review the preview content before confirming execution.
