Cursor
Add dbmcp to Cursor with the one-click install button or in mcp.json
One-click install
The button installs placeholder values; edit them in mcp.json afterwards.
It adds this server:
{
"command": "npx",
"args": ["-y", "@haymon-ai/dbmcp"],
"env": {
"DBMCP_DB_BACKEND": "mysql",
"DBMCP_DB_HOST": "127.0.0.1",
"DBMCP_DB_USER": "root",
"DBMCP_DB_PASSWORD": "change-me",
"DBMCP_DB_NAME": "mydb"
}
}Manual setup
Add the server to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project). ${env:NAME} reads a value from Cursor's environment:
{
"mcpServers": {
"dbmcp": {
"command": "dbmcp",
"args": [],
"env": {
"DBMCP_DB_BACKEND": "mysql",
"DBMCP_DB_HOST": "127.0.0.1",
"DBMCP_DB_USER": "root",
"DBMCP_DB_PASSWORD": "${env:DBMCP_DB_PASSWORD}",
"DBMCP_DB_NAME": "mydb"
}
}
}
}For a server you started with DBMCP_TRANSPORT=http:
{
"mcpServers": {
"dbmcp": {
"url": "http://127.0.0.1:9001/mcp",
"headers": { "Authorization": "Bearer ${env:DBMCP_TOKEN}" }
}
}
}Cursor also supports envFile to load variables from a .env file, so sensitive values like DBMCP_DB_PASSWORD can stay out of the JSON config.