mysql_mcp_server icon indicating copy to clipboard operation
mysql_mcp_server copied to clipboard

how to use in cursor

Open ManojINaik opened this issue 10 months ago • 11 comments

Any one know how to setup in cursor MCP

ManojINaik avatar Feb 19 '25 10:02 ManojINaik

@ManojINaik

I haven't personally tested mysql_mcp_server in Cursor yet, but it should just work if correctly configured. https://docs.cursor.com/context/model-context-protocol

Note: MCP tools may not work with all models. MCP tools are only available to the Agent in Composer.

designcomputer avatar Feb 19 '25 12:02 designcomputer

Just tried, but could not get it working in cursor. Need instructions.

mowliv avatar Mar 06 '25 22:03 mowliv

What models did you try it with @mowliv?

designcomputer avatar Mar 06 '25 22:03 designcomputer

Claude 3.7 thinking, but I never got past the MCP settings window which said connection refused. I tried port 8000 and 8080. It wasn't clear to me whether the URL would be just http://localhost or http://localhost/sse. I tried some variants.

[image: image.png]

On Thu, Mar 6, 2025 at 2:39 PM Dana K. Williams @.***> wrote:

What models did you try it with @mowliv https://github.com/mowliv?

— Reply to this email directly, view it on GitHub https://github.com/designcomputer/mysql_mcp_server/issues/6#issuecomment-2705098937, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDDXTMFB6VD2GCIDLDDELD2TDFBBAVCNFSM6AAAAABXNZVAI2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBVGA4TQOJTG4 . You are receiving this because you were mentioned.Message ID: @.***> [image: designcomputer]designcomputer left a comment (designcomputer/mysql_mcp_server#6) https://github.com/designcomputer/mysql_mcp_server/issues/6#issuecomment-2705098937

What models did you try it with @mowliv https://github.com/mowliv?

— Reply to this email directly, view it on GitHub https://github.com/designcomputer/mysql_mcp_server/issues/6#issuecomment-2705098937, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDDXTMFB6VD2GCIDLDDELD2TDFBBAVCNFSM6AAAAABXNZVAI2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBVGA4TQOJTG4 . You are receiving this because you were mentioned.Message ID: @.***>

mowliv avatar Mar 06 '25 23:03 mowliv

@mowliv Have you tried creating a simple example using just the Claude App?

designcomputer avatar Mar 06 '25 23:03 designcomputer

No, I haven't.

On Thu, Mar 6, 2025 at 3:46 PM Dana K. Williams @.***> wrote:

@mowliv https://github.com/mowliv Have you tried creating a simple example using just the Claude App?

— Reply to this email directly, view it on GitHub https://github.com/designcomputer/mysql_mcp_server/issues/6#issuecomment-2705187064, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDDXTMTWJAW4QNGIY2XGLL2TDM3RAVCNFSM6AAAAABXNZVAI2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBVGE4DOMBWGQ . You are receiving this because you were mentioned.Message ID: @.***> [image: designcomputer]designcomputer left a comment (designcomputer/mysql_mcp_server#6) https://github.com/designcomputer/mysql_mcp_server/issues/6#issuecomment-2705187064

@mowliv https://github.com/mowliv Have you tried creating a simple example using just the Claude App?

— Reply to this email directly, view it on GitHub https://github.com/designcomputer/mysql_mcp_server/issues/6#issuecomment-2705187064, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDDXTMTWJAW4QNGIY2XGLL2TDM3RAVCNFSM6AAAAABXNZVAI2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBVGE4DOMBWGQ . You are receiving this because you were mentioned.Message ID: @.***>

mowliv avatar Mar 07 '25 00:03 mowliv

@mowliv Please try that because that may help you find any problem with the mysql_mcp_server or MySQL server settings.

designcomputer avatar Mar 07 '25 00:03 designcomputer

