MySQL

by kioyong

10 stars
237 downloads
Not rated
GitHub

About

Integrates with MySQL databases, enabling SELECT queries, table listings, and schema retrieval for data analysis and dynamic database interactions.

Details

Author
kioyong
Repository
kioyong/mysql-mcp-server-java
GitHub stars
10
Downloads
237
License
MIT License
Categories
Productivity, Design, Developer Tools, AI, Infrastructure, Database, Frontend
Tags
#mobile

- Execute SELECT queries
- List all tables in database
- Get table schema information

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MySQL
    Command (node, npx, python, etc.) java
    Arguments
    • Argument 1 -jar
    • Argument 2 {{ProjectDirectory}}/target/mcp-mysql-server-1.0.0.jar
    Environment
    • SPRING_DATASOURCE_URL jdbc:mysql://username:password@localhost:3306/database

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Add this to your mcp server config file:

{
  "mysql-server": {
    "command": "java",
    "args": [
      "-jar",
      "{{ProjectDirectory}}\\target\\mcp-mysql-server-1.0.0.jar"
    ],
    "env": {
      "SPRING_DATASOURCE_URL": "jdbc:mysql://username:password@localhost:3306/database"
    }
  }
}
001.png

query

Execute a SELECT SQL query and return results. Input: sql (string). Returns: List of query results (truncated after 4000 characters). Note: Only SELECT queries are allowed.

listAllTablesName

List all table names in the database. No input required. Returns: Comma-separated list of table names.

getTableSchema

Get schema information for a specific table. Input: tableName (string). Returns: Comma-separated list of column information including Column name, Data type, Nullable constraint, Default value.

- query
- Execute a SELECT SQL query and return results
- Input: sql (string)
- Returns: List of query results (truncated after 4000 characters)
- Note: Only SELECT queries are allowed

- listAllTablesName
- List all table names in the database
- No input required
- Returns: Comma-separated list of table names

- getTableSchema
- Get schema information for a specific table
- Input: tableName (string)
- Returns: Comma-separated list of column information including:
- Column name
- Data type
- Nullable constraint
- Default value

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mysql": {
            "env": {
                "SPRING_DATASOURCE_URL": "jdbc:mysql://username:password@localhost:3306/database"
            },
            "args": [
                "-jar",
                "{{ProjectDirectory}}/target/mcp-mysql-server-1.0.0.jar"
            ],
            "command": "java"
        }
    }
}

Linux

{
    "env": {
        "SPRING_DATASOURCE_URL": "jdbc:mysql://username:password@localhost:3306/database"
    },
    "args": [
        "-jar",
        "{{ProjectDirectory}}/target/mcp-mysql-server-1.0.0.jar"
    ],
    "command": "java"
}

Macos

{
    "env": {
        "SPRING_DATASOURCE_URL": "jdbc:mysql://username:password@localhost:3306/database"
    },
    "args": [
        "-jar",
        "{{ProjectDirectory}}/target/mcp-mysql-server-1.0.0.jar"
    ],
    "command": "java"
}

Windows

{
    "env": {
        "SPRING_DATASOURCE_URL": "jdbc:mysql://username:password@localhost:3306/database"
    },
    "args": [
        "-jar",
        "{{ProjectDirectory}}\\target\\mcp-mysql-server-1.0.0.jar"
    ],
    "command": "java"
}

MySQL MCP Server

Spring Boot server implementing Model Context Protocol (MCP) for MySQL database operations.

Features

- Execute SELECT queries
- List all tables in database
- Get table schema information

API

Tools

- query
- Execute a SELECT SQL query and return results
- Input: sql (string)
- Returns: List of query results (truncated after 4000 characters)
- Note: Only SELECT queries are allowed

- listAllTablesName
- List all table names in the database
- No input required
- Returns: Comma-separated list of table names

- getTableSchema
- Get schema information for a specific table
- Input: tableName (string)
- Returns: Comma-separated list of column information including:
- Column name
- Data type
- Nullable constraint
- Default value

Build

Maven build:

mvn install

Usage with Claude Desktop or Cline

Add this to your mcp server config file:

{
  "mysql-server": {
    "command": "java",
    "args": [
      "-jar",
      "{{ProjectDirectory}}\\target\\mcp-mysql-server-1.0.0.jar"
    ],
    "env": {
      "SPRING_DATASOURCE_URL": "jdbc:mysql://username:password@localhost:3306/database"
    }
  }
}
001.png

Example

002.png

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.