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

Resources

  • polardb-mysql://tables: List all tables for PolarDB MySQL in the current database
  • polardb-mysql://models: List all AI models for PolarDB MySQL AI node in the current database

Resource Templates

  • 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": [
        "run_polardb_mysql_mcp_server@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.3.0.tar.gz (17.6 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.3.0-py2.py3-none-any.whl (8.2 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for polardb_mysql_mcp_server-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c3fb3d54a4c4803e9ca177fc6e572495d44618a399ab1d5c64010c4fe1fdf628
MD5 e7e141d870e51ac926756c165ff2afed
BLAKE2b-256 be41eca48307fc0457374b93ec96e5809d0dd2cc50344b83a419155776ae06fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polardb_mysql_mcp_server-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8b005a8ca24d400a22225ffe584fe812428ad53b2b1ccd19d8e9fea64ca55aa2
MD5 16ff84627bf18fce399ef1082752ff9f
BLAKE2b-256 c0e8715cd361e55080efba572349fcb1cd1f14b6a2782df4638aa32571d97bbf

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