I tried wrapping the command in a bash script, where I export the necessary env variables. I then point the command to the bash script in cursor settings. This works with other MCP tools, but did not work here. Seems like its unable to pick up the env vars:

2025-03-10 22:46:43,301 - mysql_mcp_server - ERROR - Missing required database configuration. Please check environment variables: 2025-03-10 22:46:43,301 - mysql_mcp_server - ERROR - MYSQL_USER, MYSQL_PASSWORD, and MYSQL_DATABASE are required

jpan8866 avatar Mar 11 '25 02:03 jpan8866

I configured using uvx my mcp.json file looks like

{
    "mcpServers": {
        "mysql-mcp-server": {
            "command": "uvx",
            "args": [
                "--from",
                "mysql-mcp-server",
                "mysql_mcp_server"
            ],
            "env": {
                "MYSQL_HOST": "127.0.0.1",
                "MYSQL_PORT": "3306",
                "MYSQL_USER": "",
                "MYSQL_PASSWORD": "",
                "MYSQL_DATABASE": ""
            }
        }
    }
}

kakajansh avatar Mar 19 '25 06:03 kakajansh

https://github.com/smithery-ai/typescript-sdk/issues/129 any luck on cursor I still can't get it to work

adgower avatar Mar 24 '25 18:03 adgower

Cursor + MAMP + macOSX Setup Working Guide

Problem:
Initially, my mysql command wasn't found:

mysql -h 127.0.0.1 -P 3306 -u root -proot -e "SELECT 1"
zsh: command not found: mysql

Fix:
I added the MAMP MySQL binary path to my shell configuration:

vim ~/.zshrc

# Add this line
export PATH="/Applications/MAMP/Library/bin:$PATH"

# Apply the changes
source ~/.zshrc

Success:
Now the command works:

mysql -h 127.0.0.1 -P 3306 -u root -proot -e "SELECT 1"
mysql: [Warning] Using a password on the command line interface can be insecure.
+---+
| 1 |
+---+
| 1 |
+---+

Next Step:
Ensure uvx is installed. Then I ran the following to start the MySQL MCP server:

MYSQL_HOST=127.0.0.1 \
MYSQL_PORT=3306 \
MYSQL_USER=root \
MYSQL_PASSWORD=your_pass \
MYSQL_DATABASE=your_db \
MYSQL_SOCKET=/Applications/MAMP/tmp/mysql/mysql.sock \
MYSQL_AUTH_PLUGIN=mysql_native_password \
MYSQL_CONNECT_TIMEOUT=30 \
MYSQL_USE_PURE=True \
MYSQL_RAISE_ON_WARNINGS=True \
uvx --from mysql-mcp-server mysql_mcp_server

Output:

Starting MySQL MCP server with config:
Host: 127.0.0.1
Port: 3306
User: root
Database: your_db
2025-04-22 14:42:44,096 - mysql_mcp_server - INFO - Starting MySQL MCP server...
2025-04-22 14:42:44,096 - mysql_mcp_server - INFO - Database config: 127.0.0.1/jazz_hr as root

Final Config:
This JSON config worked as expected:

{
  "mcpServers": {
    "MySQL MCP Server": {
      "command": "uvx",
      "type": "stdio",
      "args": [
        "--from",
        "mysql-mcp-server",
        "mysql_mcp_server"
      ],
      "env": {
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root",
        "MYSQL_PASSWORD": "your_pass",
        "MYSQL_DATABASE": "your_db",
        "MYSQL_SOCKET": "/Applications/MAMP/tmp/mysql/mysql.sock",
        "MYSQL_AUTH_PLUGIN": "mysql_native_password",
        "MYSQL_CONNECT_TIMEOUT": "30",
        "MYSQL_USE_PURE": "True",
        "MYSQL_RAISE_ON_WARNINGS": "True"
      }
    }
  }
}

fahid-mahmood avatar Apr 22 '25 09:04 fahid-mahmood