Claude Code
Add dbmcp to Claude Code with claude mcp add, or share it with your team in .mcp.json
Add the server with claude mcp add. Options go before the server name, and the launch command follows --:
claude mcp add --env DBMCP_DB_BACKEND=mysql --env DBMCP_DB_HOST=127.0.0.1 \
--env DBMCP_DB_USER=root --env DBMCP_DB_PASSWORD=secret --env DBMCP_DB_NAME=mydb \
--transport stdio --scope user dbmcp -- dbmcpKeep another option, such as --transport stdio, between the last --env and the name: otherwise --env reads the name as another KEY=value pair. --scope is local (default, this project only), project (writes .mcp.json), or user (all projects).
To share the server with your team, commit a .mcp.json and let each developer supply the password from their own environment with ${VAR} expansion:
{
"mcpServers": {
"dbmcp": {
"command": "dbmcp",
"args": [],
"env": {
"DBMCP_DB_BACKEND": "mysql",
"DBMCP_DB_USER": "root",
"DBMCP_DB_PASSWORD": "${DBMCP_DB_PASSWORD}",
"DBMCP_DB_NAME": "mydb"
}
}
}
}For a server you started with DBMCP_TRANSPORT=http:
claude mcp add --transport http dbmcp http://127.0.0.1:9001/mcp --header "Authorization: Bearer $DBMCP_TOKEN"