Skip to main content

mcp server for polardb mysql

Project description

PolarDB MySQL MCP Server

PolarDB MySQL MCP Server serves as a universal interface between AI Agents and PolarDB MySQL databases. It enables seamless communication between AI Agents and PolarDB MySQL, helping AI Agents retrieve PolarDB MySQL database metadata and execute SQL operations.

Environment Variables

The following environment variables are required to connect to PolarDB MySQL database,environment Variables can be set in .env file or set in command line

  • POLARDB_MYSQL_HOST: Database host address
  • POLARDB_MYSQL_PORT: Database port
  • POLARDB_MYSQL_USER: Database user
  • POLARDB_MYSQL_PASSWORD: Database password
  • POLARDB_MYSQL_DATABASE: Database name
  • POLARDB_MYSQL_ENABLE_UPDATE: Enable update operation(default:false)
  • POLARDB_MYSQL_ENABLE_WRITE: Enable write operation(default:false)
  • POLARDB_MYSQL_ENABLE_INSER: Enable insert operation(default:false)
  • POLARDB_MYSQL_ENABLE_DDL: Enable ddl operation(default:false)
  • SSE_BIND_HOST: The host address to bind for SSE mode
  • SSE_BIND_PORT: The port to bind for SSE mode
  • RUN_MODE: The run mode(sse|stdio),(default:sse)

Components

Tools

  • execute_sql: execute sql

Resources

  • polardb-mysql://tables: List all tables for PolarDB MySQL in the current database
  • polardb-mysql://{table}/field: get the name,type and comment of the field in the table
  • polardb-mysql://{table}/data: get data from the table,default limit 50 rows

Usage

Cursor

  1. config for mcp.json
{
  "mcpServers": {
    "polardb-mysql-mcp-server": {
      "command": "uvx",
      "args": [
        "--from",
        "polardb-mysql-mcp-server",
        "run_polardb_mysql_mcp_server"
      ],
      "env": {
        "POLARDB_MYSQL_HOST": "127.0.0.1",
        "POLARDB_MYSQL_PORT": "15001",
        "POLARDB_MYSQL_USER": "xxxx",
        "POLARDB_MYSQL_PASSWORD": "xxx",
        "POLARDB_MYSQL_DATABASE": "xxx",
        "RUN_MODE": "stdio",
        "POLARDB_MYSQL_ENABLE_UPDATE": "false",
        "POLARDB_MYSQL_ENABLE_UPDATE": "false",
        "POLARDB_MYSQL_ENABLE_INSER": "false",
        "POLARDB_MYSQL_ENABLE_DDL": "false"
      }
    }
  }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polardb_mysql_mcp_server-0.4.0.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polardb_mysql_mcp_server-0.4.0-py2.py3-none-any.whl (7.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file polardb_mysql_mcp_server-0.4.0.tar.gz.

File metadata

File hashes

Hashes for polardb_mysql_mcp_server-0.4.0.tar.gz
Algorithm Hash digest
SHA256 0d8708352ab706328c8f57c9819aae4d5e0cd12e0f4d46e9f5d3ff396d8c2160
MD5 c6a15af496230614f5ef590fe371f800
BLAKE2b-256 9ac13b49a9a08d62e47cf78acbe1b867eb5bd8dd8e7c3ead8cbd1044d3e7d9d9

See more details on using hashes here.

File details

Details for the file polardb_mysql_mcp_server-0.4.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for polardb_mysql_mcp_server-0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 49a9d2b63d0aa53937248f8e293dfb174aaf079b56b7994786f7a066d8bbcf5d
MD5 c8436363d5a16644a1201b7c08c0926c
BLAKE2b-256 4db1acd89814ac09e68b3ac8182e171034aab4a3e07b7b6dcef0149ac1f6782b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page